MiTM over TCP to intercept and manipulate flow
Project description
p4lantir
p4lantir is a simple tool to perform Man-in-the-Middle over TCP using ARP spoofing, allowing to intercept, drop, forward and see TCP flows.
This project is intended to be relatively simple, making simple future contributions for new features/bug fix.
[!CAUTION] This ethical hacking project is intended for educational purposes and awareness training sessions only. I decline all responsability about the usage of this project.
Screenshots
Installation
- Install the system dependencies (arpspoof, iptables)
- Create python virtual environnement
- Install the package
Setup instructions :
Debian-based systems
sudo apt install dsniff iptables
python3 -m venv venv
source venv/bin/activate
pip install p4lantir
Archlinux
pacman -S dsniff iptables
python3 -m venv venv
source venv/bin/activate
pip install p4lantir
Note : the package can also be downloaded from the release and installed using the
.whlfile andpip.
Usage
[!WARNING] You need to run the script as root due to arpspoof and iptables. You should open a shell as root, activate the venv and then use p4lantir.
usage: p4lantir [-h] --host-1 HOST_1 --host-2 HOST_2 [--gateway GATEWAY] -i INTERFACE -l LPORT [--pport PPORT] [--debug]
Man-in-the-Middle over TCP terminal app.
options:
-h, --help show this help message and exit
--host-1 HOST_1 First host to spoof, must be the host instanciating the connection
--host-2 HOST_2 Second host to spoof
--gateway GATEWAY Gateway IP
-i, --interface INTERFACE
Interface to perform arp spoofing
-l, --lport LPORT Port to listen for MITM attack
--pport PPORT Internal port used for proxy.
--debug Enable debug mode.
Examples
Client/server in the same localhost
Let say that a client at IP C connect to a remote server at IP R, both in the same LAN. You need to know the name of the interface that connects you this LAN (let call this iface. Then your command should look like :
p4lantir --host-1 [replace with C] \
--host-2 [replace with R] \
-i [replace with iface] \
-lport [server's listening port]
About the listening port, if you intend to intercept SMTP you may choose
25,80for HTTP, and so on ...
Client/server on a different LAN
If the client is in the same LAN as you and the server is not in your LAN, then you have to add another parameter : the gateway IP. p4lantir will then spoof the gateway IP and open a connection to the server.
p4lantir --host-1 [replace with C] \
--host-2 [replace with R] \
--gateway [replace with gw's IP]
-i [replace with iface] \
-lport [server's listening port]
Documentation
The source-code documentation is available here
Contributing
All contributions are welcome !
Please see CONTRIBUTING.md for more details.
License
This project is under the GPL-v3 license, please see LICENSE.TXT
Project details
Release history Release notifications | RSS feed
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 p4lantir-1.0.2.tar.gz.
File metadata
- Download URL: p4lantir-1.0.2.tar.gz
- Upload date:
- Size: 337.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
453326e910a977daf80b0eadb8b18f9534c3c5f2e90f41ddd23b977066a1ff31
|
|
| MD5 |
820fb8502668bf67c562cae94633b43d
|
|
| BLAKE2b-256 |
7d79500149476dc7ac80d1907dca1ed6e8e09fc647effe6b392c24259211ffe6
|
Provenance
The following attestation bundles were made for p4lantir-1.0.2.tar.gz:
Publisher:
upload-to-pypi.yml on acmo0/p4lantir
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
p4lantir-1.0.2.tar.gz -
Subject digest:
453326e910a977daf80b0eadb8b18f9534c3c5f2e90f41ddd23b977066a1ff31 - Sigstore transparency entry: 433323540
- Sigstore integration time:
-
Permalink:
acmo0/p4lantir@2d26d3304e40789e4657a0ad4f0c414eca257edb -
Branch / Tag:
refs/tags/1.0.2 - Owner: https://github.com/acmo0
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
upload-to-pypi.yml@2d26d3304e40789e4657a0ad4f0c414eca257edb -
Trigger Event:
push
-
Statement type:
File details
Details for the file p4lantir-1.0.2-py3-none-any.whl.
File metadata
- Download URL: p4lantir-1.0.2-py3-none-any.whl
- Upload date:
- Size: 26.9 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 |
91dc07eac206321b2ea3b71a2f743d6dadcb55c7f96f3f5051dad947a7303ffd
|
|
| MD5 |
51416cdfb63a44674fa34cca60f890bb
|
|
| BLAKE2b-256 |
33e921ebfb0ea26c685ca465e59a1fc135de4301b89b3b75f4d65543d94f6028
|
Provenance
The following attestation bundles were made for p4lantir-1.0.2-py3-none-any.whl:
Publisher:
upload-to-pypi.yml on acmo0/p4lantir
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
p4lantir-1.0.2-py3-none-any.whl -
Subject digest:
91dc07eac206321b2ea3b71a2f743d6dadcb55c7f96f3f5051dad947a7303ffd - Sigstore transparency entry: 433323557
- Sigstore integration time:
-
Permalink:
acmo0/p4lantir@2d26d3304e40789e4657a0ad4f0c414eca257edb -
Branch / Tag:
refs/tags/1.0.2 - Owner: https://github.com/acmo0
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
upload-to-pypi.yml@2d26d3304e40789e4657a0ad4f0c414eca257edb -
Trigger Event:
push
-
Statement type: