🧪Vial
Vial is a blazing fast python framework
focused on exploiting Flask applications.
It allows efficient session cookie "forging" and decoding.
It also makes it possible to automatically obtain and brute-force session keys.
🕰 Introducing: Remote Code Execution
Vial's new feature is the remote code execution utility that abuses Werkzeug's debug console, when left activated in a production environment.
The debugger's console is sometimes protected by a PIN which is generated on the server's side in a deterministic way using a combination of public and possibly private information of the server/website project itself.
To reverse the PIN these "secret" and "public" bits are required although can be obtained by exploiting other vulnerabilities such as arbitrary file read/path traversal or through phishing campaigns.
Vial also accepts already obtained application PIN. After collecting the PIN it sends a malicious request to the target forcing him to connect to a previously started TCP server giving the attacker a shell.
Usage
Vial runs as a Python module.
For a list of all possible options, run the following command
$ python -m vial
Fetching and Decoding session cookies
It is possible to locally decode session data since Flask cookies are signed rather than encrypted. For this, you can select the decode
mode.
Session cookies can be obtained by inspecting HTTP requests using a proxy. The default name for the cookies is simply, "session"
.
You can also use Vial's automatic session fetching utility by passing the --from
argument.
Note
Not all pages of a web application return a session. Make sure to pass a URL
that does.
Signing (Session Forging)
Once you've obtained the server's secret key that was used to encode the session data, you'll be able to forge your own. For this, you can use the encode
mode.
Last updated