Rustpad
is a multi-threaded successor to the classic padbuster
, written in Rust. It abuses a Padding Oracle vulnerability to decrypt any cypher text or encrypt arbitrary plain text without knowing the encryption key!
Features
hex
, base64
, base64url
Usage
Using rustpad
to attack a padding oracle is easy. It requires only 4 pieces of information to start:
web
/script
, see below)--oracle
)--decrypt
)--block-size
)Web mode specifies that the oracle is located on the web. In other words, the oracle is a web server with a URL.
For a padding oracle attack to succeed, an oracle must say so if a cypher text with incorrect padding was provided. rustpad
will analyse the oracle’s responses and automatically calibrate itself to the oracle’s behaviour.
rustpad web –help
rustpad-web 1.8.0
Question a web-based oracle
USAGE:
rustpad {web, –web, -W} [OPTIONS] –oracle –block-size –decrypt
OPTIONS:
-A, –user-agent
User-agent to identify with
[default: rustpad/1.8.0]
-B, –block-size
Block size used by the cypher
[options: 8, 16]
-c, –consider-body
Consider the response body and content length when determining the web oracle’s response to (in)correct padding
-d, –data
Data to send in a POST request
-D, –decrypt
Original cypher text, received from the target service, which is to be decrypted
–delay
Delay between requests within a thread, in milliseconds
[default: 0]
-e, –encoding
Specify encoding used by the oracle to encode the cypher text
[options: auto, hex, base64, base64url]
[default: auto]
-E, –encrypt
Plain text to encrypt. Note: encryption mode requires a cypher text to gather necessary data
-h, –help
Print help information
-H, –header
HTTP header to send
[format: :]
-k, –insecure
Disable TLS certificate validation
-K, –keyword
Keyword indicating the location of the cypher text in the HTTP request. It is replaced by the cypher text’s value at runtime
[default: CTEXT]
-n, –no-iv
Cypher text does not include an Initialisation Vector
–no-cache
Disable reading and writing to the cache file
–no-url-encode
Disable URL encoding and decoding of cypher text
-o, –output
File path to which log output will be written
-O, –oracle
The oracle to question with forged cypher texts. This can be a URL or a shell script.
See the subcommands web --help
and script --help
respectively for further help.
–proxy-credentials
Credentials to authenticate against the proxy server with
[format: :]
-r, –redirect
Follow HTTP Redirects
-t, –threads
Amount of threads in the thread pool
[default: 64]
-T, –timeout
Web request timeout in seconds
[default: 10]
-v, –verbose
Increase verbosity of logging
-V, –version
Print version information
-x, –proxy
Proxy server to send web requests over. Supports HTTP(S) and SOCKS5
Indicate the cypher text’s location! See --keyword
for clarification.
Script mode
Script mode was made for power users or CTF players 🏴☠️ who were given a script to run. The target oracle is a local shell script.
Scripts allow you to run attacks against local oracles or more exotic services. Or you can use script mode to customize and extend rustpad
‘s features. However, if you’re missing a feature, feel free to open an issue on GitHub!
rustpad script –help
rustpad-script 1.8.0
Question a script-based oracle
USAGE:
rustpad {script, –script, -S} [OPTIONS] –oracle –block-size –decrypt
OPTIONS:
-B, –block-size
Block size used by the cypher
[options: 8, 16]
-D, –decrypt
Original cypher text, received from the target service, which is to be decrypted
–delay
Delay between requests within a thread, in milliseconds
[default: 0]
-e, –encoding
Specify encoding used by the oracle to encode the cypher text
[options: auto, hex, base64, base64url]
[default: auto]
-E, –encrypt
Plain text to encrypt. Note: encryption mode requires a cypher text to gather necessary data
-h, –help
Print help information
-n, –no-iv
Cypher text does not include an Initialisation Vector
–no-cache
Disable reading and writing to the cache file
–no-url-encode
Disable URL encoding and decoding of cypher text
-o, –output
File path to which log output will be written
-O, –oracle
The oracle to question with forged cypher texts. This can be a URL or a shell script.
See the subcommands web --help
and script --help
respectively for further help.
-t, –threads
Amount of threads in the thread pool
[default: 64]
-v, –verbose
Increase verbosity of logging
-V, –version
Print version information
Script must respond with exit code 0 for correct padding, and any other code otherwise. Cypher text is
passed as the 1st argument.
Kali Linux 2024.4, the final release of 2024, brings a wide range of updates and…
This Go program applies a lifetime patch to PowerShell to disable ETW (Event Tracing for…
GPOHunter is a comprehensive tool designed to analyze and identify security misconfigurations in Active Directory…
Across small-to-medium enterprises (SMEs) and managed service providers (MSPs), the top priority for cybersecurity leaders…
The free and open-source security platform SecHub, provides a central API to test software with…
Don't worry if there are any bugs in the tool, we will try to fix…