Telegram mtproto mitm server.
Project description
MTProto MITM server
Telegram mtproto mitm server.
This project must be used for research purposes only.
Installation
Requirements:
- Python 3.11+
pip install mtproto-mitm
TODO
- Record mtproto connections to files to allow reviewing them later
- Add cli interface
- Add web interface ?
Usage
-
Install mtproto-mitm
-
Get your telegram auth key:
- Telethon or Pyrogram: you need session file and any sqlite reader. Open session file with sqlite reader and run "SELECT HEX(auth_key) FROM sessions;"
- Telegram for Android (not Telegram X): you need root access. Copy tgnet.dat file from telegram directory (/data/data/<package name>/files/tgnet.dat) from your android device to your pc. Now you can use tgnet to extract key: use code from example.
- Telegram Desktop: you can use opentele to extract auth key from tdata folder.
-
Run MTProto-MITM:
Usage: python -m mtproto_mitm [OPTIONS] Options: -h, --host TEXT Proxy host to run on. -p, --port INTEGER Proxy port to run on. -k, --key TEXT Hex-encoded telegram auth key. -f, --keys-file TEXT File with telegram auth keys. -q, --quiet Do not show requests in real time. -o, --output TEXT Directory to which mtproto requests will be saved. --proxy-no-auth Disable authentication for proxy. --proxy-user TEXT Proxy user in login:password format. --help Show this message and exit.
-
Set socks5 proxy settings on your telegram client to host/port/user you specified on last step.
Examples
python -m mtproto_mitm --host 127.0.0.1 --port 1080 --key 0F5B...A38F --keys-file ./auth_keys
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
mtproto_mitm-0.1.0b2.tar.gz
(324.4 kB
view hashes)
Built Distribution
Close
Hashes for mtproto_mitm-0.1.0b2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c15833a8f89ca735618d5c3e2405b7b24a381c097481668fb08b52b64ef6bc1c |
|
MD5 | fa5b852b845cdcc60a6b91811195029c |
|
BLAKE2b-256 | c6ac9e8fc925f06e46445f63ddfad96e811504264286f1eb0235df5d0f999f22 |