/Telerecon-old

A reconnaissance framework for researching and investigating Telegram.

Primary LanguagePython

TELERECON

A reconnaissance framework for researching and investigating Telegram. The script scrapes forwarding relationships and outputs an adjacency list optimised for Gephi network mapping, and a list of all URLs for channel discovery and further scraping. Additional functions include scraping subscriber counts or t.me/ links from a Telegram channel, and collecting information on a target user.

image

Installation

  1. Download all files and save to directory of choice.

  2. Ensure pandas, telethon, and colorama are installed.

pip install pandas
pip install telethon
pip install colorama
pip install requests beautifulsoup4
  1. Obtain your Telegram API details from [my.telegram.org][1], noting your API key, hash, and phone number.

  2. In terminal, navigate to the installation directory (eg, desktop) and run setup.py

cd Desktop
python3 setup.py
  1. Executing the setup.py file will walk you through the Telegram API login and prepare the toolkit with your details.

Usage

Upon installation completion, you will be able to launch the toolkit from launcher.py

cd Desktop
python3 launcher.py

The launcher will guide you through each of the tools. Here is an overview.

  1. Scrape forwards from a target channel Scrapes all forwards from any public channel you specify.

  2. Scrape forwards from a target channel list Recursively scrapes through a list of target channels. Input list should be CSV or TXT, have no header, and a URL on every line.

  3. _Scrape a channel for all "https://t.me/*" URLS Scrape a target channel for all Telegram URLS mentioned in text. This is useful for scraping directory/list channels. The extracted list will be deduplicated before output.

  4. Conduct a subscriber census of target channels from a list Scrape the total subscribers from a list of target channels. Input list should be CSV, have no header, and a URL on every line.

  5. Collect information from a target user. Input username, userID, or phone number and return all available user information.

...........

Once you have scraped several channels, you may wish to create a new master list of urls.

The following terminal command can be used while in the Source URLS directory to generate a new URL masterlist.

cat *.csv | sort | uniq > combinedmasterlist.csv

...........

How is this different from Telegram Scraper?

  • To/From values are now correct.
  • To/From now display correct and consistant entity types.
  • Forward scraping outputs are now optimised for Gephi.
  • Script now also returns channel URLs to aid in channel discovery.
  • Added option to recursivly scrape telegram channels from a list.
  • Added an option to collect Telegram URLs from within a channel.
  • Added coloration/usability improvements.
  • Added slight time delay to reduce chance of rate limiting/getting banned.
  • Added workarounds to various errors/issues (i.e. skiping private channels).
  • Added deduplication to URL scraper to mimise duplication when pivoting.
  • Added valid URL pre-check to minimise errors.
  • Added first implementation of user target feature (further changes upcoming)

...........

Credit

Credit to Jordan Wildon's (@jordanwildon) for the initial inspiration and base script functionality.