PyMultitor - Never Stop Even If Your IP Dropped.
Project description
PyMultiTor
Python Multi Threaded Tor Proxy,
Did you ever want to be at two different places at the same time?
When I asked myself this question, I actually started developing this solution in my mind.
While performing penetration tests there are often problems caused by security devices that block the "attacking" IP.
This really annoyed me, so I wrote a script to supply a solution for this problem.
With a large number of IP addresses performing the attacks, better results are guaranteed - especially when attempting
attacks to bypass Web Application Firewalls, Brute-Force type attacks and many more.
[Blackhat Asia] https://www.blackhat.com/asia-17/arsenal.html#pymultitor
[Owasp-IL Presentation] https://www.owasp.org/images/3/3d/OWASPIL-2016-02-02_PyMultiTor_TomerZait.pdf
[DigitalWhisper Article (Hebrew)] http://www.digitalwhisper.co.il/files/Zines/0x2E/DW46-3-PyMultitor.pdf
Installation
Prerequisites
- Python 3.10+.
- mitmproxy (https://mitmproxy.org/).
- tor.
- On Ubuntu / Kali,
sudo apt install -y tor - On Centos,
sudo yum install -y tor - On Fedora,
sudo dnf install -y tor - On Windows,
- download tor expert bundle: https://www.torproject.org/download/tor/
- insert tor to your path environment:
{tor-win32-*_path}\Tor - if you don't know how remember tor.exe path and use
--tor-cmdargument on pymultitor (for example:pymultitor --tor-cmd "c:\Pentest\Web\tor-win32-0.2.9.9\Tor\tor.exe")
- On MacOS,
brew install tor
- On Ubuntu / Kali,
From pip
pip3 install pymultitor
From Docker
docker pull realgam3/pymultitor
From Source
git clone https://github.com/realgam3/pymultitor.git
cd pymultitor
# Install python dependencies.
# Depending on your setup, one or both of these may require sudo.
pip3 install -r requirements.txt
python3 setup.py install
# Confirm that everything works
pymultitor --help
Bug reports on installation issues are welcome!
Usage
Basic Usage
- Run
pymultitor --on-string "Your IP Address Blocked". - On your script use proxy (
http://127.0.0.1:8080).
When the stringYour IP Address Blockedwill present in the response content, you will exit from another IP address.
Docker Usage
- Run
docker run --rm -p 8080:8080 realgam3/pymultitor --on-string "Your IP Address Blocked". - On your script use proxy (
http://127.0.0.1:8080).
When the stringYour IP Address Blockedwill present in the response content, you will exit from another IP address.
API Usage
PyMultiTor provides a REST API for managing proxy identities. You can use the API to change your proxy identity on demand.
Authentication
The API requires authentication using a Bearer token. You can set the token in two ways:
-
Environment Variable: Set the
PYMULTITOR_TOKENenvironment variable:export PYMULTITOR_TOKEN="your-secret-token-here"
Note: If
PYMULTITOR_TOKENis not set, PyMultiTor will automatically generate a random token for you. -
Command Line: Use the
--authparameter when starting PyMultiTor:pymultitor --auth "username:your-secret-token-here"
Endpoints
Change Identity
- URL:
/identity - Method:
POST
Example Usage:
curl http://pymultitor/identity -X POST \
--header "Proxy-Authorization: Bearer {Token}" \
--proxy http://localhost:8080
Status
- URL:
/status - Method:
GET
Example Usage:
curl http://pymultitor/status \
--header "Proxy-Authorization: Bearer {Token}" \
--proxy http://localhost:8080
Note: Replace {Token} with your actual authentication token.
Command Line Arguments
pymultitor --help
usage: pymultitor.py [-h] [-v] [-lh LISTEN_HOST] [-lp LISTEN_PORT] [-s] [-a AUTH] [-i] [-d] [-p PROCESSES] [-c CMD] [-e CONFIG] [-t TIMEOUT] [-r TRIES]
[--request-timeout REQUEST_TIMEOUT] [--on-count ON_COUNT] [--on-string ON_STRING] [--on-regex ON_REGEX] [--on-rst] [--on-status-code [ON_STATUS_CODE ...]]
[--on-timeout]
options:
-h, --help show this help message and exit
-v, --version show program's version number and exit
-lh, --host LISTEN_HOST
proxy listen host. (default: 127.0.0.1)
-lp, --port LISTEN_PORT
proxy listen port (default: 8080)
-s, --socks use as socks proxy (not http proxy) (default: False)
-a, --auth AUTH set proxy authentication (format: 'username:pass') (default: )
-i, --insecure insecure ssl (default: False)
-d, --debug Debug Log. (default: False)
-p, --tor-processes PROCESSES
number of tor processes in the cycle (default: 2)
-c, --tor-cmd CMD tor cmd (executable path + arguments) (default: tor)
-e, --tor-config CONFIG
tor extended json configuration (default: {})
-t, --tor-timeout TIMEOUT
timeout in seconds for starting a tor instance; 0 disables timeout (default: 90)
-r, --tor-tries TRIES
number tries to start a tor instance before it fails (default: 5)
--request-timeout REQUEST_TIMEOUT
timeout in seconds for http requests; 0 disables timeout (default: 0)
--on-count ON_COUNT change ip every x requests (resources also counted) (default: 0)
--on-string ON_STRING
change ip when string found in the response content (default: )
--on-regex ON_REGEX change ip when regex found in The response content (default: )
--on-rst change ip when connection closed with tcp rst (default: False)
--on-status-code [ON_STATUS_CODE ...]
change ip when one of the specified status codes is returned (default: [])
--on-timeout change ip when request times out (default: False)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file PyMultitor-4.1.0.tar.gz.
File metadata
- Download URL: PyMultitor-4.1.0.tar.gz
- Upload date:
- Size: 22.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e172373846aa4032b3aaee1bf646b8287c298de73e29ec04df08227966d56410
|
|
| MD5 |
1b3a34bbdb74aa2b753805147c06ab3c
|
|
| BLAKE2b-256 |
a201668dd491901ae10b6c1711075fc74a013a349418c91115e18736a9ee5813
|
Provenance
The following attestation bundles were made for PyMultitor-4.1.0.tar.gz:
Publisher:
publish.yml on realgam3/pymultitor
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pymultitor-4.1.0.tar.gz -
Subject digest:
e172373846aa4032b3aaee1bf646b8287c298de73e29ec04df08227966d56410 - Sigstore transparency entry: 452876903
- Sigstore integration time:
-
Permalink:
realgam3/pymultitor@5c6e869855effc0ddf3f9b99b6b2f0bfb6e46f24 -
Branch / Tag:
refs/tags/v4.1 - Owner: https://github.com/realgam3
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@5c6e869855effc0ddf3f9b99b6b2f0bfb6e46f24 -
Trigger Event:
push
-
Statement type:
File details
Details for the file PyMultitor-4.1.0-py3-none-any.whl.
File metadata
- Download URL: PyMultitor-4.1.0-py3-none-any.whl
- Upload date:
- Size: 22.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
aac96d2d70b077aacb6a596aceb373c260b087ee40aa0039993339a21362152c
|
|
| MD5 |
989d01c6bc87c71eabe728fc220dd6d6
|
|
| BLAKE2b-256 |
a48dc2e1a6dd60f49a337e75d4612306ddcc698be6e49e2dfcd5583f5a4e8f1a
|
Provenance
The following attestation bundles were made for PyMultitor-4.1.0-py3-none-any.whl:
Publisher:
publish.yml on realgam3/pymultitor
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pymultitor-4.1.0-py3-none-any.whl -
Subject digest:
aac96d2d70b077aacb6a596aceb373c260b087ee40aa0039993339a21362152c - Sigstore transparency entry: 452876906
- Sigstore integration time:
-
Permalink:
realgam3/pymultitor@5c6e869855effc0ddf3f9b99b6b2f0bfb6e46f24 -
Branch / Tag:
refs/tags/v4.1 - Owner: https://github.com/realgam3
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@5c6e869855effc0ddf3f9b99b6b2f0bfb6e46f24 -
Trigger Event:
push
-
Statement type: