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
서버에 확인하면 정상적으로 디렉토리가 생성이 되어 있다.
게시판 목록
프로그램
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 30 |
아우겐나이스
|
21년 전 | 4110 | |
| 29 |
아우겐나이스
|
21년 전 | 4485 | |
| 28 |
아우겐나이스
|
21년 전 | 3508 | |
| 27 | 21년 전 | 5889 | ||
| 26 | 21년 전 | 3168 | ||
| 25 | 21년 전 | 6146 | ||
| 24 | 18년 전 | 3704 | ||
| 23 | 21년 전 | 3698 | ||
| 22 | 21년 전 | 4286 | ||
| 21 | 21년 전 | 3877 | ||
| 20 | 21년 전 | 4284 | ||
| 19 | 21년 전 | 6729 | ||
| 18 | 21년 전 | 4776 | ||
| 17 | 21년 전 | 7023 | ||
| 16 | 21년 전 | 4215 | ||
| 15 | 21년 전 | 2681 | ||
| 14 | 21년 전 | 5015 | ||
| 13 | 21년 전 | 3439 | ||
| 12 |
Recluse
|
21년 전 | 3916 | |
| 11 |
아우겐나이스
|
21년 전 | 3599 | |
| 10 |
Recluse
|
21년 전 | 3441 | |
| 9 | 21년 전 | 4060 | ||
| 8 | 21년 전 | 5230 | ||
| 7 | 21년 전 | 4803 | ||
| 6 | 21년 전 | 5755 | ||
| 5 | 21년 전 | 4163 | ||
| 4 | 21년 전 | 4897 | ||
| 3 | 21년 전 | 4786 | ||
| 2 | 21년 전 | 3291 | ||
| 1 | 22년 전 | 4382 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기