LAB-04Easy

Advanced String Hunt

Extract the C2 URL, persistence key, and mutex name from a binary using string analysis.

10 min3 prerequisites5 tools

Investigate

Hints

Hint 1

Open the file in the hex viewer and read the ASCII column.

Hint 2

The strings are not in a standard PE section — scan the whole file.

Hint 3

The file is 8KB of realistic filler around three real strings — Find is faster than scrolling. The URL sits around offset 0xC40, the persistence path around 0x1420, the mutex around 0x1B90.

Submit Findings

Prerequisites

  • sa1-strings-metadata
  • Hex editor usage
  • Common malware IOC patterns (C2, mutex, Run keys)

Methodology

Investigation Methodology

1. Load & Scan

  • Open the binary in the hex viewer or a hex editor
  • Enable ASCII/UTF-8 column view
  • Scroll through the entire file — raw binaries have no section structure

2. Identify IOC Categories

Look for these telltale patterns:

Category Patterns Example
C2/Network http://, https://, IP addresses, domains http://c2.example.com/gate.php
Persistence Run, RunOnce, Services, Startup, Winlogon Software\Microsoft\Windows\CurrentVersion\Run
Mutex Global\, Local\, Mutex, MUTEX Global\mx_123
File Paths %APPDATA%, %TEMP%, %SYSTEM%, \\.\ %APPDATA%\svchost.exe
Crypto AES, RSA, RC4, XOR, base64 strings U2FsdGVkX1...

3. Extract & Document

  • Note the file offset of each string
  • Record the full string exactly as it appears
  • Categorize each finding
  • Build the behavioral profile

4. Correlate Findings

  • C2 URL + Persistence + Mutex = Implant/Beacon
  • C2 URL only = Downloader/Stage 1
  • Persistence + File drop = Dropper
  • Mutex only = Single-instance component (part of larger malware)

5. Pivot to Deeper Analysis

  • Use C2 domain for infrastructure hunting (VirusTotal, URLhaus)
  • Use mutex for host-based detection
  • Use persistence path for registry monitoring

Common Pitfalls

  • Only running `strings` with default minimum length (4 chars) — misses short IOCs
  • Assuming PE section structure in a raw binary blob
  • Missing Unicode/UTF-16 strings — always check both ASCII and wide char
  • Overlooking environment variable paths (`%APPDATA%`, `%TEMP%`)
  • Not noting file offsets — needed for YARA rules and precise detection

Tools

  • Built-in Hex Viewer
  • strings (GNU) with `-a` (all) and `-el` (UTF-16LE) flags
  • FLOSS (FireEye) for obfuscated string extraction
  • Ghidra (Defined Strings window)
  • ImHex / HxD / 010 Editor

References

  • Lesson SA1: Strings & Metadata
  • MITRE ATT&CK: T1071 (C2), T1547 (Persistence), T1543 (Mutex)
  • Malware IOC standards: STIX, OpenIOC, MISP
  • FireEye FLOSS documentation

Extensions & Challenges

  • Write a YARA rule matching all three IOCs
  • Extract strings from a real sample (MalwareBazaar) and categorize
  • Research: How do malware authors encode/encrypt strings to evade `strings`?
  • Build a string extractor that handles XOR, ROT, base64, and custom encodings