[ << ALL_FEED ]

The Power of Correlation: Hunting Unknown Threats with Generic Suricata Rules

More in Malware

  • Open up, that's an order

    The PT ESC cyber threat intelligence team has discovered the exploitation of CVE-2026-21513 in attacks on…

  • BECna: very malicious things

    The PT ESC Threat Intelligence team has recorded mass BEC attacks against Russia using the BoryptGrab…

  • This is Siemens...

    Recently, our colleagues from the Positive Industrial Expertise Center discovered a curious Windows sample on MalwareBazaar.…

  • Anti-antivirus

    Recently, we came across an APK with an intriguing and trust-inspiring name: «Антивирус ФСБ.apk». After installing…

  • .exe .docm .xlsm

    .exe .docm .xlsm Malicious files with these extensions are most often found in corporate network traffic.…

Hi everyone! My name is Ksenia Naumova, and I’m a Senior Network Security Researcher at the PT ESC Antivirus Lab (Positive Technologies). My work focuses on malware traffic analysis, writing Suricata detection rules, and exploring new approaches to network threat detection. In this article, I’d like to share the research I presented at SuriCon 2026 in Lisbon on November 19 and show, through real-world examples, how we can reuse existing network detection expertise to hunt for unknown malware.

What if a malicious sample doesn’t trigger a single family-specific rule, yet its traffic shows signs of a check-in with a command-and-control (C2) server, the use of a non-standard protocol, or the exfiltration of collected data? Instead of looking for yet another unique fragment of a network request and writing a highly specific rule for it, we can use existing rules that detect individual suspicious behaviors and look at how they combine. Let’s explore this approach in practice – from correlation within a single network connection to finding recurring combinations of three generic rules across network telemetry.

Why exact rules are not enough

A rule targeting a specific malware family provides valuable context for an analyst. However, how long it remains effective depends on how robust the patterns used in the rule are. Sometimes simply renaming a PHP script can break detection, while in other cases the same detection patterns remain effective for years. Let’s look at a few examples:

ReconShark and Pterodo: changing URIs

On September 4, 2024, a rule with SID 19299291 was created for the ReconShark loader associated with the Kimsuky APT group. It looked for a GET request with a URI ending in /d.php?na=. Just 13 days later, on September 17, a new rule with SID 19299292 was created to match a different URI – /dist.php?na=. All other detection conditions shown here remained unchanged.

Another example is a pair of Emerging Threats rules for Pterodo (SIDs 2035219 and 2035220), both created on February 18, 2022. The rules differ in the URI prefix they match: /declaration.php?id= and /revers.php?id=. The POST method, header checks, and the parameters name= and &count= in the request body remain the same.

Why not look for the common fragment .php?id= instead, removing the requirement to match the beginning of the URI while keeping the other conditions? This could make the detection more resilient to changes in script names, but the generalized rule needs to be tested against legitimate traffic. On its own, this URI fragment is too common to be considered an indicator of compromise.

Mamont: reordering JSON fields

Comparing traffic from the Mamont Android banking Trojan captured on April 26, 2024, and September 29, 2026, we can see that the hwid and teamId fields are still present, even though the URI, infrastructure, and the set and order of JSON fields have changed. 

In the original version of the rule with SID 10011262, the hwid field had to be matched within the first seven bytes of the request body, and the remaining fields had to follow in a specific order. The revision dated October 12, 2026, removed these constraints on field position and order. 

However, the updated rule still requires the service, deviceModel, and androidVersion fields. The shorter /sms-app request, containing only teamId and hwid, therefore does not match all of the rule’s conditions. We’ve removed the dependency on field order, but the rule still needs further refinement to cover new types of Mamont requests.

Generic rules as building blocks

In this article, I use the term generic rule to refer to a rule that detects a network pattern or behavior without necessarily being tied to a specific malware family. These rules can capture recurring traffic patterns across different threats, such as device information collection, file downloads, unusual HTTP requests, binary message exchange, and other anomalous behavior. Let’s look at a generic rule that detects MAC addresses in TCP traffic and an example of it firing on an HTTP request:

In this case, the MAC address is sent along with other system information via a Discord webhook. This alone is not evidence of malicious activity: many legitimate applications also transmit MAC addresses as part of their network communications.

Another example is a rule that looks for signs of gzip compression in the body of an HTTP POST request:

The rule looks for the byte sequence 1f 8b 08 00 00 00 00 00 at the beginning of a POST request body. It only covers a specific variant of the gzip header, yet it is still too generic to serve as a standalone malware detection rule. It can, however, be useful as part of a more complex detection.

Correlation in Suricata: flowbits and xbits

Some relationships between network events can be defined directly in Suricata rules. flowbits store state within a flow, while xbits allow us to correlate events across flows by IP address or IP address pair, with a configurable expiration time.

Flowbits: accessing a file-sharing service and receiving data

The rules with SIDs 10007980 and 10017078 detect connections to file.io and pastebin.com based on TLS SNI and set the same flag, genflow__filesharing_access. The next rule, with SID 10008399, checks this flag and the imbalance in traffic volume between the client and server: less than 1,000 bytes from the client and more than 100,000 bytes from the server. It also checks the first bytes of the TLS record (17 03). If all conditions are met, the flag is cleared.

This approach allows us to identify potential large downloads within TLS connections without decrypting their contents. This rule combination helped me find a Sicarii ransomware sample. A closer look at its PCAP revealed a link to file.io in a separate HTTP request.

The request body also contains a victim identifier and other data. Accessing a file-sharing service, however, is not inherently malicious.

Xbits: agent registration and heartbeat

To correlate events across HTTP connections, I used two rules with SIDs 10018441 and 10017445. The first rule looks for a POST request with a JSON-like body containing an agent identifier and host information, and no Referer header. When the rule matches, it sets the generic_rat_checkin flag for the destination IP address with a 10-second expiration time. The second rule looks for a URI containing heartbeat, also without a Referer header, if the flag is set.

This rule combination helped me identify an unclassified remote access Trojan (RAT) sending agent and host information in a request to the heartbeat endpoint. Correlating events by destination IP address is useful for identifying potential C2 infrastructure, but it does not guarantee that both requests came from the same client: a shared IP address may host multiple independent applications. This is worth keeping in mind when deploying this type of correlation in production.

From individual events to a behavioral model

In the previous examples, we knew in advance which network patterns we wanted to correlate and defined that logic directly in the rules. But what if we approached the problem from the opposite direction? Could we discover interesting combinations in the generic alerts we’ve already collected? I started with the MITRE ATT&CK matrix, focusing on techniques that can leave observable traces in network traffic.

Based on MITRE ATT&CK, I built my own three-stage model and introduced a separate category for remote access and control.

This is my own classification rather than an official ATT&CK model. Mapping a rule to an ATT&CK technique does not prove that the technique was used: for example, heartbeat messages may be sent by both a malicious agent and a legitimate service. Assigning rules to stages does not imply a specific sequence of events either.

I defined five patterns for selecting rule combinations: S1–S2–S3, S1–S2–R, S1–R–S3, S1–R–R, and S2–R–S3. S1, S2, and S3 represent the three stages, while R represents the remote access and control category. The S1–R–R pattern uses two different rules from this category.

Putting the approach to the test

To find interesting patterns, I looked at combinations of three distinct generic rules firing within the same episode of network activity, regardless of alert order. In total, I identified 1,607 unique combinations: 861 appeared both with and without malware-specific detections, 676 appeared exclusively without them, and the remaining 70 appeared only alongside malware-specific detections. The first two groups are particularly interesting for threat hunting: we can either reuse known malware behavior patterns to discover other samples or investigate traffic that did not trigger any family-specific rules. Let’s look at some examples.

Case 1: Three suspicious indicators in legitimate traffic

Let’s look at the first rule combination: an empty User-Agent, gzip in TCP traffic, and Possible Malware Checkin. At first glance, this looks like malware activity – an unusual HTTP client, compressed data, and a check-in. But a closer look at the PCAP reveals telemetry from a legitimate Android application containing device and SDK information. The screenshot shows one of the requests from this episode, rather than all three rules firing on a single request.

The individual generic rules may actually be working as intended: the patterns they look for are present in the traffic. A false positive (FP) occurs at the correlation level if we immediately classify this combination as malicious. For threat hunting, however, it’s simply a lead to investigate. That’s why it’s important to look beyond the rules’ msg fields and examine the actual traffic in the PCAP.

Case 2: Hunting for infostealers

Here we’re looking at several indicators at once: frequent POST requests, a sequence of ASCII control characters or non-ASCII bytes in the request body, and signs of a ZIP archive transfer. The last rule looks for the strings PK and .zip in the request body, so it’s worth checking the PCAP to see whether we’re actually dealing with an archive and, if so, what it contains.

This combination was observed in EncryptHub Stealer traffic:

The same combination was also found in traffic from an unidentified infostealer. Let’s look at the requests themselves: in the first case, data is sent via the Telegram Bot API; in the second, it’s sent to the /register endpoint, and the request body appears to be encoded. As in the previous case, we’re looking at alerts across the entire episode of network activity, rather than a single request.

Despite differences in implementation and C2 infrastructure, the same combination of generic alerts appears in both cases. That’s what makes it useful for threat hunting: instead of hunting for a specific EncryptHub URI or domain, we can look for other malware samples exhibiting similar network behavior.

Case 3: Hunting for RATs

The next example is the S1–R–R combination, which I observed in NanoCore RAT traffic:

And here’s what traffic from an unidentified RAT looks like:

In addition to the rule detecting a series of HTTP POST requests, two rules fire on binary TCP traffic that Suricata does not identify as HTTP or TLS. Both check the value of the first payload byte, the presence of three consecutive null bytes starting at offset 1, and additional payload constraints. The first rule sets the RAT_1st_packet flowbit; the second checks it when inspecting the server response within the same flow.

Comparing the hex dumps reveals similarities in the structure of individual messages, even though the data itself differs. Not every message in the dumps necessarily matches the rule conditions. Using flowbits, we can correlate traffic in both directions, but these are not two independent detection signals: the second rule depends on the flowbit set by the first rule. The HTTP activity provides additional context to investigate in the PCAP.

Case 4: Discovering an unknown banking Trojan!

Another interesting finding was an unknown banking Trojan. Within the same episode of network activity, rules fired on a WebSocket upgrade, a series of POST requests, and a request to a URI containing /heartbeat. None of these patterns is particularly unusual on its own: WebSocket and heartbeat mechanisms are commonly used by legitimate applications. What matters here is the data being exchanged.

A closer look at the PCAP revealed a much more interesting POST request to /api/device/commands, with a binary request body and custom headers: X-C2-Key, X-C2-Ts, X-C2-Nonce, and X-C2-Sign. None of the three generic rules was specifically designed to detect banking Trojans, yet their combination provided a starting point for analyzing the C2 protocol and identifying more specific malware patterns.

Applying the approach in practice

If your ruleset already contains generic rules, you can start by exporting their alerts. Useful EVE JSON fields include alert.signature_id, flow_id, src_ip, dest_ip, and timestamp. Group events by host or another suitable entity, choose a time window, and identify which combinations of SIDs occur in the traffic of known malware families. Then look for the same combinations in traffic that did not trigger exact rules. Keep in mind that thresholding may limit the number of logged alerts.

The first thing I’d check is whether the alerts are related: do they belong to the same flow, the same client, or multiple related connections? Several rules firing on the same fragment of a request are not the same as observing a check-in, command retrieval, and subsequent data exfiltration. The latter gives us much more context for analysis.

Before turning a newly discovered combination into a production correlation rule, it’s worth testing it against both PCAPs containing malicious traffic and legitimate traffic, then monitoring its alerts in silent mode for a while before enabling it in production. Based on the results, you can refine the correlation key or time window, or add another network indicator to help reduce false positives.

Conclusions

Generic rules are not a replacement for family-specific signatures – they’re another tool for network analysts. URIs, infrastructure, and data formats may change, but individual malware behavior patterns often persist. Instead of starting from scratch every time, we can reuse our existing detection expertise: hunt for unknown malware using combinations of familiar alerts, analyze its network traffic, and expand the coverage of our rulesets. Perhaps some of the building blocks for detecting threats we haven’t investigated yet are already hiding in our rulesets – as individual, seemingly unrelated generic rules.

A single alert may go unnoticed, but several alerts connected to each other can tell an entire story! And that is precisely where the power of correlation lies.

More of my research in the field of network security, as well as materials from conference presentations, can be found on my website and on Twitter (@naumovax).

More from author_avlab

No other materials by this author yet.

More from author_avlab

No other materials by this author yet.

More in Malware

  • Open up, that's an order

    The PT ESC cyber threat intelligence team has discovered the exploitation of CVE-2026-21513 in attacks on…

  • BECna: very malicious things

    The PT ESC Threat Intelligence team has recorded mass BEC attacks against Russia using the BoryptGrab…

  • This is Siemens...

    Recently, our colleagues from the Positive Industrial Expertise Center discovered a curious Windows sample on MalwareBazaar.…

  • Anti-antivirus

    Recently, we came across an APK with an intriguing and trust-inspiring name: «Антивирус ФСБ.apk». After installing…

  • .exe .docm .xlsm

    .exe .docm .xlsm Malicious files with these extensions are most often found in corporate network traffic.…