LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

flask-unsign

Flask session cookie manipulation and cracking

TLDR

Decode a Flask session cookie
$ flask-unsign --decode --cookie "[cookie_value]"
copy
Brute force secret key
$ flask-unsign --unsign --cookie "[cookie]" --wordlist [wordlist.txt]
copy
Sign a cookie with known key
$ flask-unsign --sign --cookie "{'user':'admin'}" --secret "[key]"
copy
Fetch and decode a cookie directly from a URL
$ flask-unsign --decode --server https://[example.com]/
copy
Show cookie without verification
$ flask-unsign --decode --cookie "[cookie]" --no-verify
copy

SYNOPSIS

flask-unsign [options]

DESCRIPTION

Flask-unsign is a security testing tool for analyzing and manipulating Flask session cookies. Flask stores session data in cryptographically signed cookies, and this tool can decode the contents, attempt to recover the secret key through brute-force attacks, and craft custom signed cookies.The tool is primarily used in web application security assessments to test Flask applications for weak secret keys. If the secret key can be recovered, attackers could forge arbitrary session data, potentially leading to privilege escalation or authentication bypass vulnerabilities.Flask-unsign supports multithreaded brute-forcing, custom wordlists, and both encoding and decoding operations. It can work with sessions even when the signature verification fails, allowing inspection of tampered or expired cookies.

PARAMETERS

--decode

Decode a session cookie and print its contents.
--unsign
Brute-force the secret key from a signed session cookie.
--sign
Sign a cookie value with a known secret key.
--cookie value
Session cookie value to operate on.
--server url
Automatically fetch the session cookie from the given URL.
--secret, -S key
Secret key used to sign or verify a cookie.
--wordlist file
Wordlist file to use for brute-forcing the secret key.
--threads num
Number of threads to use during brute-forcing.
--no-verify
Skip signature verification when decoding.
--salt salt
Custom salt string (default: `cookie-session`).
--legacy
Use the older itsdangerous signing algorithm for compatibility with older Flask apps.
--no-literal-eval
Disable Python literal evaluation of wordlist entries.

INSTALL

nix profile install nixpkgs#flask-unsign
copy

SEE ALSO

flask(1), hashcat(1), john(1)

Braincup
Open source brain training for math, memory and focus
Braincup mini-games
41 mini-games · Apache-2.0
No ads · No tracking
Play in browser
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid
276 stars
From the maker of Linux Command Library
Copied to clipboard
Braincup
Open source brain training for math, memory and focus. 41 mini-games, from mental arithmetic to Sudoku, N-Back and Solo Chess.
Apache-2.0 licensed · No ads · No tracking · No account
From the maker of Linux Command Library
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid