Hunting Infostealers - A Practical Approach
Hunting Infostealers - A Practical Approach
Hunting Infostealers:
A Practical Approach
TLP:CLEAR
JANUARY 2025
1
CLEAR
Contents
Overview ......................................................................................................................................... 3
Infostealers Types ........................................................................................................................... 5
File-Based Infostealers................................................................................................................ 5
Fileless Infostealers..................................................................................................................... 6
Prevalent Infostealer Variants ................................................................................................... 9
Common Hunting Approaches ..................................................................................................... 14
Sysmon Events .......................................................................................................................... 14
Identifying Domain Generation Algorithm (DGA) and DNS Fast Flux Operations ................. 14
Usage of Legitimate Libraries .................................................................................................... 16
Collecting Network data ............................................................................................................ 17
Data exfiltration:........................................................................................................................ 18
Suspicious User Agents.............................................................................................................. 20
Beacons ..................................................................................................................................... 22
C2 Abuse of Protocols ............................................................................................................... 24
Attack Vector ............................................................................................................................. 27
Usage of Archives ...................................................................................................................... 29
.txt Files ..................................................................................................................................... 30
C2 Known Tools ......................................................................................................................... 30
Common Malicious TLDs ........................................................................................................... 32
Adaptive Misuse Detection System (AMIDES) .......................................................................... 32
YARA .......................................................................................................................................... 34
SIGMA Rules .............................................................................................................................. 35
References..................................................................................................................................... 36
2
CLEAR
Overview
Infostealers are a category of malware designed specifically to steal sensitive data, such as login
credentials, personal information, and financial details. These malicious programs operate
covertly, making them difficult to detect but extremely damaging to both individuals and
organizations. Effective hunting for infostealers requires a structured, hands-on approach that
combines advanced detection methods, rapid response, and proactive defense strategies.
In this article, we will walk through a practical methodology for identifying, investigating, and
mitigating the impact of infostealers within your environment. The focus will be on real-world
tools and techniques, emphasizing actionable steps that can be taken by security professionals
at any level.
3
CLEAR
4
CLEAR
Infostealer Types
Infostealers, like other types of malwares, can be classified based on their method of infection
and how they operate within an infected system. Two common categories are file-based and
fileless infostealers. These two types differ significantly in terms of their delivery mechanisms,
detection challenges, and persistence methods. Understanding the distinctions between file-
based and fileless infostealers is crucial for both detecting and mitigating the threats they pose.
File-Based Infostealers
File-based infostealers are the traditional form of malware, which rely on files being executed
on the system in order to infect and perform their malicious actions. These files can be delivered
through various methods, including phishing emails, malicious downloads, or exploiting
software vulnerabilities.
1
Browser-in-the-Middle (BITM) Attack
5
CLEAR
• Zeus: one of the most well-known banking Trojans, which uses file-based payloads to
steal banking credentials.
• Dridex: a financial malware that delivers its payload through malicious email
attachments, aiming to steal banking credentials and financial data.
• Emotet: initially a banking Trojan, Emotet has evolved into a malware distribution
platform. It often relies on file-based methods like phishing emails with macros or
malicious attachments.
•
The Antimalware Scan Interface (AMSI) is a crucial security component in Windows that scans
scripts and other content for malicious activity. However, some sophisticated infostealers
have been observed abusing vulnerabilities or bypassing mechanisms within the
AmsiScanBuffer API to evade detection and execute their malicious payloads.2
Fileless Infostealers
Fileless infostealers, on the other hand, are more sophisticated and stealthier because they do
not rely on traditional files to infect or execute on the system. Instead, fileless malware operates
in-memory or leverages legitimate system tools to carry out its activities. This makes fileless
infostealers harder to detect, as they leave minimal traces on disk and can avoid traditional
antivirus detection.
• In-memory execution: downloads and executes code directly in memory. These types of
infostealers execute directly in system memory, without writing malicious files to the
disk. This allows them to evade file-based detection systems.
• Evasion techniques: utilizes reflective DLL injection or similar techniques to execute
malicious functions directly in memory, bypassing the need to write files to disk.
Additionally, it randomizes execution patterns and intervals to evade detection by
behavior-based security systems.
2
AMSI Bypass Methods
https://pentestlaboratories.com/2021/05/17/amsi-bypass-methods/
6
CLEAR
• Legitimate tools exploited: fileless infostealers often leverage legitimate tools like
PowerShell, Windows Management Instrumentation (WMI), and the Windows Registry
to execute commands or exfiltrate data.
• No local persistence: since fileless malware operates entirely in memory, it doesn’t
require a persistent file on the disk. This means it can evade detection by file-based
security mechanisms. To achieve persistence, some advanced fileless malware employ
network-based redundancy mechanisms. These mechanisms enable the malware to
maintain its presence on the compromised system by leveraging external resources,
ensuring it can reinfect the system even if its memory-based components are cleared.
• Highly stealthy: The lack of files means these infostealers leave fewer traces for
traditional endpoint detection tools to spot. They may also use encryption or
obfuscation techniques to avoid detection.
• Living off the Land (LOTL): in this scenario, attackers leverage pre-existents tools and
applications (e.g., PowerShell, WMI, regsvr32), CLI and runtime to carry out their
attacks, making them harder to detect since the tools are often seen as legitimate by
security systems. For example, attackers use PowerShell scripts to download and
execute malicious code in memory. These scripts can be used to steal data, including
credentials and financial information.
• Exploitation of Vulnerabilities: attackers may exploit software vulnerabilities to execute
shellcode or malicious scripts directly in memory without touching the disk.
• Macro-based attacks: while traditional macro-based malware writes files to the disk,
some fileless malware uses macros to execute code directly in memory, such as
PowerShell or VBScript commands.
Advanced Fileless Malware: A Stealthy Threat that Extends Dwell Times in Modern
Computing Systems
In recent years, a notable trend has emerged in the evolution of fileless malware,
characterized by increased sophistication, leading to prolonged dwell times within modern
computing systems.
In this section, we will examine two prominent examples of these advanced threats:
BIOS\UEFI fileless malware represents a sophisticated and elusive class of cyber threats
targeting the fundamental firmware that underpins modern computing systems. Unlike
3
Fileless Malware 101: Understanding Non-Malware Attacks
https://www.cybereason.com/blog/fileless-malware
7
CLEAR
conventional malware that relies on files stored within the operating system, BIOS\UEFI
fileless malware resides within the system's firmware, rendering it highly persistent and
difficult to detect. Attribution studies have indicated that this technique is frequently
employed by APTs, with a significant proportion linked to nation-state actors.
8
CLEAR
Fileless malware poses a growing concern within containerized environments. The ephemeral
nature of containers, coupled with limited availability of comprehensive monitoring and
security tools, significantly exacerbates the challenges associated with detecting and
containing fileless attacks.4
Most info-stealers today are sold on dark-net forums in the form of MaaS (Malware-as-a-
Service), meaning the tool is sold as a commodity on a per-month basis (usually the price range
is in the hundreds of USD) which allows the "customers" to have access to the tool and easily
manage their information heist operations. Many of those malwares are not necessarily
exclusively sold as info-stealers, rather they are a part of a toolkit or a malware family together
with botnets, downloaders or generally other trojans.
Those malwares are advertised and operate as any other legitimate service, where they offer
different purchasing options, "customer support", they work on new functionalities to compete
with other info-stealers sold in the underground markets and generally they put a high premium
on reputation to attract as many cyber-criminals as they can as their "customers".
Lumma Stealer
Lumma Stealer targets Windows systems, has typical information-stealing capabilities, and
gathers browser information, including credentials, cookies, autofill data, and browser extension
data such as cryptocurrency wallets. Additionally, Lumma Stealer collects files from the user’s
desktop that have a .txt extension and extracts data from programs such as AnyDesk, FileZilla,
KeePass, and Telegram.
Written in the C++ programming language—was first identified in September 2022. Threat
actors have used logs obtained from successful Lumma Stealer infections to gain initial access
and ultimately deploy Cloak ransomware.
4
How Fileless Attacks Work and How to Detect and Prevent Them
https://www.aquasec.com/cloud-native-academy/application-security/fileless-attacks/
9
CLEAR
RedLine Stealer
An information stealer that was first observed in February 2020 and is written in the .NET
programming language—targets Windows systems and is sold on multiple Russian-language
eCrime forums. RedLine Stealer collects data from Chromium-, Mozilla-, and Edge-based web
browsers as well as from cryptocurrency wallets, file transfer protocol (FTP) clients, and instant
messaging clients.
The malware additionally exfiltrates system information, hardware specifications, and details on
the type of VPN software and gaming software running on the victim machines.
Rhadamanthys
Rhadamanthys uses the open-source Quake III Arena virtual machine (Q3VM) to obfuscate parts
of its code and hinder technical analysis. The stealer executes in memory to avoid detection and
can bypass Windows Antimalware Scan Interface (AMSI)’s local script-execution capabilities.
Vidar Stealer
An information stealer first observed in November 2018—targets Windows systems and collects
system information, browser credential data, cryptocurrency wallet information, credit card
details, as well as credentials and les from Outlook, Thunderbird, Telegram, Authy, Pidgin,
FileZilla, and WinSCP applications.
The information stealer can also download additional malware; for example, in February 2024
campaigns, Vidar Stealer downloaded the Amadey malware suite, Xworm, and HijackLoader, the
latter of which contained XMRig and delivered the BadTrip clipjacker. In June 2024, Vidar Stealer
distributed the DarkGate remote access tool (RAT).
Raccoon Stealer
A popular information stealer sold in underground forums since April 2019—is written in the
C++ programming language and targets Windows systems. The Raccoon Stealer developer
operates the information stealer as a Malware-as-a-Service (MaaS) in which customers rent
access to a hosted botnet interface. From this interface, customers can acquire Raccoon
executable copies for distribution, configure instructions on the infected machines, and manage
the data uploaded to the C2 domain.
10
CLEAR
Raccoon Stealer harvests web browser data, including credentials, cookies and credit cards,
messaging applications, mail clients, cryptocurrency platforms, gaming platforms, and system
information such as system language and operating system version.
Following March 2022 law enforcement activity that halted operations, the Raccoon Stealer
developers launched version 2 in June 2022 and later updated the malware with new string
obfuscation, likely to evade detection.
Amadey Stealer
Amadey Stealer is written in the Delphi programming language—targets Windows systems and
was first observed in December 2019 being distributed by Amadey Loader.
The information stealer collects victim credentials from instant messaging software, Chromium-
based browsers, cryptocurrency wallets, files stored in the user's Desktop folder, Telegram,
FileZilla, and email. Amadey Stealer is provided for free when an actor rents Amadey Loader for
$600 USD per month.
Meduza
Meduza Stealer is written in C++ and communicates with its configured command-and-control
(C2) server using a TCP connection. It gathers data from 19 password manager apps, 76 crypto
wallets, 95 web browsers, Discord, Steam, and system metadata, harvests miner-related
Windows Registry entries as well as a list of installed games, indicating a broader financial
motive.
In early June 2023, an actor known as Meduza began advertising a native Windows information
stealer dubbed Meduza Stealer on multiple Russian eCrime forums, offering between $199 USD
per month to $1,199 USD for a lifetime subscription. After purchasing Meduza Stealer, actors
are invited to a private telegram channel MEDUZA CORP Premium, where the developer
provides the latest updated versions of the stealer and other information.
AMOS
11
CLEAR
Mystic
Mystic is an info-stealer that began being advertising by an actor (named MysticStealer) for sale
across several Russian-language eCrime forums and a dedicated Telegram channel.
The seller claims MysticStealer is written in C and has a panel coded in Python. MysticStealer
purportedly functions entirely in memory, and the seller claimed the stealer is polymorphic and
it uses string obfuscation, hash-based import resolution, and runtime calculation of constants to
evade detection, the seller also claims it is capable of bypassing Microsoft's antimalware service,
SmartScreen.
Mystic steals credentials from nearly 40 web browsers and more than 70 browser extensions.
The malware also targets cryptocurrency wallets, Steam, and Telegram. Mystic implements a
custom binary protocol that is encrypted with RC4.
StealC
Stealc also has a customizable file grabber, allowing the operator to target any selected file
types. The stealer can take screenshots, exfiltrate files stored on the system, and download and
execute second-stage payloads.
12
CLEAR
13
CLEAR
Sysmon Events
Noteworthy Sysmon events for Malware detection and system monitoring :
Event ID Description
1 Process creation
3 Network connection
11 FileCreate
12 RegistryEvent (Object create and delete)
13 RegistryEvent (Value Set)
15 FileCreateStreamHash
22 DNSEvent
Identifying Domain Generation Algorithm (DGA) and DNS Fast Flux Operations
Cybercriminals use Domain Generation Algorithms (DGA) and DNS Fast Flux as sophisticated
techniques to enhance the persistence, redundancy, and resilience of their malware operations,
particularly in the context of Command-and-Control (C2) communication. These methods help
ensure that malware can continue to operate and communicate with its infrastructure, even
when defenders take countermeasures such as blocking known domains or IP addresses.
5
splunk.com
6
zeek.org
7
learn.microsoft.com/en-us/sysinternals/downloads/sysmon
8
github.com/SigmaHQ/sigma
9
virustotal.github.io/yara
10
DNS Security Analytics
https://docs.paloaltonetworks.com/pan-os/10-0/pan-os-admin/threat-prevention/dns-security/dns-
security-analytics
11
wikipedia.org/wiki/Domain_generation_algorithm
14
CLEAR
systems and C2 servers. The primary purpose of a DGA is to ensure resilience in the face
of domain blacklisting, making it more difficult for defenders to disrupt malware
operations. By dynamically generating domains that change periodically, DGAs enable
attackers to maintain control over compromised machines, even as individual domains
are discovered and blocked.
• DNS Fast Flux is a technique used to obfuscate the location of C2 servers by rapidly
changing the IP addresses associated with a given domain name. The attacker uses a
large pool of IP addresses and rotates them frequently (sometimes within minutes or
seconds), making it difficult to track or block malicious traffic.12
• A Dual DNS Flux attack represents a more sophisticated variation of DNS Flux,
characterized by the frequent rotation of both the authoritative DNS server and its
associated records (e.g., A or NS records).13
A simple approach that can potentially detect usage of DGA is by calculating the Shannon
entropy16 on a domain name. In essence it calculates how “random” a string is. The higher the
resulted number, the more likely it is a malicious domain. The formula is quite simple to
implement:
Where x is the letter, and p(x) is the frequency of x in the domain name.
The following traffic, captured over the course of a few minutes, has been attributed to a single
Infostealer utilizing a Domain Generation Algorithm (DGA).:
As observed, the number of IP addresses and domains is substantial, with the domain names
appearing as arbitrary sequences of letters.
12
cloudflare.com/learning/dns/dns-fast-flux
13
Fast Flux 101: How Cybercriminals Improve the Resilience of Their Infrastructure to Evade Detection
and Law Enforcement Takedowns
https://unit42.paloaltonetworks.com/fast-flux-101/
16
splunk.com/en_us/blog/tips-and-tricks/when-entropy-meets-shannon.html
15
CLEAR
The following query analyzes numerous requests to non-existent domains, potentially indicating
the utilization of a DGA:
Sigma –
The following query detects DNS Fast Flux attacks, such as domains associated with numerous IP
addresses within a short time frame:
16
CLEAR
OR uri="*sqlite3.dll")
by id.orig_h _time span=10m | rename id.orig_h as source_ip
The following is a traffic capture from a machine, illustrating that all the aforementioned
libraries are being downloaded from a malicious IP address.
Further investigation revealed that the specific URI observed is associated with the Raccoon
17
Stealer malware.
The following is an example of a simple query designed to detect the use of common web
services. Note that the occurrence of false positives will depend on your specific environment,
so adjustments and configurations may be necessary:
17
[Part 2] Typical Steps of a Raccoon Stealer v2 Infection
https://darktrace.com/blog/the-resurgence-of-the-raccoon-steps-of-a-raccoon-stealer-v2-infection-part-2
17
CLEAR
Data exfiltration:
To exfiltrate stolen data, attackers must transmit it out of the compromised environment, which
can be achieved through various outward network channels. The present study will examine a
selection of widely employed techniques:
• Email: a straightforward method involves sending data via email. If SMTP logs are
accessible, examining recipient addresses and email contents can often reveal
suspicious activity.
• Telegram bots: attackers have also been observed using Telegram bots for
communication. For example, in this case, a Telegram bot (notably named "bot") is used
to transmit stolen email addresses and passwords, as shown in the accompanying
example.
• Living Off Trusted Sites (LOTS): is a cyberattack technique where attackers leverage the
credibility and reputation of legitimate, trusted websites (e.g. public cloud services,
hosting providers) to carry out malicious activities. This approach exploits the fact that
these sites are generally not subject to strict content monitoring or restrictions.
o Gaming platforms and channels:
▪ Another similar method involves the use of Steam bots. In this
example, a Steam user is observed interacting with a malicious IP
address, as illustrated in the accompanying image:
18
CLEAR
Although the article doesn't provide specific examples, the use of cloud services like S3 is
common for data leakage.
19
CLEAR
Configure the specifics as needed. Below is an example of traffic captured, where a machine
contacted a public IP web service and also made connections to the Telegram API and Pastebin
within a 3-minute window. This pattern could serve as a valuable lead for an investigation into
potentially malicious activity:
By searching for PowerShell user agents and further filtering results for contents containing a
GUID, we were able to identify this specific infostealer on additional machines. Below are the
observed user agents:
20
CLEAR
The Uris requested by the infected machines (GUID for each unique machine):
Another result we encountered was an online service for capturing screenshots. However, upon
investigation, it was determined to be a legitimate service used by Zoom, and not associated
with any malicious activity:
To identify network traffic associated with the online screen capture service, the following query
can be employed:
21
CLEAR
Beacons
Beacons are a common mechanism used by malware to maintain communication between the
compromised system and an attacker’s C2 infrastructure. A beacon typically refers to a small,
periodic network request sent from an infected machine to a remote server, signaling that the
system is still under control. These periodic "calls" allow the attacker to track the system's status
and issue further commands.
Building upon the previous discussion regarding the transmission and retrieval of data at fixed
intervals, this behavior is commonly referred to as "beaconing." In this process, requests are
sent to the attacker's server at regular intervals, wherein the malware inquires whether the
server has any commands to issue. This cycle continues at these set intervals, with the interval
potentially being slightly randomized to evade detection, until a command is received. In the
case of infostealers, which primarily focus on data collection, the malware typically bypasses the
request step and directly transmits the gathered data without awaiting a response.
22
CLEAR
For instance, the following is traffic captured that is associated with the Amadey infostealer19.
This traffic exhibits the typical beaconing behavior, where the malware periodically
communicates with its C2 server, transmitting stolen data without requesting further
commands.
19
Understanding Amadey Info Stealer & N-Day Vulnerabilities
https://darktrace.com/blog/amadey-info-stealer-exploiting-n-day-vulnerabilities
23
CLEAR
This page on the Splunk website outlines 21a method for detecting such beaconing behavior. The
approach includes techniques for monitoring and analyzing network traffic patterns, identifying
periodic communication to external servers, and correlating these patterns with known
malicious activity. By using Splunk's capabilities, it becomes easier to detect anomalies, such as
frequent outbound connections and data exfiltration attempts, that may indicate the presence
of malware like the Amadey infostealer.
C2 Abuse of Protocols
In the previous point, we discussed various ways in which an infostealer communicates
with the attacker, such as through the FTP protocol, APIs, and file hosting sites. While
these methods are legitimate in nature, they are exploited by malicious actors for
nefarious purposes. In contrast, here we will examine an alternative approach, where an
attacker abuses a protocol that was never intended for large-scale data transfer. This
method highlights how protocols designed for different functions can be repurposed to
facilitate malicious activity, often making detection more challenging.
• Our first example of protocol abuse is the DNS protocol. Two immediate
forms of abuse that come to mind are the DNS query itself and the TXT
record. Both can be exploited in a similar manner—by embedding small
chunks of data within the query request or the TXT record, which can then be
reconstructed by the attacker at the destination. The following are DNS
queries and their corresponding responses captured on a DNS server,
demonstrating this method of data exfiltration.
21
Signs of beaconing activity
https://lantern.splunk.com/Security/UCE/Guided_Insights/Threat_hunting/Monitoring_a_network_for_D
NS_exfiltration/Signs_of_beaconing_activity
24
CLEAR
Note that the TXT record in this case is base64 encoded. This encoding method is
often used to obfuscate the data, making it less obvious and harder to detect
during normal network traffic analysis. The base64 encoding allows the small
chunks of data to be transferred within the DNS protocol without immediately
raising suspicion:
Also possible is the use of built-in DNS tunneling detection capabilities within Splunk.
This feature enables the identification of unusual DNS traffic patterns, such as
unusually long domain names, frequent requests to suspicious domains, or excessive
TXT record usage. By configuring Splunk to monitor and alert on these behaviors, it
becomes easier to detect potential DNS tunneling activities that may be used for
data exfiltration or C&C communication:
| tstats min(_time) as mn max(_time) as mx sum(bytes) as sum_bytes
where index=main sourcetype="*generic*dns*"
[| inputlookup suspicious_tlds_list.csv
| search metadata_severity IN (Critical, High) NOT
metadata_popularity IN (High, Medium)
| rename url_domain as domain
25
CLEAR
• The second example involves the ICMP protocol, where each ICMP message
can carry a small data payload. The method of abuse is somewhat analogous
to DNS tunneling. In this case, the attacker might exploit ICMP by generating
a substantial volume of ICMP traffic between two specific machines, or by
creating prolonged "connections" characterized by continuous ICMP traffic
within a given timeframe. Detection typically involves monitoring for an
unusually high volume of ICMP packets or extended, uninterrupted ICMP
sessions, which may indicate the use of ICMP for covert communication or
data exfiltration.
26
CLEAR
Attack Vector
Infostealer malware typically gains access to a machine through various means, with
one of the most common methods being malicious links embedded in emails. However,
other techniques include malvertising, typosquatting, lookalike URLs, IDN homograph,
social engineering, or the use of malware disguised as legitimate software. Fortunately,
23
The CTU-13 Dataset. A Labeled Dataset with Botnet, Normal and Background traffic.
https://www.stratosphereips.org/datasets-ctu13
27
CLEAR
third-party vendors provide machine learning tools designed to detect such incidents,
leveraging advanced algorithms to identify patterns indicative of malicious activity.
These tools enhance the ability to recognize and block malicious attempts before they
compromise the system.
| tstats values(sub) as host values(id.resp_p) as dest_port
values(note) as note where index=main (sourcetype="*notice*"
(note="CorelightML::DomainTyposquattingSuspected" OR
note="CorelightML::SocialEngineeringDomainSuspected") id.resp_p!=53)
by id.orig_h id.resp_h _time
| rename id.orig_h as src_ip id.resp_h as dest_ip
For each suspected domain, we examine whether a subsequent connection has been
established with that domain, which could justify further investigation. This process
helps to identify domains that may require additional scrutiny. However, it is important
to note that this approach may yield results that reflect legitimate typos made by users
or generate false positives, requiring careful analysis to distinguish between genuine
threats and benign activity:
We also recommend integrating your Threat Intelligence (TI) feeds with these queries. For
instance, you can search for DNS requests to low-reputation IPs or domains, such as those
hosting malicious tools.
index=main sourcetype=*dns*
| lookup bad_ips ip_address AS dest_ip OUTPUT ip_address AS bad_ip ```
change the fields for domains ```
| where isnull(bad_ip) = false
| stats count by query, dest_ip, _time
| sort by _time
Alternatively, you can search for DNS queries targeting known top-level domains (TLDs)
commonly associated with phishing activity.
index="main" sourcetype="*dns*"
[| inputlookup fishing_tlds_list.csv
| where metadata_phishing_domain_score>50
| rename dest_nt_domain as query
| table query ]
by id.orig_h
28
CLEAR
Use the following link for an updated list of TLDs commonly associated with phishing campaigns:
https://github.com/mthcht/awesome-lists/tree/main/Lists/TLDs
Usage of Archives
Infostealers often leverage archive formats such as 7z or WinRAR to facilitate the
exfiltration of stolen data. These formats are commonly used because they allow for the
efficient compression and packaging of large amounts of information, making it easier
for attackers to transmit sensitive data in a smaller, more covert manner. By using these
archive formats, infostealers can bundle a range of file types—such as documents,
images, and system files—into a single, encrypted archive, enhancing the chances of
bypassing security measures such as email filters or intrusion detection systems. The use
of password protection or encryption further obscures the content, making it more
difficult to detect or analyze the exfiltrated data during transmission. Additionally, the
compressed nature of these archives allows for faster transfer, which is particularly
beneficial when transmitting large volumes of stolen data. The abuse of these
commonly used file formats makes detecting malicious activity more challenging, as
they are legitimate tools often employed in everyday computing tasks.
The following query is designed to detect the creation of a uniquely named archive file,
which could indicate an attempt by an infostealer to package and exfiltrate data. This
query focuses on identifying archive formats, such as 7z or WinRAR, with distinctive
names that may suggest malicious activity. Monitoring for unusual or uniquely named
archives helps to identify potential data exfiltration attempts by malware:
index="main" file_name IN ("*.zip","*.tar","*.rar","*.7z")
| streamstats c(file_name) as cc | where cc=1
The following query is designed to detect the use of the 7z command-line utility, which
is commonly abused by infostealers for creating archives that may contain stolen data:
29
CLEAR
.txt Files
Another exfiltration technique used by infostealers is the simple transfer of text files,
often containing stolen information. Monitoring the creation of such text files can serve
as a useful indicator, as the creation of text files with specific, unusual names or within
uncommon directories is relatively rare in typical system operations. Detecting these
files can help identify suspicious activities that may be associated with data exfiltration.
index="main" EventCode=11 TargetFilename="*.txt"
TargetFilename!="*gytpol*"
| streamstats c(TargetFilename) as cc by Computer
| where cc=1
C2 Known Tools
A prevalent exfiltration technique involves the use of known remote connection tools,
which attackers often leverage to send stolen information back to their C2 server.
Among these tools, FTP software and RClone are commonly used, as they allow for the
30
CLEAR
transfer of files to remote locations. Monitoring for the usage of these tools,26 as well as
other remote connection utilities, can provide valuable insight into potential data
exfiltration attempts. The list of tools used for this purpose is extensive, so it is crucial to
customize the detection strategy by adding or removing tools based on the specific
environment and threat landscape of your organization:
26
Ransomware-Tool-Matrix
https://github.com/BushidoUK/Ransomware-Tool-Matrix/blob/main/Tools/Exfiltration.mds
31
CLEAR
28
Adaptive Misuse Detection System (AMIDES)
https://github.com/fkie-cad/amides
32
CLEAR
Unlike rule-based detection, which can struggle with novel attack methods or obfuscations,
AMIDES leverages machine learning to detect anomalous behaviours that may deviate from
established patterns. By using an unsupervised approach, AMIDES is capable of identifying
previously unseen attack techniques that do not directly match predefined signatures, thereby
enhancing the detection of emerging threats. This method combines the strengths of both
behavioural analysis and signature-based detection, offering a more adaptable and
comprehensive security solution..
The image above illustrates the process by which AMIDES processes an incoming alert. This
approach is particularly significant as it allows for the detection of malicious activity that might
otherwise evade traditional SIEM systems. By incorporating machine learning, AMIDES improves
detection accuracy, even in cases where attackers employ evasion tactics that bypass typical
rule-based detection methods. Moreover, this method significantly reduces the time and
resources needed for detection, benefiting both security analysts and automated systems.
We strongly recommend adopting this approach within your organization. By doing so, you can
enhance your ability to detect sophisticated threats more efficiently and effectively, reducing
the risk of undetected malicious activity and minimizing the operational burden on your security
teams..
33
CLEAR
YARA
We recommend consulting the following resources for high-quality YARA rules that can be
implemented to enhance your organization's malware detection capabilities:
• https://yaraify.abuse.ch/yarahub/
• https://github.com/malpedia/signator-rules
• https://github.com/InQuest/awesome-yara
• https://github.com/VirusTotal/yara
• https://github.com/ThreatPatcher/yara-rules
• https://github.com/olcf/yara
• https://bazaar.abuse.ch/
• https://github.com/TheHive-Project/YARA
CTI providers consistently monitor the threat landscape, identifying emerging malware
families, variants, and attack techniques. This ongoing research enables them to develop
and maintain an extensive library of YARA rules specifically crafted to detect distinct
malicious patterns and indicators of compromise (IOCs). By integrating these rules into
their security infrastructure, organizations gain a powerful tool for proactive threat
detection, empowering them to identify and respond to threats at early stages.
Moreover, YARA rules sourced from CTI providers greatly enhance an organization’s
threat-hunting capabilities. Security analysts can actively use these rules to search for
malicious activity across their networks, helping to identify and neutralize threats before
they escalate into more severe incidents. In the event of a security breach, these rules
are invaluable in swiftly identifying the scope and impact of the attack, thereby
accelerating incident response efforts and minimizing downtime.
Additionally, by leveraging the expertise and resources of established CTI providers,
organizations gain access to high-quality YARA rules developed by seasoned security
researchers and analysts. This collaboration reduces the need for internal rule
development and the often-tedious process of testing and refining numerous rules,
freeing up security teams to focus on more critical tasks, such as improving overall
security posture and managing complex threats.
34
CLEAR
SIGMA Rules
Sigma rules are a standardized and open-source format designed to create and share threat
detection rules across various Security Information and Event Management (SIEM) systems and
other security tools. These rules provide a consistent and interoperable way to define patterns
of malicious activity, helping organizations detect and respond to potential threats in a unified
manner. The Sigma framework allows security teams to create detection rules using a common
language, independent of the underlying SIEM system or security platform. This enables rules to
be easily shared and adapted across different environments, enhancing collaboration and
accelerating the deployment of effective threat detection capabilities. Sigma rules consist of a
YAML-based format that defines specific conditions, event patterns, and fields to monitor within
log data. This flexible structure ensures that rules can be applied to various log types, including
network traffic, system logs, and application logs, making it a versatile tool for threat detection.
We recommend checking the following resources for SIGMA rules related to Infostealers:
• https://github.com/elastic/protections-artifacts/tree/main/yara
• https://github.com/magicsword-io/LOLRMM
• https://github.com/SigmaHQ/sigma
• https://valhalla.nextron-systems.com/
35
CLEAR
References
1. https://thedfirreport.com/2024/04/01/from-onenote-to-ransomnote-an-ice-cold-
intrusion/
2. https://blog.sekoia.io/stealc-a-copycat-of-vidar-and-raccoon-infostealers-gaining-in-
popularity-part-1/
3. https://www.cybereason.com/blog/research/threat-analysis-report-snake-infostealer-
malware
4. https://www.splunk.com/en_us/blog/security/under-the-hood-of-snakekeylogger-
analyzing-its-loader-and-its-tactics-techniques-and-procedures.html
5. https://www.quorumcyber.com/wp-content/uploads/2023/01/Malware-Analysis-
Vidar.pdf
6. https://gridinsoft.com/spyware/vidar
7. https://community.emergingthreats.net/t/vidar-stealer-picks-up-steam/271
8. https://www.infostealers.com/
9. https://research.splunk.com/stories/
10. https://www.cisa.gov/sites/default/files/2023-04/MAR-10435108.r1.v1.WHITE_.pdf
11. https://unit42.paloaltonetworks.com/fast-flux-101/
12. https://docs.paloaltonetworks.com/pan-os/10-0/pan-os-admin/threat-prevention/dns-
security/dns-security-analytics
13. https://www.crowdstrike.com/en-us/cybersecurity-101/malware/fileless-malware/
14. https://blog.morphisec.com/fileless-malware-attacks
36