# Malware Static Triage Strings And Imports

> Use when you need maximum signal from strings and imports during static triage, covering extraction with FLOSS, IOC pattern hunting, import capability grouping, detecting API hashing and dynamic resolution, and reading the strings-imports narrative. Covers which string patterns matter, how to spot hidden imports, and turning both into YARA strings and report evidence. Use when triaging a new sample, when imports look suspiciously small, or when building the evidence base for a verdict.

- Skill: `mizazhaider-ceh/malware-static-triage-strings-and-imports` (Agent Skill)
- Install (CLI): `npx get-skill add mizazhaider-ceh/malware-static-triage-strings-and-imports`
- Raw SKILL.md: https://api.skillmd.com/api/skills/mizazhaider-ceh/malware-static-triage-strings-and-imports/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Docs & Writing
- Author: mizazhaider-ceh (https://skillmd.com/u/mizazhaider-ceh)
- Updated: 2026-11-22
- Page: https://skillmd.com/skills/mizazhaider-ceh/malware-static-triage-strings-and-imports

---


Strings and imports are the two cheapest high-signal views of a binary.
Strings reveal intent in the author's own words (URLs, mutexes, error
messages); imports reveal capability (which system doors the binary can
open). Together they usually tell the triage story in under five
minutes. This sub-skill covers extracting both well, hunting the
patterns that matter, and recognizing when they are lying (packed or
hashed). Scope: analyze only samples you are authorized to handle, in an
isolated lab, during authorized DFIR or malware research.

## Quick Workflow

1. Extract strings with FLOSS (static, stack, decoded) into a file.
2. Hunt high-value patterns: URLs, IPs, mutexes, registry paths, PDB
   paths, script fragments.
3. List imports grouped by capability, not alphabetically.
4. Check import count and composition for packing or API hashing signs.
5. Read the combined narrative: do strings and imports agree?
6. Select YARA candidate strings and record IOCs with context.

## 1. FLOSS extraction

```bash
floss -n 8 sample.exe -o floss.txt

# Separate the decoded strings (often the interesting ones)
floss --only decoded-strings -n 8 sample.exe > decoded.txt
floss --only stack-strings -n 8 sample.exe > stack.txt

wc -l floss.txt decoded.txt stack.txt
```

Example output shape:

```text
floss.txt:   120 lines (static strings)
decoded.txt:  45 lines (XOR-decoded at runtime patterns)
stack.txt:   210 lines (built on the stack to dodge static view)
```

Stack and decoded strings are where malware hides its real IOCs; a
sample whose static strings are boring but whose stack strings contain
a C2 URL is deliberately hiding. Always check all three.

## 2. IOC pattern hunting

```bash
f=floss.txt
grep -iEo "https?://[^ \"']+" $f | sort -u > urls.txt
grep -iEo "[0-9]{1,3}(\.[0-9]{1,3}){3}(:[0-9]+)?" $f | sort -u > ips.txt
grep -iE "Global\\\\|Local\\\\" $f | sort -u > mutexes.txt
grep -iE "\\\\Run\\\\|RunOnce|CurrentVersion\\\\Run" $f | sort -u > persist.txt
grep -iE "\.pdb$" $f | sort -u > pdb.txt
grep -iE "powershell|cmd\.exe|wscript|cscript|mshta|rundll32" $f | sort -u > lolbins.txt
```

Example output shape:

```text
urls.txt:     http://beacon.example-cdn[.]net/api/v2/beacon
mutexes.txt:  Global\NimbusSyncMutex_7f3a
persist.txt:  Software\Microsoft\Windows\CurrentVersion\Run
pdb.txt:      Z:\Builds\ProjectNimbus\Release\loader.pdb
lolbins.txt:  powershell -enc
```

Each file becomes a report section. URLs and IPs are network IOCs;
mutexes are host IOCs and YARA strings; PDB paths are attribution
clues and superb YARA strings.

## 3. Import capability grouping

```bash
# Dump imports with a PE parser, then group manually or with a script
python3 - <<'EOF'
import pefile
pe = pefile.PE("sample.exe")
groups = {"process": [], "persist": [], "network": [], "crypto": [],
          "evasion": [], "other": []}
keywords = {
  "process": ["CreateProcess", "CreateRemoteThread", "WriteProcessMemory",
              "VirtualAlloc", "CreateThread", "OpenProcess"],
  "persist": ["RegSetValue", "CreateService", "schtasks"],
  "network": ["InternetOpen", "HttpSend", "WSAConnect", "getaddrinfo",
              "URLDownload"],
  "crypto": ["CryptEncrypt", "BCrypt", "CryptAcquireContext"],
  "evasion": ["IsDebuggerPresent", "CheckRemoteDebugger", "Sleep",
              "GetTickCount", "CPUID"],
}
for e in pe.DIRECTORY_ENTRY_IMPORT:
    for imp in e.imports:
        name = (imp.name or b"").decode(errors="replace")
        placed = False
        for g, kws in keywords.items():
            if any(k.lower() in name.lower() for k in kws):
                groups[g].append(f"{e.dll.decode(errors='replace')}!{name}")
                placed = True
                break
        if not placed:
            groups["other"].append(name)
for g, items in groups.items():
    print(f"== {g} ({len(items)})")
    for i in sorted(set(items))[:10]:
        print(f"   {i}")
EOF
```

Example output shape:

```text
== process (6)
   kernel32.dll!CreateRemoteThread
   kernel32.dll!WriteProcessMemory
== network (4)
   wininet.dll!HttpSendRequestA
== evasion (2)
   kernel32.dll!IsDebuggerPresent
```

Read the groups as capabilities: process plus network plus evasion is
an evasive loader with C2. Empty groups are also signal: no network
imports on a "downloader" means dynamic resolution.

## 4. Detecting hidden imports (API hashing)

Signs: tiny import table (LoadLibraryA, GetProcAddress only), strings
that look like hashes or hashed names, loops with rotate/XOR constants
near GetProcAddress calls.

```bash
# The classic tell
python3 -c "
import pefile
pe = pefile.PE('sample.exe')
n = sum(1 for e in pe.DIRECTORY_ENTRY_IMPORT for _ in e.imports)
print('total imports:', n)"
# total imports: 12  -> suspiciously small, likely API hashing
```

When imports are hashed, the strings view becomes more important (the
hash constants and any leftover names), and dynamic analysis becomes
necessary to see the real API set. Note it in the report: "imports
obfuscated via hashing; true capability set requires dynamic analysis".

## 5. The narrative check

Put strings and imports side by side and ask if they agree:

```text
Strings say:  C2 URL, Run key, powershell command
Imports say:  HttpSendRequest, RegSetValueEx, CreateProcess
Verdict:      AGREE -> persistent loader with C2, high confidence

Strings say:  C2 URL present
Imports say:  no network APIs at all
Verdict:      DISAGREE -> dynamic resolution or packing; do not
              verdict CLEAN, route to dynamic/unpacking
```

Agreement raises confidence; disagreement redirects the workflow. This
check takes two minutes and prevents the most common triage error:
verdicting on one view while the other contradicts it.

## Edge cases

- Unicode-only strings: FLOSS catches wide strings, but plain
  `strings` without -e l misses them; always use FLOSS or -el.
- Resource-only strings: dialogs and menus live in .rsrc; they are
  usually benign UI text, but malware sometimes hides config there.
- Delay-load imports: not in the main import table; check the delay
  import directory too.
- Bound imports and forwarded exports: names can mislead; verify the
  actual DLL when it matters.
- .NET assemblies: imports are method references in metadata, not IAT
  entries; use .NET-aware tooling.

## Escalation

- If strings contain credentials, victim data, or PII from a targeted
  intrusion, escalate handling per incident rules before wider sharing.
- If imports suggest kernel driver behavior (a .sys file or driver
  APIs in a .exe), escalate: driver analysis is a separate discipline.

- If strings reveal an active phishing lure or credential harvesting targeting your org, escalate to the SOC immediately.
- If import analysis shows driver-loading capability in a user-mode sample, escalate: the next stage may be a rootkit.

## Detection and defender view

Strings selected here become YARA rule content; imports grouped here
become capability claims in the report and Sigma rule ideas (a process
importing both WriteProcessMemory and HttpSendRequest is worth a hunt
query). Keep the IOC files (urls.txt, mutexes.txt) with the case; they
are the raw material for blocklists. When the same PDB path or mutex
pattern recurs across samples, that is a clustering signal for threat
intel.

## Key references

- Mandiant FLARE FLOSS:
  https://github.com/mandiant/flare-floss
- pefile documentation:
  https://github.com/erocarrera/pefile
- MITRE ATT&CK: T1027 (Obfuscated Files or Information)
- Practical Malware Analysis (Sikorski and Honig), Chapters 1-3
  (static analysis basics)

- binutils strings documentation:
  https://www.gnu.org/software/binutils/

