Skip to main content

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

  1. Install mtproto-mitm

  2. 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.
  3. 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.
    
  4. 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


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.0b3.tar.gz (324.8 kB view details)

Uploaded Source

Built Distribution

mtproto_mitm-0.1.0b3-py3-none-any.whl (1.8 MB view details)

Uploaded Python 3

File details

Details for the file mtproto_mitm-0.1.0b3.tar.gz.

File metadata

  • Download URL: mtproto_mitm-0.1.0b3.tar.gz
  • Upload date:
  • Size: 324.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.1 CPython/3.11.8 Linux/6.6.4-100.fc38.x86_64

File hashes

Hashes for mtproto_mitm-0.1.0b3.tar.gz
Algorithm Hash digest
SHA256 89ad7712b050268fba94d6714e85d638d186e7180957097e418ccb9c31723f92
MD5 da5e7498a783e3afe6c2521b20737333
BLAKE2b-256 4c77fd8de4f625427243f5b0c0efa4024f77b734838d52316e155604782d8463

See more details on using hashes here.

File details

Details for the file mtproto_mitm-0.1.0b3-py3-none-any.whl.

File metadata

  • Download URL: mtproto_mitm-0.1.0b3-py3-none-any.whl
  • Upload date:
  • Size: 1.8 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.1 CPython/3.11.8 Linux/6.6.4-100.fc38.x86_64

File hashes

Hashes for mtproto_mitm-0.1.0b3-py3-none-any.whl
Algorithm Hash digest
SHA256 af06977dace2a2820a232a639f93ee0fb8301e4b6edbf119d07f8c9cdb4e8c0d
MD5 d63a9c1c16628cce55dda36851c6ad97
BLAKE2b-256 921ba1cc478afc81c382680bf6e130812e3e6bd4dde112fe064fa7f06e9efae5

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page