Telegram OSINT VM Part 2

Telegram OSINT VM Part 2

Thank you for returning to read part two of my Telegram OSINT VM, in this second blog I am going to walk through the resources I use to research Telegram.

If you didn’t catch Part 1, you can find it here: –

https://www.cqcore.uk/telegram-osint-vm-part-1/

As with Part 1, you do not have to copy everything from this blog for your VM. I would always advise, assess what you need and what you are comfortable working with.

I will start by listing what I use as my base: –

Telegram Web

Telegram Desktop

Geogramint https://github.com/Alb-310/Geogramint

Telepathy https://github.com/jordanwildon/Telepathy

Telegram Tracker https://github.com/estebanpdl/telegram-tracker

I will talk through and illustrate the installation of the above. I will then move on to the other resources that I install and these in the whole will be bookmarks and useful links.

We will start with the installation of Telegram Web and desktop. Open your Telegram container, where we can save the Telegram Web bookmark. Once you have the below screen, Fig 2.1, right click and you will be presented with Fig 2.2, this is where you can save Telegram Web to your Telegram Container.

https://web.telegram.org/k/

Fig 2.1

Fig 2.2

You can now save Telegram Web as a bookmark in your bookmark menu. The first time you open the Telegram bookmark you will be asked to confirm that you want to use the Telegram container from now on to open Telegram Web.

Now it’s time to download Telegram Desktop, navigate your way to https://desktop.telegram.org/ where you can download the application. The default option will be for Linux x64. Once downloaded you can extract the files and run the program and you will then be presented with the below, Fig 2.3 .

Fig 2.3

You maybe asking yourself why do I need both Telegram Web and Desktop? Well, they both do things different, offer flexibility and resilience. You do not have to use both at the same time.

Now we are in a position to log into our Telegram sock account as we will need an API key for the other resources I mentioned earlier.

Once logged in, lets look at some settings that will be beneficial to our OPSEC and security,

In Data & Storage, disable Auto-Download Media, Fig 2.4: –

Fig 2.4

Then we can look at the Privacy settings, Fig 2.5. You will see that I have set the profile picture to everybody. This is due to Geogramint requiring you to have your profile pictures on view. You can disable this when you are not using Geogramint. Only premium users can disable voice or video messages.

Fig 2.5.

Annoyingly the settings from Telegram Web do not carry over to Telegram Desktop, in relation to the automatic media downloads.

In Advanced settings, I enable, ‘Ask download path for each file’

In each of the Private Chats, Groups, Channel, I disable. ‘Automatically download, videos & file,’ Fig 2.6.

Fig 2.6

If you are using a mobile, I would also disable the People Nearby option. You will find it by navigating to Contacts – Find People Nearby. I would like see to Find People Nearby come to the Web and Desktop app, so I could use a location spoofing extension, however this is why we have Geogramint.

The above settings will really depend on the nature of your deployment. Experience has shown me that files can be automatically downloaded in the background to your device, without you knowing,  just take the added precaution of choosing what I want to view. I like to have a look at the channel or group first.

I will walk you through how to obtain your API-id and API-hash. You need to log-in to your Telegram account on Telegram Web, you then need to navigate to the API development tools at the following URL:

https://my.telegram.org/auth?to=apps

Then you will need to enter the number that you used to sign up to Telegram, Fig 2.7. You will  then be sent a confirmation code to your Telegram account. You need this code to access the, ‘Your Telegram Core,’ where you will select the API development tools option.

Fig 2.7

You will be taken to the following screen, Fig 2.8.

Fig 2.8

 

In the default fields, typing, ‘Anything” should enable you to obtain your API. You will be taken to the next page where you will obtain your API-id & API-Hash.

This short video is a good tutorial on how to obtain your API-id & API-Hash.

https://www.youtube.com/watch?v=8naENmP3rg4

Once you have your API-id & API-Hash, keep it safe in your password manager.
You may have gathered that there is an OPSEC issue in how we have obfuscated our Ubuntu setup earlier. We have to use a mobile number that is not necessarily from the same country as we set our VM to, not only that the next step requires you to use an IP address for the country of the number too, otherwise Telegram will not provide you with your API key and Hash.

If you have no intention of using the cmd line tools then you do not need to concern yourself with obtaining the API key and Hash. Alternatively like I have done in the past, obtain a SIM from your obfuscation country. It all depends on what our deployment entails and the risks involved.

With OSINT, there is always a balance to be had between, OPSEC, Privacy and usability versus reward. We can lock ourselves down but this will affect our ability to carry out OSINT.

Before moving on to installing the cmd line tools I am going to create two more bookmarks.

I am going to create a custom bookmarklet that has been created by @Webbreacher based on a blog by @hatless1der. I have included a link to the blog below so that you can read up on how this bookmarklet works.

Copy the text below, go into your browser bookmarks, create a new bookmark, and paste the text where you would normally put the URL for a bookmark and save. Give it a name you will remember, i’ll call mine Bookmarklet: –

javascript:(function()%7Bvar a %3D document.getElementsByClassName(‘tgme_page_description’)%5B0%5D%3B alert(a.innerText)%7D)()

The link to @hatless1der blog is here: –

https://hatless1der.com/telegram-osint-basics-5-tips-anyone-can-do-right-now/

I am now going to add my own GitHub repo bookmark where I have collected my Telegram OSINT toolkit. You now have access to my GitHub repo where you can access the numerous, blogs, bots, CSE, extensions, resources and videos, to help you with your research of Telegram. Feel free to add your resources toolkit of choice, @Cyb_Detective has a good GitHub repo too. I will allocate my GitHub repo to a container.

https://github.com/cqcore/Telegram-OSINT

It is a good idea to add a Yandex bookmark too. I add the following in a bookmark folder, called Yandex: –

https://yandex.com/

https://translate.yandex.com/ocr

https://translate.yandex.com/

At the same time I am going to allocate them a container named Yandex, Fig 2.9

 

Fig 2.9

*I said earlier, I add extensions as I go, you have the option here to add a ‘Translate’ extension. In Firefox’s Add-Ons there are couple of recommended ‘Google Translate’ extensions. Firefox has its own Translate extension, however it is limited in the languages available to translate.

*Next I am going to a create a bookmark folder for the following website resources: –

https://tgdev.io/tme/

https://lyzem.com/

https://telegramchannels.me/

https://telegcrack.com/

https://telemetr.io/en/channels

https://tgstat.com/

https://tlgrm.eu/channels

*As with everything related to the internet ensure that you are happy with the resources you use. Ensure that you are using the appropriate OPSEC for your deployment.

Now is the time to download from GitHub our cmd line tools. We have created the cqcore GitHub container and we can use the same container to install the cmd line tools we are going use. You will find tutorials on my GitHub Telegram Repository on how to use the below tools. As I go, I create text documents on my VM for each tool, which contains the installation instructions and also the commands for its deployment.

Geogramint https://github.com/Alb-310/Geogramint

Telepathy https://github.com/jordanwildon/Telepathy

Telegram Tracker https://github.com/estebanpdl/telegram-tracker

First we will start with Geogrmint: –

git clone https://github.com/Alb-310/Geogramint.git

(If you don’t have git – sudo apt install git)

cd Geogramint

pip3 install -r requirements.txt

(If you don’t have pip3 – sudo apt install python3-pip)

python3 geogramint.py

This will then launch the GUI. In the bottom left corner is the settings cog, click this and the below image will be launched, where you can input your Telegram API-id, API-Hash and telephone number, Fig 3.0.

Ensure you have the + and your country code, minus the first 0, +44(number here) format.

Fig 3.0

Next is Telepathy: –

pip3 install telepathy

cd telepathy

When you first run Telepathy you will be asked to enter your, API-id, API-Hash & phone number.

We will use a default cmd, the target is one of the inventors of Telegram, Fig 3.1.

Fig 3.1

You will enter your API-Id then,

Next is your API-Hash,

Then you will enter your telephone number. Ensure you have the + and your country code, minus the first 0, +44(number here) format.

You will receive a code to your Telegram account, once that is input into the terminal you will then enter your password, and you are away.

A basic cmd as a test would be – telepathy -t CHANNEL NAME

Next we can install Telegram Tracker: –

*To use this tool, you need to be aware that Telegram Tracker will not work if you have 2FA enabled. the first time you run it.*

git clone https://github.com/estebanpdl/telegram-api.git

Then download the ZIP file from GitHub, Fig 3.2, and unpack the file telegram-tracker.zip to your preferred location.

 

Fig 3.2

cd telegram-tracker-main

*pip3 install -r requirements.txt

Go to the telegram-tracker-main and complete the config file with the below

[Telegram API credentials]

api_id = (Your api_id here)

api_hash = (Your api_hash here)

phone = (Your phone number here)

Note: Your phone must be included to authenticate for the first time. Ensure you have the + and your country code, minus the first 0, +44(number here) format, for example. Telegram API will send you a code via Telegram app that you will need to include.

A basic cmd: –

*python3 main.py –telegram-channel channelname

*If you used pip and not pip3 the cmd would be python main.py –telegram-channel CHANNELNAME

When I have finished the above I add the GitHub tools to a bookmark folder for easy access. I also create txt notes with how to use each tool, Fig 3.3.

Fig 3.3

A quick point on Telegram Bots, you can use Bots not just for searching Telegram but also for your other OSINT deployments too. Telegram has lots of available data to search, such as usernames, email addresses, phone numbers etc, so it is quite a useful tool as an OSINT resource.

I use the Bot URL’s from my GitHub page to create a Bots, bookmark folder.

My bookmark bar now looks like this, Fig 3.4.

Fig 3.4

That brings me to the end of Part 2. There will be a part 3, this was not intended however I felt I need to expalin in more detail how I manage my VMs and also the risks involved in using a Windows host. Anyway, any self-respecting Hollywood blockbuster comes as a trilogy, so why not.

 

Telegram OSINT VM Part 1

Telegram OSINT VM Part 1

For my next blog I have decided to share my Telegram OSINT Virtual Machine. When I have a Telegram deployment I always use a dedicated virtual machine. I will never undertake research on Telegram using my perosnal device(s), accounts or personal identifiable information, either using  the Telegram Web or Telegram Desktop is preferred over using a mobile.

What I am about to explain may not apply to everyone depending on what the aims, objectives are of your deployment and the people or groups that are of interest to you. I will start at the beginning of my process but feel free to take the parts that best suit your deployment. Don’t just copy what I do because it may not be suitable for you. This was going to be one blog however it ended up being longer than I had originally anticipated, so I decided to create 2 separate blogs.

I build my Telegram OSINT VM using Ubuntu 22.04 LTS, this can be download from the official Ubuntu website. https://ubuntu.com/download/desktop. Do not be tempted to download it from other third party sites.

Whether you choose to use VMware of Virtual Box, it matters not and that can be a personal decision based on what resources you have available to you. These are the only two virtualisation software that I use. I am sure that what follows will differ little, if you use a different virtualisation software.

I am not going to run through how to install Ubuntu, but feel free to view the below video links, for VMware and Virtual Box:-

·    VMware – https://www.youtube.com/watch?v=cjO_hiocu30
·    Virtual Box – https://www.youtube.com/watch?v=zHwFtyxJsog

If English is your first or second language this provides us with a perfect OPSEC opportunity. That said other international languages also provide similar opportunities. French, Spanish & Russian etc are spoken all over the world. I always obfuscate my location. It is no secret that I am based in the UK. I will tend to use an IP, time zone and keyboard settings from an English speaking country for setting up my VM. I use similar obfuscation methods when using a mobile.

For this deployment I have decided that I am going to use the USA as my obfuscation country. It is important that you have an active VPN. Again this is a personal choice depending on the resources you have. A paid for subscription with a no logs provider is the preferred choice.

I suppose it goes without saying that we need to pick a USA server in my case, Fig 1.0.