mtproto-mitm


Namemtproto-mitm JSON
Version 0.1.0b2 PyPI version JSON
download
home_page
SummaryTelegram mtproto mitm server.
upload_time2024-02-11 18:04:37
maintainer
docs_urlNone
authorRuslanUC
requires_python>=3.11,<4.0
license
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": "",
    "name": "mtproto-mitm",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.11,<4.0",
    "maintainer_email": "",
    "keywords": "",
    "author": "RuslanUC",
    "author_email": "dev_ruslan_uc@protonmail.com",
    "download_url": "https://files.pythonhosted.org/packages/28/84/6a9ff8cae4f2565eebbc29ddfd50bb7155392681812f979957228ccbcbc2/mtproto_mitm-0.1.0b2.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": "",
    "summary": "Telegram mtproto mitm server.",
    "version": "0.1.0b2",
    "project_urls": null,
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c6ac9e8fc925f06e46445f63ddfad96e811504264286f1eb0235df5d0f999f22",
                "md5": "fa5b852b845cdcc60a6b91811195029c",
                "sha256": "c15833a8f89ca735618d5c3e2405b7b24a381c097481668fb08b52b64ef6bc1c"
            },
            "downloads": -1,
            "filename": "mtproto_mitm-0.1.0b2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "fa5b852b845cdcc60a6b91811195029c",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.11,<4.0",
            "size": 1789382,
            "upload_time": "2024-02-11T18:04:34",
            "upload_time_iso_8601": "2024-02-11T18:04:34.821566Z",
            "url": "https://files.pythonhosted.org/packages/c6/ac/9e8fc925f06e46445f63ddfad96e811504264286f1eb0235df5d0f999f22/mtproto_mitm-0.1.0b2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "28846a9ff8cae4f2565eebbc29ddfd50bb7155392681812f979957228ccbcbc2",
                "md5": "58bf7bbd5c755137da0097d73501bc01",
                "sha256": "04993a7e2c1c98ac540338b2e5c48c7e8b6037cffb98954209c0cdc1968f39ff"
            },
            "downloads": -1,
            "filename": "mtproto_mitm-0.1.0b2.tar.gz",
            "has_sig": false,
            "md5_digest": "58bf7bbd5c755137da0097d73501bc01",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.11,<4.0",
            "size": 324411,
            "upload_time": "2024-02-11T18:04:37",
            "upload_time_iso_8601": "2024-02-11T18:04:37.438294Z",
            "url": "https://files.pythonhosted.org/packages/28/84/6a9ff8cae4f2565eebbc29ddfd50bb7155392681812f979957228ccbcbc2/mtproto_mitm-0.1.0b2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-02-11 18:04:37",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "mtproto-mitm"
}
        
Elapsed time: 0.32805s