mtproto-mitm


Namemtproto-mitm JSON
Version 0.1.0b3 PyPI version JSON
download
home_pageNone
SummaryTelegram mtproto mitm server.
upload_time2024-08-08 12:13:03
maintainerNone
docs_urlNone
authorRuslanUC
requires_python<4.0,>=3.11
licenseNone
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # MTProto MITM server

Telegram mtproto mitm server.<br>

**This project must be used for research purposes only.**

## Installation
**Requirements:**
  - Python 3.11+

```shell
pip install mtproto-mitm
```

# TODO
  - [ ] Record mtproto connections to files to allow reviewing them later
  - [x] 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](https://github.com/RuslanUC/tgnet) to extract key: use code from [example](https://github.com/RuslanUC/tgnet).
    - Telegram Desktop: you can use [opentele](https://github.com/thedemons/opentele) to extract auth key from tdata folder.
3. Run MTProto-MITM:

    ```shell
    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
```shell
python -m mtproto_mitm --host 127.0.0.1 --port 1080 --key 0F5B...A38F --keys-file ./auth_keys
```

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "mtproto-mitm",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.11",
    "maintainer_email": null,
    "keywords": null,
    "author": "RuslanUC",
    "author_email": "dev_ruslan_uc@protonmail.com",
    "download_url": "https://files.pythonhosted.org/packages/4c/77/fd8de4f625427243f5b0c0efa4024f77b734838d52316e155604782d8463/mtproto_mitm-0.1.0b3.tar.gz",
    "platform": null,
    "description": "# MTProto MITM server\n\nTelegram mtproto mitm server.<br>\n\n**This project must be used for research purposes only.**\n\n## Installation\n**Requirements:**\n  - Python 3.11+\n\n```shell\npip install mtproto-mitm\n```\n\n# TODO\n  - [ ] Record mtproto connections to files to allow reviewing them later\n  - [x] Add cli interface\n  - [ ] Add web interface ?\n\n## Usage\n\n1. Install mtproto-mitm\n2. Get your telegram auth key:\n    - 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;\"\n    - 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](https://github.com/RuslanUC/tgnet) to extract key: use code from [example](https://github.com/RuslanUC/tgnet).\n    - Telegram Desktop: you can use [opentele](https://github.com/thedemons/opentele) to extract auth key from tdata folder.\n3. Run MTProto-MITM:\n\n    ```shell\n    Usage: python -m mtproto_mitm [OPTIONS]\n    \n    Options:\n      -h, --host TEXT       Proxy host to run on.\n      -p, --port INTEGER    Proxy port to run on.\n      -k, --key TEXT        Hex-encoded telegram auth key.\n      -f, --keys-file TEXT  File with telegram auth keys.\n      -q, --quiet           Do not show requests in real time.\n      -o, --output TEXT     Directory to which mtproto requests will be saved.\n      --proxy-no-auth       Disable authentication for proxy.\n      --proxy-user TEXT     Proxy user in login:password format.\n      --help                Show this message and exit.\n    ```\n\n4. Set socks5 proxy settings on your telegram client to host/port/user you specified on last step.\n\n## Examples\n```shell\npython -m mtproto_mitm --host 127.0.0.1 --port 1080 --key 0F5B...A38F --keys-file ./auth_keys\n```\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Telegram mtproto mitm server.",
    "version": "0.1.0b3",
    "project_urls": null,
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "921ba1cc478afc81c382680bf6e130812e3e6bd4dde112fe064fa7f06e9efae5",
                "md5": "d63a9c1c16628cce55dda36851c6ad97",
                "sha256": "af06977dace2a2820a232a639f93ee0fb8301e4b6edbf119d07f8c9cdb4e8c0d"
            },
            "downloads": -1,
            "filename": "mtproto_mitm-0.1.0b3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "d63a9c1c16628cce55dda36851c6ad97",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.11",
            "size": 1789766,
            "upload_time": "2024-08-08T12:13:01",
            "upload_time_iso_8601": "2024-08-08T12:13:01.112862Z",
            "url": "https://files.pythonhosted.org/packages/92/1b/a1cc478afc81c382680bf6e130812e3e6bd4dde112fe064fa7f06e9efae5/mtproto_mitm-0.1.0b3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "4c77fd8de4f625427243f5b0c0efa4024f77b734838d52316e155604782d8463",
                "md5": "da5e7498a783e3afe6c2521b20737333",
                "sha256": "89ad7712b050268fba94d6714e85d638d186e7180957097e418ccb9c31723f92"
            },
            "downloads": -1,
            "filename": "mtproto_mitm-0.1.0b3.tar.gz",
            "has_sig": false,
            "md5_digest": "da5e7498a783e3afe6c2521b20737333",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.11",
            "size": 324770,
            "upload_time": "2024-08-08T12:13:03",
            "upload_time_iso_8601": "2024-08-08T12:13:03.034989Z",
            "url": "https://files.pythonhosted.org/packages/4c/77/fd8de4f625427243f5b0c0efa4024f77b734838d52316e155604782d8463/mtproto_mitm-0.1.0b3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-08-08 12:13:03",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "mtproto-mitm"
}
        
Elapsed time: 0.28074s