tombouctou / telegram-osint-lib

Telegram scenario-based API aimed at OSINT

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Telegram OSINT scenario library

Gitpod ready-to-code

Build Status codecov

Description

Telegram API from official mobile client.

Rationale

Telegram protocol https://core.telegram.org/ has technically thorough and detailed documentation, but does not cover usage scenarios. Our goal is to make a library that implements some real-life OSINT usage scenarios, including:

  • searching user in specific groups;
  • parsing group members;
  • monitoring user online status;
  • downloading photos from channel;
  • monitoring user profile changes (photo/bio/etc.);
  • fetching messages by specific user.

Requirements

  • PHP 7.4+
  • Composer
    • phpseclib

Docs

QuickStart

First of all, add library to your app user composer:

composer require postuf/telegram-api-lib

To check out usage examples, go to examples dir. You need auth keys generated, run php registration.php to get this. Now you are all set, you can run any of examples, for example, php parseGroupMembers.php, and check the output.

Verbose logging (all messages sent/received) is enabled by default, add --info to arguments to suppress it.

Docker container

docker build -t telegram-osint-lib .
docker run -d -t --name tg-osint-lib telegram-osint-lib
docker exec -it tg-osint-lib /bin/bash
php examples/registration.php

When you get AuthKey in registration script, you can use it the following way:

docker exec  --env BOT=your-auth-key -i tg-osint-lib php examples/monitorNumbers.php -n 123123123
# if you save key to file
docker exec  --env BOT=@auth-key-filename-in-docker -i tg-osint-lib php examples/monitorNumbers.php -n 123123123

Limitations

2FA not supported.

About

Telegram scenario-based API aimed at OSINT

License:MIT License


Languages

Language:PHP 99.8%Language:Dockerfile 0.1%Language:JavaScript 0.1%Language:Shell 0.0%