GithubHelp home page GithubHelp logo

mtproto-mitm's Introduction

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

mtproto-mitm's People

Contributors

ruslanuc avatar

Watchers

 avatar

Forkers

leba0

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.