LoFP LoFP / a third part automation using telegram api.

Techniques

Sample rules

Windows DNS Query Request by Telegram Bot API

Description

The following analytic detects the execution of a DNS query by a process to the associated Telegram API domain, which could indicate access via a Telegram bot commonly used by malware for command and control (C2) communications. By monitoring DNS queries related to Telegram’s infrastructure, the detection identifies potential attempts to establish covert communication channels between a compromised system and external malicious actors. This behavior is often observed in cyberattacks where Telegram bots are used to receive commands or exfiltrate data, making it a key indicator of suspicious or malicious activity within a network.

Detection logic

`sysmon` EventCode=22  query = "api.telegram.org" process_name != "telegram.exe" 
| stats count min(_time) as firstTime max(_time) as lastTime by answer answer_count dvc process_exec process_guid process_name query query_count reply_code_id signature signature_id src user_id vendor_product QueryName QueryResults QueryStatus 
| `security_content_ctime(firstTime)` 
| `security_content_ctime(lastTime)` 
| `windows_dns_query_request_by_telegram_bot_api_filter`