1. g++ 을 이용하여 파일하나를 만든다.
suexec.cpp
#include <stdlib.h>
using namespace std;
int main()
{
system("cd /var/www/html; ./print.py");
return 0;
}
g++ -o setuid.do suexec.cpp
chmod 4755 setuid.do
cgi-bin 디렉토리로 setuid.do 이동시킨다.
print.py
#!/usr/bin/env python
import os
#for html view
print "Content-Type: text/planin\n\n"
os.system("mkdir byoungguk")
print "byoungguk directory create ok"
http://localhost/cgi-bin/setuid.do
서버에 확인하면 정상적으로 디렉토리가 생성이 되어 있다.
게시판 목록
팁게시판
디자인과 관련된 유용한 정보를 공유하세요.
질문은 상단의 QA에서 해주시기 바랍니다.
질문은 상단의 QA에서 해주시기 바랍니다.
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 4452 |
silky
|
13년 전 | 748 | |
| 4451 |
silky
|
13년 전 | 630 | |
| 4450 |
silky
|
13년 전 | 1951 | |
| 4449 |
silky
|
13년 전 | 560 | |
| 4448 |
silky
|
13년 전 | 573 | |
| 4447 |
silky
|
13년 전 | 880 | |
| 4446 |
silky
|
13년 전 | 614 | |
| 4445 |
silky
|
13년 전 | 464 | |
| 4444 |
|
13년 전 | 835 | |
| 4443 |
복이219
|
13년 전 | 966 | |
| 4442 |
바부바부팅이
|
13년 전 | 1004 | |
| 4441 | 13년 전 | 1759 | ||
| 4440 | 13년 전 | 914 | ||
| 4439 | 13년 전 | 499 | ||
| 4438 | 13년 전 | 735 | ||
| 4437 | 13년 전 | 1338 | ||
| 4436 | 13년 전 | 814 | ||
| 4435 | 13년 전 | 448 | ||
| 4434 |
|
13년 전 | 1376 | |
| 4433 | 13년 전 | 493 | ||
| 4432 | 13년 전 | 474 | ||
| 4431 | 13년 전 | 397 | ||
| 4430 | 13년 전 | 702 | ||
| 4429 | 13년 전 | 447 | ||
| 4428 | 13년 전 | 900 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기