TheCyberSecHub

Inside the Pyramid of Pain: Enhancing Cyber Threat Intelligence and Response

The Pyramid of Pain framework helps assess how difficult it becomes for attackers when defenders focus on particular indicators. The higher up the pyramid you go, the more disruptive your detection efforts are to the adversary’s operations or activities.

This content is adapted from TryHackMe’s Pyramid Of Pain.


1. Introduction

Pyramid of Pain

Key Concept: The Pyramid of Pain framework organises threat indicators according to the level of difficulty or disruption they pose for attackers to alter. It assists cybersecurity teams in identifying which indicators, when targeted, will most significantly disrupt or obstruct adversary activities.

Use it to:

Why It Matters for Security Teams

The Pyramid of Pain is essential for:

Key Takeaway The objective isn’t just to detect threats—it’s to make attacks so expensive that adversaries decide to abandon their efforts.

Next Steps:


2. Hash Values in the Pyramid of Pain: A Practical Guide

A hash value is the output generated by a hashing algorithm when it processes an input, which can be a password or a file.

What Hashes Provide:

Why Hashes Are “Trivial” in the Pyramid of Pain At the bottom of the Pyramid of Pain, hash values represent the easiest indicators for attackers to alter, requiring little effort to circumvent. While they are helpful for quick identification, they provide low adversary disruption because:

How Security Teams Use Hashes

A. Initial Triage

B. Limitations

changes its MD5 from DJA808E3
 to 90528A6F
, evading hash-based blocklists.

Hands-On Exercise

Task: Analyse the report associated with the hash “b8ef959a9176aef07fdca8705254a163b50b49a17217a4ff0107487f59d4a35d”

Goal: What is the filename of the sample?

Answer: Sales_Receipt 5606.xls


3. IP Addresses in the Pyramid of Pain: Balancing Utility and Limitations

Understanding the Importance of IP Addresses in Threat Detection

IP addresses play a crucial role in recognising endpoint devices on a network, including desktops, servers, and even Internet of Things devices such as security/CCTV cameras. In the context of cybersecurity and the Pyramid of Pain, IP addresses function as indicators of compromise (IOCs), helping to identify and prevent malicious activity.

In the Pyramid of Pain, IP addresses sit just above hash values and are categorised as “Easy” level indicators, representing a slightly more disruptive, yet still limited, indicator for defenders. They’re visualized in green, emphasising that while useful, these indicators offer limited long-term efficacy when used alone.

Defensive Use of IP Indicators

From a defensive standpoint (blue team), detecting and blocking potentially harmful IP addresses can assist in thwarting connections with known malicious networks. For instance:

Nevertheless, experienced attackers can effortlessly circumvent this tactic by switching to new IP addresses or using methods like Fast Flux to rotate their infrastructure.

Example, Analysing Malicious IP connections from the TryHackMe Walkthrough (using app.any.run) In the analysis scenario:

NOTE! Do not attempt to interact with the IP addresses nor domain names shown in the above example.

Fast Flux & Evasion Tactics

Attackers can complicate IP-based blocking through Fast Flux DNS, where a domain resolves to a constantly changing set of IP addresses:

This tactic highlights the fragility of IP-based detection: IP addresses can change quickly, making them an unreliable sole indicator.

Pro Tip:

Moving Up the Pyramid

Hands-On Exercise

Task: Analyse the report generated from any.run for this sample to answer the following questions:

Answer

To answer the two questions above: Looking at page 5 of the any.run report and focusing on the “network activity” section of the report, we observe that

For additional illustrative information, refer to the table provided below:

Pyramid of Pain exercise 2


4. Domain Names in the Pyramid of Pain: The “Simple” Tier

Transitioning from IP Addresses to Domain Names

As we move up the Pyramid of Pain, we encounter domain names, which are considered slightly more difficult for adversaries to substitute compared to IP addresses. This transition is illustrated in the colour change from green to teal in the pyramid graphic.

A domain name is essentially a readable string for humans that corresponds to an IP address — for instance:

Domains provide a convenient and memorable means of accessing online resources and are extensively utilized by attackers for Command & Control (C2) operations.

Why Domain Names Are Important in Threat Detection

From the viewpoint of a defender:

Unlike IPs, changing a domain often involves:

This process introduces challenges for the attacker’s operations, which is why domain names are more effective for detection and blocking compared to IP addresses.

Examples of Malicious Domains

TryHackMe lists examples of real-world malicious domains used in campaigns like Sodinokibi (REvil), illustrating how attackers create domains for delivering malware or communicating with compromised hosts. Some examples include: - dubero.com - tasteofwilliamsburg.com - revratka.com These domains are often crafted to appear harmless or to imitate genuine services.

Obfuscation Using Punycode A cunning strategy employed by attackers involves Punycode, where they leverage Unicode to visually mimic a recognized domain. For example:

This method is known as a Punycode attack, used in phishing and malware campaigns to trick users and evade visual scrutiny. Modern-day browsers like Internet Explorer, Google Chrome, Microsoft Edge, and Apple Safari have become quite adept at converting obfuscated characters into their complete Punycode domain names.

To detect malicious domains, proxy logs or web server logs may be used.

URL Shorteners for Redirection Cybercriminals often use URL shorteners to conceal their malicious domains:

Using Any.run for Domain Analysis In sandbox environments like Any.run, you can: - Monitor DNS queries to determine if malware is attempting to resolve domains. - Monitor HTTP requests to track interactions with malicious servers. - View Connections (TCP/UDP) that may suggest C2 traffic activity or data exfiltration.

For example, a suspicious domain like craftingalegacy.com may appear as the first IOC in a malware execution trace, indicating its role in the infection chain.

Hands-On Exercise

This will direct us to a preview page that displays the final destination URL, allowing us to confirm its safety and legitimacy. Therefore, the shortened URL https://tinyurl.com/bw7t8p4u redirects to https://tryhackme.com/


5. Leveraging Host Artifacts to Disrupt Attackers: The ‘Annoying’ Tier of Pyramid of Pain

Introduction

This phase signifies a significant jump in the challenge for the attacker. Host artifacts are positioned in the yellow zone of the Pyramid of Pain and are considered “annoying” for adversaries. When defenders successfully identify these indicators, attackers are forced to change their tools, behaviours, or possibly even their entire approaches, which requires them to expend time, effort, and resources.

What Are Host Artifacts?