Skip to content
Telegram scenario-based API aimed at OSINT
PHP Other
  1. PHP 99.8%
  2. Other 0.2%
Branch: master
Clone or download
wkejqb NonBlockingProxySocket implementation (#92)
- added NonBlockingProxySocket separate class
Latest commit d5aeb81 Feb 3, 2020
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
examples UserContactsTest (#89) Jan 31, 2020
node Feature/proxy socket test (#19) Dec 28, 2019
src NonBlockingProxySocket implementation (#92) Feb 3, 2020
tests
tools Compare TL json diff tool (#63) Jan 27, 2020
.gitignore Add common chats scenario (#78) Jan 30, 2020
.styleci.yml "Parse photos from public group" scenario (#20) Jan 13, 2020
.travis.yml Enable codecov Dec 27, 2019
API.en.md Add api doc (#55) Jan 28, 2020
API.ru.md Add api doc (#55) Jan 28, 2020
Dockerfile Add docker container with lib (#36) Jan 20, 2020
LICENSE Add MIT license (#8) Dec 25, 2019
README.md Update README.md (#81) Jan 30, 2020
composer.json "Parse group messages by specific user" scenario (#31) Jan 17, 2020
composer.lock Update socks lib to close sockets on destroy (#54) Jan 23, 2020
run-tests.sh Feature/proxy socket test (#19) Dec 28, 2019

README.md

Telegram OSINT scenario library

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.1+
  • Composer
    • phpseclib

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 123123123
# if you save key to file
docker exec  --env BOT=@auth-key-filename-in-docker -i tg-osint-lib php examples/monitorNumbers.php 123123123

Limitations

We currently use Europe/CIS DC, see src/LibConfig.php for details/to change your DC, see also: https://core.telegram.org/method/help.getNearestDc .

You can’t perform that action at this time.