• Stars
    star
    100
  • Rank 340,703 (Top 7 %)
  • Language
    Python
  • License
    Other
  • Created over 1 year ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A CLI to exploit parameters vulnerable to PHP filter chain error based oracle.

PHP filter chains: file read from error-based oracle

A CLI to exploit parameters affected by the file read caused by the the error-based oracle of PHP filter chains. It can be used to leak the content of a local file when passed to vulnerable functions, such as file(), hash_file(), file_get_contents() or copy(), even when the server does not return the file content!

As long as an action is performed on a file content and the full URI is controlled, the function can be affected by the php://filter wrapper, and therefore exploited by this tool. More information in our blogpost: https://www.synacktiv.com/publications/php-filter-chains-file-read-from-error-based-oracle

The trick was first discovered and disclosed as a challenge by @hash_kitten during the DownUnderCTF 2022.

Usage

By default, the tool requires the parameters target (targeted URL), file (the local file to leak) and parameter (parameter where you want to inject). Several other options can be defined and are detailed here:

$ python3 filters_chain_oracle_exploit.py --help
usage: filters_chain_oracle_exploit.py [-h] --target TARGET --file FILE --parameter PARAMETER [--data DATA] [--headers HEADERS] [--verb VERB] [--proxy PROXY] [--in_chain IN_CHAIN]
                                       [--time_based_attack TIME_BASED_ATTACK] [--delay DELAY]

        Oracle error based file leaker based on PHP filters.
        Author of the tool : @_remsio_
        Trick firstly discovered by : @hash_kitten
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        $ python3 filters_chain_oracle_exploit.py --target http://127.0.0.1 --file '/test' --parameter 0   
        [*] The following URL is targeted : http://127.0.0.1
        [*] The following local file is leaked : /test
        [*] Running POST requests
        [+] File /test leak is finished!
        b'SGVsbG8gZnJvbSBTeW5hY2t0aXYncyBibG9ncG9zdCEK'
        b"Hello from Synacktiv's blogpost!\n"
        

optional arguments:
  -h, --help            show this help message and exit
  --target TARGET       URL on which you want to run the exploit.
  --file FILE           Path to the file you want to leak.
  --parameter PARAMETER
                        Parameter to exploit.
  --data DATA           Additionnal data that might be required. (ex : {"string":"value"})
  --headers HEADERS     Headers used by the request. (ex : {"Authorization":"Bearer [TOKEN]"})
  --verb VERB           HTTP verb to use POST(default),GET(~ 135 chars by default),PUT,DELETE
  --proxy PROXY         Proxy you would like to use to run the exploit. (ex : http://127.0.0.1:8080)
  --in_chain IN_CHAIN   Useful to bypass weak strpos configurations, adds the string in the chain. (ex : KEYWORD)
  --time_based_attack TIME_BASED_ATTACK
                        Exploits the oracle as a time base attack, can be improved. (ex : True)
  --delay DELAY         Set the delay in second between each request. (ex : 1, 0.1)

Improvements

Other features may be added to the tool, feel free to contribute if you have ideas!

More Repositories

1

HopLa

HopLa Burp Suite Extender plugin - Adds autocompletion support and useful payloads in Burp Suite
Java
549
star
2

php_filter_chain_generator

Python
352
star
3

eos

Enemies Of Symfony - Debug mode Symfony looter
Python
234
star
4

bip

Python
188
star
5

Windows-kernel-SegmentHeap-Aligned-Chunk-Confusion

PoC exploiting Aligned Chunk Confusion on Windows kernel Segment Heap
C
171
star
6

lumina_server

Local server for IDA Lumina feature
Python
169
star
7

QLinspector

Finding Java gadget chains with CodeQL
CodeQL
135
star
8

rulesfinder

Machine-learn password mangling rules
Rust
91
star
9

dotNIET

Python
85
star
10

ica2tcp

A SOCKS proxy for Citrix.
C
75
star
11

nord-stream

Nord Stream is a tool that allows you to list the secrets stored inside CI/CD environments and extract them by deploying malicious pipelines. It currently supports Azure DevOps and GitHub.
Python
68
star
12

vmx_intrinsics

VMX intrinsics plugin for Hex-Rays decompiler
Python
67
star
13

samsung-q60t-exploit

JavaScript
56
star
14

PS4-webkit-exploit-6.XX

Webkit exploit that give arbitrary R/W on 6.XX PS4 firmwares
JavaScript
54
star
15

shannon-dbg

Debugger for the Shannon Baseband
C
51
star
16

Prox-Ez

Python
45
star
17

CVE-2021-40539

Exploitation code for CVE-2021-40539
Python
44
star
18

CVE-2021-27246_Pwn2Own2020

Python
42
star
19

CVE-2021-3492

PoC for CVE-2021-3492 used at Pwn2Own 2021
C
41
star
20

burp-jq

Burp extension to filter JSON on the fly with JQ queries in the HTTP message viewer.
Java
41
star
21

io_uring_scanner

io_uring based network scanner written in Rust
Rust
35
star
22

CVE-2021-1782

C
35
star
23

AMSI-Bypass

Lists of AMSI triggers (VBA, JScript / VBScript)
32
star
24

Exim-CVE-2019-15846

PoC materials to exploit CVE-2019-15846
Python
31
star
25

Radmin3-Password-Cracker

Radmin Server 3 credentials dumper/cracker
C
30
star
26

CVE-2020-27950

CVE-2020-27950 exploit
C
30
star
27

bhyve

C
28
star
28

CTF-Write-ups

Some CTF Write-ups
Python
21
star
29

canon-mf644

Python
21
star
30

astrolock

A purposely vulnerable application in order to demonstrate PHP payload smuggling techniques for PNG files.
PHP
17
star
31

mojarragadget

Java
15
star
32

laravel_cookie_killer

Python
15
star
33

toy-wasm-symbexp

A toy symbolic execution engine, supporting the blog article ...
Haskell
15
star
34

yealink_tools

Reverse engineering scripts designed for extracting Yealink VOIP upgrade files
Python
12
star
35

Exim-CVE-2018-6789

PoC materials to exploit CVE-2018-6789
C
9
star
36

CaptainHook

Java
7
star
37

CVE-2019-8942

WordPress crop-image exploitation
Python
5
star
38

canon-tools

Tools used for decrypting Canon printers firmwares
Python
5
star
39

Netgear_Pwn2Own2021

Exploit used against the Netgear R6700v3 during Pwn2Own Austin 2021
Python
5
star
40

Weggli_rules_SSTIC2023

4
star
41

action-octoscan

📦 :octocat: A GitHub Action that performs a security scan of your GitHub Actions.
Shell
1
star
42

pridelocker-analysis

This repository contains a IDA Python script to recover PrideLocker ESX encryptor strings and a YARA rule
Python
1
star