본문 바로가기

전체 글

(90)
[드림핵/워게임] ssp_000 https://dreamhack.io/wargame/challenges/32 ssp_000 Desciption 이 문제는 작동하고 있는 서비스(ssp_000)의 바이너리와 소스코드가 주어집니다. 프로그램의 취약점을 찾고 SSP 방어 기법을 우회하여 익스플로잇해 셸을 획득한 후, "flag" 파일을 읽으세요 dreamhack.io 문제 파일을 다운 받으면 ssp_000.c와 실행 파일이 있다. #include #include #include #include void alarm_handler() { puts("TIME OUT"); exit(-1); } void initialize() { setvbuf(stdin, NULL, _IONBF, 0); setvbuf(stdout, NULL, _IONBF, 0); s..
[드림핵/워게임] Return to Shellcode https://dreamhack.io/wargame/challenges/352 Return to Shellcode Description Exploit Tech: Return to Shellcode에서 실습하는 문제입니다. dreamhack.io 문제 파일을 다운 받으면 r2s.c와 실행 파일이 있다. // Name: r2s.c // Compile: gcc -o r2s r2s.c -zexecstack #include #include void init() { setvbuf(stdin, 0, 2, 0); setvbuf(stdout, 0, 2, 0); } int main() { char buf[0x50]; init(); printf("Address of the buf: %p\n", buf); printf("Di..
[드림핵/워게임] web-ssrf https://dreamhack.io/wargame/challenges/75/ web-ssrf flask로 작성된 image viewer 서비스 입니다. SSRF 취약점을 이용해 플래그를 획득하세요. 플래그는 /app/flag.txt에 있습니다. 문제 수정 내역 2023.07.17 css, html 제공 Reference Server-side Basic dreamhack.io 입력 칸에 바로 /flag.txt를 넣으니 뭐가 뜨긴 한다. 이게 뭔가 하고 보니 404... 에러였다. 코드를 보자 @app.route("/img_viewer", methods=["GET", "POST"]) def img_viewer(): if request.method == "GET": return render_template(..
[드림핵/워게임] Carve Party https://dreamhack.io/wargame/challenges/96 Carve Party Description 할로윈 파티를 기념하기 위해 호박을 준비했습니다! 호박을 10000번 클릭하고 플래그를 획득하세요! dreamhack.io 문제 파일을 다운 받으면 html 파일이 하나 있다. 이를 클릭해 실행시켜 주면 호박이 하나 나온다. 몇 번 클릭해 주니 코인지 입인지 모를 무언가가 나왔다. 개발자 도구로 코드를 좀 살펴 보자 var pumpkin = [ 124, 112, 59, 73, 167, 100, 105, 75, 59, 23, 16, 181, 165, 104, 43, 49, 118, 71, 112, 169, 43, 53 ]; var counter = 0; var pie = 1; functi..
[드림핵/워게임] command-injection-1 https://dreamhack.io/wargame/challenges/44 command-injection-1 특정 Host에 ping 패킷을 보내는 서비스입니다. Command Injection을 통해 플래그를 획득하세요. 플래그는 flag.py에 있습니다. Reference Introduction of Webhacking dreamhack.io input에 ip를 넣어 주면 ping을 보내 주는 사이트이다. 플래그가 flag.py에 있으므로 cat을 이용해 까 주려고 했지만, 요청한 형식과 일치 시키라고 뜬다. 개발자 도구를 열고 sources를 확인해 보면 이런 코드가 있는 것을 볼 수 있다. 더보기 태그의 pattern 속성 pattern = "[A-Za-z0-9.]{5,20}" [A-Za-z0..
[드림핵/워게임] simple_sqli https://dreamhack.io/wargame/challenges/24 simple_sqli 로그인 서비스입니다. SQL INJECTION 취약점을 통해 플래그를 획득하세요. 플래그는 flag.txt, FLAG 변수에 있습니다. Reference Server-side Basic dreamhack.io 정말 심플하게 로그인 창만 구현되어 있다. 코드를 보자 @app.route('/login', methods=['GET', 'POST']) def login(): if request.method == 'GET': return render_template('login.html') else: userid = request.form.get('userid') userpassword = request.form.g..
[pwnable.kr/포너블] bof https://pwnable.kr/play.php https://pwnable.kr/play.php pwnable.kr 우선 wget으로 bof.c, 실행 파일을 다운 받았다. 코드부터 보자 #include #include #include void func(int key){ char overflowme[32]; printf("overflow me : "); gets(overflowme); // smash me! if(key == 0xcafebabe){ system("/bin/sh"); } else{ printf("Nah..\n"); } } int main(int argc, char* argv[]){ func(0xdeadbeef); return 0; } 1. func() 함수의 인자로 0xdeadbeef를..
[드림핵/워게임] basic_exploitation_001 https://dreamhack.io/wargame/challenges/3 basic_exploitation_001 Description 이 문제는 서버에서 작동하고 있는 서비스(basicexploitation001)의 바이너리와 소스 코드가 주어집니다. 프로그램의 취약점을 찾고 익스플로잇해 "flag" 파일을 읽으세요. "flag" 파일의 내용을 dreamhack.io 문제 파일을 다운 받으면 basic_exploitation_001.c파일과 실행 파일이 있다. #include #include #include #include void alarm_handler() { puts("TIME OUT"); exit(-1); } void initialize() { setvbuf(stdin, NULL, _IONBF..