RL Blog

Topics

All Blog PostsAppSec & Supply Chain SecurityDev & DevSecOpsProducts & TechnologySecurity OperationsThreat Research
Why RL Built Spectra Assure Community
April 14, 2026

Why RL Built Spectra Assure Community

We set out to help dev and AppSec teams secure the village: OSS dependencies, malware, more. Learn how.

Read More about Why RL Built Spectra Assure Community
Why RL Built Spectra Assure Community

Follow us

XX / TwitterLinkedInLinkedInFacebookFacebookInstagramInstagramYouTubeYouTubeblueskyBluesky

Subscribe

Get the best of RL Blog delivered to your in-box weekly. Stay up to date on key trends, analysis and best practices across threat intelligence and software supply chain security.

ReversingLabs: The More Powerful, Cost-Effective Alternative to VirusTotalSee Why
Skip to main content
Contact UsSupportLoginBlogCommunity
reversinglabsReversingLabs: Home
Solutions
Secure Software OnboardingSecure Build & ReleaseProtect Virtual MachinesIntegrate Safe Open SourceGo Beyond the SBOM
Increase Email Threat ResilienceDetect Malware in File Shares & StorageAdvanced Malware Analysis SuiteICAP Enabled Solutions
Scalable File AnalysisHigh-Fidelity Threat IntelligenceCurated Ransomware FeedAutomate Malware Analysis Workflows
Products & Technology
Spectra Assure®Software Supply Chain SecuritySpectra DetectHigh-Speed, High-Volume, Large File AnalysisSpectra AnalyzeIn-Depth Malware Analysis & Hunting for the SOCSpectra IntelligenceAuthoritative Reputation Data & Intelligence
Spectra CoreIntegrations
Industry
Energy & UtilitiesFinanceHealthcareHigh TechPublic Sector
Partners
Become a PartnerValue-Added PartnersTechnology PartnersMarketplacesOEM Partners
Alliances
Resources
BlogContent LibraryCybersecurity GlossaryConversingLabs PodcastEvents & WebinarsLearning with ReversingLabsWeekly Insights Newsletter
Customer StoriesDemo VideosDocumentationOpenSource YARA Rules
Company
About UsLeadershipCareersSeries B Investment
EventsRL at RSAC
Press ReleasesIn the News
Pricing
Software Supply Chain SecurityMalware Analysis and Threat Hunting
Request a demo
Menu
Products & TechnologyMay 6, 2026

Spectra Analyze in Action: Retrohunting Bots

Learn how to use ReversingLabs’ Spectra Analyze to expand your detection of malicious Telegram C2 bots.

Zaria Vuksan
Zaria Vuksan, Threat Intelligence Researcher, ReversingLabsZaria Vuksan
FacebookFacebookXX / TwitterLinkedInLinkedInblueskyBlueskyEmail Us
Retrohunting Telegram Bots

Telegram has become a popular and easy to use command and control (C2) option for malicious actors. So much so that it’s even a built in C2 option in some popular malware-as-a-service offerings like Agent Tesla. Attackers benefit from the infrastructure Telegram provides, because it means not having to manage servers and hosting. With this infrastructure, bots can better disguise themselves in a network, especially if companies are already using legitimate bots. 

Telegram is mostly used to run infostealing and remote access trojan (RAT) operations, using basic messaging features and the Telegram Bot API to send commands and receive information. All the attacker needs to do is message the bot commands, and the bot handles the action and relays the response.

Attackers can tell infostealing malware to capture and exfiltrate a screenshot, start keylogging, or perform any of a myriad of other operations. Telegram bots are designed to be used in a variety of ways, giving attackers ample opportunity to find ways to exploit this flexibility. Using API calls like “sendDocument” or “sendMessage” allows for much of the communication required for infostealing. 

Telegram bot operations leave behind evidence, and following these leads provides an interesting perspective into ongoing phishing campaigns and attacker behavior. Because organizations utilize Telegram and Telegram bots for legitimate reasons, an overall ban might not be possible. But a whitelist of trusted Telegram traffic may provide an efficient way to deal with potential issues. However, if that is not feasible in your environment, another strategy is to find and block malicious bots.

Not only does hunting for bots allow you to keep track of specific malicious sources, it also allows you to track trends in attacker tactics. Being able to dig into this data allows you to glean what kind of information attackers are seeking, and what their methods are. This insight can be proactively leveraged to keep your company safe.

ReversingLabs has previously demonstrated Spectra Analyze’s retrohunting abilities for detection engineering. Here’s how to expand its use for Telegram bots.

Ramp Up Your Retrohunting

This time, the rule is simple and utilizes regular expressions to seek out anything with the bot token format. Bot tokens all follow the same format, using up to eight characters to start, then a colon, then an additional zero to 35 characters. Each one of these tokens is unique, and corresponds to a specific bot. The following rule will match on any file that includes a Telegram bot token in plain text.

Image of YARA rule for hunting Telegram bot tokens

Figure 1.1 Image of YARA rule for hunting Telegram bot tokens.

As previously covered, the retrohunt allows you to run this rule against all of the files stored in the cloud, allowing us a larger sample size. Once the rule has been added to Spectra Analyze and enabled in cloud, the actions tab can be used to run it.

Screenshot of results of Retrohunt with the Telegram C2 YARA rule

Figure 1.2 Screenshot of results of Retrohunt with the Telegram C2 YARA rule.

After letting it work through everything, you are left with a lot of hits. This can be difficult to parse through. You can further specify our search by looking for Text/HTML formatting and filtering the classification to malicious.

Updated search screen with format parameter set to Text/HTML/HTML.

Figure 1.3 Updated search screen with format parameter set to Text/HTML/HTML.

Updating search parameter to filter for files classified as malicious.

Figure 1.4 Updating search parameter to filter for files classified as malicious.

Finally, to increase the relevance of your results, set it to only look at the past month of samples.

Updating search duration from first seed to a date range that covers the current month of the search (April 2026).

Figure 1.5 Updating search duration from first seed to a date range that covers the current month of the search (April 2026).

With the search set up complete, you can begin examining samples.

File Investigation

You can then start reviewing results to home in on what kinds of samples are using Telegram bot tokens. What you want to look out for are domains, bot tokens, or other information you could use to study the attacker. The dark cloud icon on the left means that the sample is public and available for local download and analysis, allowing for a more in-depth investigation.

Sample screen, with the blue Fetch & Analyze button on the top right.

Figure 2.1 Sample screen, with the blue Fetch & Analyze button on the top right.

Clicking into one of the samples, classified as a FakeLogin, shows this screen. If there is a blue “Fetch & Analyze” button, you will need to click to download the file to your local Spectra Analyze instance , before being given more detailed information on the file. 

Once analyzed, the screen will look like this, with more options on the side bar. These expanded options allow for a more in depth look into the sample, opening options like Sample Details, Timeline, and Network References. There are also more to explore in the Spectra Core Static Analysis. All of this extra information is crucial to getting the full picture you need.

Screen after file has been analyzed, showing a side bar with expanded options.

Figure 2.2 Screen after file has been analyzed, showing a side bar with expanded options.

Static analysis side bar options.

Figure 2.3 Static analysis side bar options.

Checking under static analysis, you can see extracted files, which allows you to look into the contents of the HTML.

File folder labeled “unpacked_files”.

Figure 2.4 File folder labeled “unpacked_files”.

Extracted files in folder, one in CSS format and the other JavaScript.

Figure 2.5 Extracted files in folder, one in CSS format and the other JavaScript.

We are given a folder, and within it are given a CSS and Javascript file.

Expanded information about files, including buttons for Hex Preview and Edit Tags.

Figure 2.6 expanded information about files, including buttons for Hex Preview and Edit Tags.

You can expand the files out by clicking on them to see more information. Click into Hex Preview to investigate the contents.  First quickly look over the CSS file. This file is what determines the look and layout of a webpage, which can be insightful to determine what the intended user experience may be.

CSS file with a logbox and password-container.

Figure 2.7: CSS file with a logbox and password-container.

As the Spectra Analyze classification indicates, this indeed appears to be a fake login page. You can confirm this later by utilizing dynamic analysis, but before that, we will investigate the other file. 

To investigate the Javascript file, open it in Hex Preview. You immediately see some suspicious comments.

extractEmail function in JavaScript.

Figure 2.8 extractEmail function in JavaScript.

The JavaScript includes an extractEmail function.

Anti-forensics sections in Javascript.

Figure 2.9: Anti-forensics sections in Javascript.

There’s also an anti-forensics section.

With some more inspection, you will be able to find the bot tokens. This token is what the regular expression in our YARA rule matched on. These tokens are involved in the bot’s API calls, being used directly in the URL of any HTTPs check performed by the bot. HTTPs calls are how the bots communicate, and each request also includes the method used. With how Telegram bots are set up, all anyone needs to access it is its unique bot ID.

Two sets of Telegram bot tokens and chat IDs encoded into Javascript.

Figure 2.10: Two sets of Telegram bot tokens and chat IDs encoded into Javascript.

With this retrohunt into reading files, you are already able to get a better picture of Telegram bot operations being maliciously used. But there is still more to investigate. 

In addition to static analysis, with Spectra Analyze you can also review dynamic analysis to get an idea of the intended user experience. This sample has already been run in the sandbox, giving a lot of valuable data such as screenshots. If you want to interact with the sample, you also have the option to re-run the sample in dynamic analysis using the interactive analysis option.

Cloud Sandbox Analysis Summary, with option to Reanalyze, View Screenshots, and perform other actions.

Figure 3.1 Cloud Sandbox Analysis Summary, with option to Reanalyze, View Screenshots, and perform other actions.

Clicking into option to Reanalyze, enabling Cloud Sandbox and Interactive Analysis.

Figure 3.2 Clicking into option to Reanalyze, enabling Cloud Sandbox and Interactive Analysis.

Cloud Sandbox Interactive Analysis shows the webpage being analyzed

Figure 3.3: Cloud Sandbox Interactive Analysis shows the webpage being analyzed.  

With some time in the interactive sandbox, we can see and use the webpage. This further confirms the use of this webpage: harvesting credentials. It shows a fake Facebook login screen, asking for users to confirm their password as one they want to keep using. We know that this information will be routed through Telegram to the attacker.

Network Analysis with URL section.

Figure 3.4: Network Analysis with URL section.

We can also view the details of the dynamic analysis, and sort through information of interest. For example, here we may want to look into URLs the file is attempting to use. An example of interesting URLs can be found on a different sample that includes links including a Telegram username.

Network Analysis on a different file, showing Telegram chat link.

Figure 3.5: Network Analysis on a different file, showing Telegram chat link.

We can rinse and repeat this investigative process across different matches from our retrohunt. This can be an intuitive way to collect a lot of data on ongoing phishing campaigns, since Telegram acts as such a popular C2. With one retrohunt we can find phishing pages, bot tokens, and other indicators.  

The Benefits of Deeper Investigation

There are a few ways to leverage this information to help your organization. If you use Telegram messaging in bots within a typical company workflow, it’s helpful to understand which bot IDs you should keep an eye out for, and avoid that malicious traffic. Even if the Telegram communications are blocked, it’s crucial to keep an eye out for programs with these IDs embedded in them, since it still acts as an indicator of compromise (IOC). A malicious program could still be downloaded, even if its access to C2 is cut off, and recognizing the presence of these programs could lead to discovery of potential vulnerabilities. It can also be useful to recognize domains attackers are using, even if the specific malware is rotated out.

Using Spectra Analyze allows you to better understand the current phishing landscape — and better tailor your defense against it. It provides hands-on access to what current phishing websites look like, which can be used to improve security training. Looking into the HTML and JavaScript used by threat actors can help you track what credential types attackers are actively seeking, which may help you predict their behavior. You can also keep an eye on how tactics change over time, like where and when attackers priorities shift. The information gained by these searches has many uses for research and defense planning.

Use Attackers Backend Against Them

For attackers, there are plenty of benefits from using Telegram as a C2. It gives them an easy interface to interact with their malware from, the traffic can be easily hidden amongst regular activity, and they do not need to manage their own infrastructure. However, it does provide an opportunity to look behind the scenes and get a better understanding of their operations. Using a regular expression YARA rule, we can specifically look for samples that rely on Telegram bot tokens in some way, and then leverage that to start an information search on various phishing and otherwise malicious activities. This perspective can allow your team to track behaviors, tactics, and goals of attackers by using their own backend against them.


Explore RL's Spectra suite: Spectra Assure for software supply chain security, Spectra Detect for scalable file analysis, Spectra Analyze for malware analysis and threat hunting, and Spectra Intelligence for reputation data and intelligence.

Tags:Products & TechnologySpectra Analyze In Action

More Blog Posts

QR Code Phishing Is Evolving: Here’s How Your Detection Can Keep Up

QR Code Phishing Evolves: How to Keep Up

Here's what you need to know about the rise of quishing — and how your threat hunting team can get out in front of it.

Learn More about QR Code Phishing Evolves: How to Keep Up
QR Code Phishing Evolves: How to Keep Up
Why RL Built Spectra Assure Community

Why RL Built Spectra Assure Community

We set out to help dev and AppSec teams secure the village: OSS dependencies, malware, more. Learn how.

Learn More about Why RL Built Spectra Assure Community
Why RL Built Spectra Assure Community
How a Simple YARA Rule Catches What AV Misses

ClickFix: YARA Rules Catch What AV Misses

Learn about the antivirus detection gap — and how to develop a simple YARA rule using Spectra Analyze.

Learn More about ClickFix: YARA Rules Catch What AV Misses
ClickFix: YARA Rules Catch What AV Misses
Polyglot File Examination with Spectra Analyze

How to Examine Polyglot Files with Spectra Analyze

Here's how to assess a sample using Spectra Analyze in your environment — and create a YARA rule.

Learn More about How to Examine Polyglot Files with Spectra Analyze
How to Examine Polyglot Files with Spectra Analyze

Spectra Assure Free Trial

Get your 14-day free trial of Spectra Assure for Software Supply Chain Security

Get Free TrialMore about Spectra Assure Free Trial
Blog
Events
About Us
Webinars
In the News
Careers
Demo Videos
Cybersecurity Glossary
Contact Us
reversinglabsReversingLabs: Home
Privacy PolicyCookiesImpressum
All rights reserved ReversingLabs © 2026
XX / TwitterLinkedInLinkedInFacebookFacebookInstagramInstagramYouTubeYouTubeblueskyBlueskyRSSRSS
Back to Top