root@thehacksparrow:~/writeups$ SYSTEM ONLINE
root@sparrow:~/writeups$ cat pyramid-of-pain.md
// Blue Team & SOC

Pyramid Of Pain

8 Nov 2026 · 7 min read
Overview — A foundational Blue Team & SOC room on David Bianco's Pyramid of Pain, a model that ranks indicators of compromise by how much it hurts an adversary when you detect and deny them. You climb the six tiers (hash values, IP addresses, domain names, host and network artifacts, tools, and TTPs), answer questions from sandbox and threat-intel reports, and finish by sorting indicators into the right tier yourself.
PlatformTryHackMe
CategoryBlue Team & SOC
DifficultyEasy
RoomPyramid Of Pain

Task 1 — Introduction

The Pyramid of Pain was published by David Bianco in 2013. Its core claim is simple: the pain you cause an adversary depends on the type of indicator you can use against them. Blocking a file hash costs an attacker seconds; making their entire operating method useless costs them weeks of work. The model is widely used to prioritise threat intelligence, decide what to hunt for, and judge how durable a detection rule really is.

          /\
         /TT\        TTPs ............ Tough
        /----\
       /Tools \      Tools ........... Challenging
      /--------\
     /Artifacts \    Network/Host .... Annoying
    /------------\
   /Domain Names  \  Domains ......... Simple
  /----------------\
 /   IP Addresses   \ IPs ........... Easy
/--------------------\
/     Hash Values     \ Hashes ....... Trivial

Read it bottom to top: the wide base is easy for the attacker to change, so detections there are cheap to build but cheap to evade. The narrow tip is expensive to change, so detections there are harder to write but far more durable.

Task 2 — Hash Values (Trivial)

A hash is a fixed-length fingerprint of data. Analysts use hashes to identify a sample unambiguously and to share it in reports. Common algorithms:

AlgorithmOutput sizeStatus
MD5128 bits (32 hex chars)Broken for collision resistance; still common for lookups
SHA-1160 bits (40 hex chars)Deprecated; practical collisions demonstrated (SHAttered, 2017)
SHA-256 (SHA-2)256 bits (64 hex chars)Current standard for IOC sharing

Hash lookups (VirusTotal, MetaDefender) make known-bad files trivial to spot. The weakness is that changing a single bit of a file produces a completely different digest. An attacker can recompile, repack, or just append a byte and every published hash becomes useless. A quick demonstration in PowerShell:

Get-FileHash .\OpenVPN_2.5.1_I601_amd64.msi -Algorithm MD5
# MD5  D1A008E3A606F24590A02B853E955CF7

echo "AppendTheHash" >> .\OpenVPN_2.5.1_I601_amd64.msi
Get-FileHash .\OpenVPN_2.5.1_I601_amd64.msi -Algorithm MD5
# MD5  9D52B46F5DE41B73418F8E0DACEC5E9F

Appending text with >> leaves the program's behaviour intact for most formats but changes the digest entirely. That is why a hash-only blocklist is the weakest control on the pyramid.

Q: Analyse the report for the hash b8ef959a9176aef07fdca8705254a163b50b49a17217a4ff0107487f59d4a35d. What is the filename of the sample?
A: Sales_Receipt 5606.xls

Task 3 — IP Address (Easy)

Blocking known-malicious IPs at the perimeter firewall is the classic reaction. It works, but only until the attacker rents a new VPS, pivots through another compromised host, or routes through a proxy. A more resilient technique is Fast Flux: a DNS trick where one domain resolves to a rotating pool of many (often compromised) hosts with very short TTLs, so the real command-and-control server stays hidden behind constantly changing IPs and any single IP block is outdated within minutes.

Rule of thumb: IP blocks buy you time, not security. Treat them as a cheap, short-lived layer, and expect the same actor to return from different addresses.

The task gives a sandbox report for a malicious sample. In the network activity section, look at the connections made by the offending process.

Q: What is the first IP address the malicious process (PID 1632) attempts to communicate with?
A: 50.87.136[.]52

Q: What is the first domain name the malicious process (PID 1632) attempts to communicate with?
A: craftingalegacy.com

Task 4 — Domain Names (Simple)

Domains are one step up. To rotate one, the attacker has to buy or hijack a name, point DNS at their infrastructure and wait for propagation. Cheap registrars with APIs and domain generation algorithms soften that cost, but it is still more friction than switching an IP. Domains are also detectable in proxy logs, DNS logs, and web server logs, which makes them a good hunting pivot.

Two evasion tricks to know:

  • Punycode / homograph attacks. Punycode encodes Unicode domain names into ASCII. An attacker can register a lookalike that swaps a letter for a visually similar Unicode character. For example adıdas.de (with a dotless "ı") is stored as xn--addas-o4a.de. Modern browsers usually display the xn-- form for suspicious mixes, but mail clients and chat tools are less consistent. Always look for the xn-- prefix in logs.
  • URL shorteners. Services such as bit.ly or tinyurl.com hide the real destination. Most expose a preview: appending a + to the short link (bit.ly style) or using the service's "preview" feature shows the target without visiting it. Never click an unknown short link; use a sandbox or URL scanner.

In a sandbox report such as ANY.RUN, the HTTP Requests, Connections, and DNS Requests tabs show where the sample reaches out. Do not browse to those addresses from your own machine, as they are live attacker infrastructure.

Q: Provide the first suspicious domain request you see in the report.
A: craftingalegacy.com

Q: What term refers to an address used to access websites?
A: Domain Name

Q: What type of attack uses Unicode characters in the domain name to imitate a known domain?
A: Punycode attack

Q: Provide the redirected website for the shortened URL using a preview.
A: https://tryhackme.com/

Task 5 — Host Artifacts (Annoying)

Now we reach the yellow zone, where the attacker genuinely starts to feel it. Host artifacts are the traces malware leaves on the machine: registry keys and values, dropped files and their paths, mutexes, scheduled tasks and services, and distinctive process behaviour. They are visible with tools like Process Monitor, Sysmon, and EDR telemetry.

Detecting these forces the adversary to change how the malware behaves, not just where it connects, which usually means modifying code or builds. In the supplied report, the process regidle.exe makes an HTTP POST to a US-based IP on port 8080, and the actor drops an executable into the system.

Q: A process named regidle.exe makes a POST request to a US-based IP on port 8080. What is the IP address?
A: 96.126.101[.]6

Q: The actor drops a malicious executable. What is its name?
A: G_jugk.exe

Q: In the VirusTotal report, how many vendors determine this host to be malicious?
A: 9

Task 6 — Network Artifacts (Annoying)

Network artifacts sit in the same tier. They are patterns in traffic rather than single addresses: unusual User-Agent strings, URI structures of C2 check-ins, specific POST body formats, beacon intervals, or JA3/TLS fingerprints. Malware often hard-codes an outdated or odd User-Agent that real users in your environment never produce, so it stands out in proxy logs, Snort/Suricata alerts, or a PCAP.

TShark extracts them quickly:

tshark -Y http.request -T fields -e http.host -e http.user_agent -r analysis_file.pcap

-Y applies a display filter so only HTTP requests are kept, -T fields with -e prints just the host and User-Agent columns, and -r reads the capture file. Sorting and counting the output (| sort | uniq -c | sort -rn) quickly reveals rare agents worth a closer look.

Q: What browser uses the User-Agent string shown (the MSIE 7.0; Windows NT 6.1; Trident/4.0 pattern)?
A: Internet Explorer

Q: How many POST requests are in the screenshot from the pcap file?
A: 6

Task 7 — Tools (Challenging)

Tools are the attacker's software: macro-document builders, backdoor and C2 frameworks, custom EXEs and DLLs, password crackers. If you reliably detect the tool itself, the adversary must find an alternative, buy or build a new one, and learn it, which costs real money and time.

Defensive weapons at this level include antivirus signatures, detection rules, and YARA rules. Useful public sources are MalwareBazaar and MalShare for samples and YARA matches, and SOC Prime's marketplace for shared detection rules.

Fuzzy hashing deals with the weakness we saw in Task 2. Instead of an all-or-nothing digest, it produces a similarity score between files, so a lightly modified variant of known malware still matches. The best-known implementation is ssdeep, based on context triggered piecewise hashing (CTPH).

Q: Provide the method used to determine similarity between the files.
A: Fuzzy Hashing

Q: Provide the alternative name for fuzzy hashes without the abbreviation.
A: context triggered piecewise hashes

Task 8 — TTPs (Tough)

At the apex are Tactics, Techniques and Procedures. This is the full behaviour of the adversary across the kill chain, catalogued in the MITRE ATT&CK framework: how they phish, escalate, persist, move laterally, and exfiltrate. Detecting a technique such as Pass-the-Hash (via anomalous NTLM logons in Windows event logs) catches the actor regardless of what tool, domain, or IP they use this week.

The attacker is left with two real options: retrain and rebuild their whole playbook, or give up and pick another victim. Both are expensive, which is exactly the point of the model.

Behavioural detections are harder to write and prone to false positives, so test them against normal activity before deploying them in production.

Q: How many techniques fall under the Exfiltration category in the ATT&CK matrix?
A: 9 (the room's answer; ATT&CK is updated regularly, so the current count may differ)

Q: Chimera is a China-based group active since 2018. What commercial remote access tool do they use for C2 beacons and data exfiltration?
A: Cobalt Strike

Task 9 — Practical: The Pyramid of Pain

The practical is a static site where you drag a set of indicators into the correct tier. Use the logic from the previous tasks: a bare file hash or IP is bottom tier; a domain is one step up; registry keys, dropped file names, User-Agents and URI patterns are artifacts; named malware, frameworks and compiled implants are tools; and behaviours such as credential dumping or lateral movement technique are TTPs. Submitting the correct arrangement returns the flag.

Q: Complete the static site. What is the flag?
A: FLAG (flag redacted)

Task 10 — Conclusion

To practise beyond the room, pick a public APT group profile, list its published indicators, and for each one ask: what detection could I write, and where does it fall on the pyramid? Aim to spend your effort on the upper tiers.

Beyond the room

Public context, not part of the room. Bianco's original post is "The Pyramid of Pain" (2013). Its ideas connect directly to MITRE ATT&CK for TTP mapping, to Sigma for sharing vendor-neutral detection logic, and to YARA for tool detection. A common refinement is to treat indicators at the bottom as short-lived "hygiene" blocks, and to invest analyst time in behaviour-based detections that survive infrastructure changes.

Key takeaways

  • The higher the indicator sits on the pyramid, the more it costs the attacker to change, and the more durable your detection is.
  • Hashes and IPs are cheap to block and just as cheap to evade (recompiling, Fast Flux, new VPS).
  • Domains add friction but are defeated by Punycode lookalikes, shorteners, and cheap registrars.
  • Host and network artifacts (registry keys, dropped files, User-Agents, URI patterns) force real changes to malware behaviour.
  • Tools can be caught with YARA and fuzzy hashing (ssdeep/CTPH), which tolerate small modifications.
  • TTPs mapped to ATT&CK are the most painful to change; prioritise behavioural detections when you can.
  • Use the pyramid to decide where to invest detection-engineering time, not just to label indicators.