Hunting Advanced Persistent Threats
Overview
Cybersecurity skill for hunting advanced persistent threats. Follows industry best practices and security standards.
When to Use
Trigger phrases:
- "hunting advanced persistent threats"
- "Conducting proactive threat hunting sprints (typically 2–4 week cycles) based on"
- "A UEBA alert or anomaly detection system flags behavioral deviations warranting"
- "A peer organization or ISAC sharing partner reports active APT compromise and yo"
Use this skill when:
- Conducting proactive threat hunting sprints (typically 2–4 week cycles) based on newly published APT intelligence
- A UEBA alert or anomaly detection system flags behavioral deviations warranting deeper investigation
- A peer organization or ISAC sharing partner reports active APT compromise and you need to validate your own exposure
Do not use this skill as a substitute for incident response when a confirmed breach is in progress — escalate to IR procedures (NIST SP 800-61).
When NOT to Use
- When you lack proper authorization for testing
- For production systems without change management
- When the task requires legal or compliance expertise beyond technical scope
Prerequisites
- EDR platform with telemetry retention (CrowdStrike Falcon, Microsoft Defender for Endpoint, or SentinelOne) covering 30+ days
- Access to MITRE ATT&CK Navigator for hypothesis development
- Network flow data (NetFlow, Zeek, or Suricata logs) in a queryable SIEM
- Threat hunting platform or query interface (Velociraptor, osquery fleet, or Splunk ES)
Workflow
# Example: IOC detection
import re
IOC_PATTERNS = {
"ip": r"\b(?:\d{1,3}\.){3}\d{1,3}\b",
"domain": r"\b[a-z0-9-]+\.[a-z]{2,}\b",
"hash_md5": r"\b[a-f0-9]{32}\b",
"hash_sha256": r"\b[a-f0-9]{64}\b",
}
def extract_iocs(text: str) -> dict:
return {k: re.findall(v, text) for k, v in IOC_PATTERNS.items()}
- Define Detection Scope — Identify the specific advanced persistent threats techniques or indicators to hunt. Map to MITRE ATT&CK tactics/techniques where applicable.
- Collect Baseline Data — Gather historical logs and establish normal behavior patterns for advanced persistent threats.
- Build Detection Queries — Write detection rules, Sigma rules, or SIEM queries targeting advanced persistent threats indicators.
- Execute Hunts — Run queries against the collected data, starting with broad filters and narrowing down.
- Triage Results — Investigate alerts, filter false positives, and validate findings against known-good behavior.
- Document Findings — Record confirmed detections, IOCs, and affected systems. Update detection rules based on findings.
Tools
- SIEM Platform — Central log aggregation and query execution
- Sigma Rules — Vendor-agnostic detection rule format
- MITRE ATT&CK Navigator — Technique mapping and coverage analysis
Process
- Reconnaissance — Gather target information, identify attack surface, enumerate services
- Analysis/Exploitation — Execute the technique, analyze results, document findings
- Reporting — Document IOCs, write findings, provide remediation recommendations
Verification
Anti-Rationalization Table
| Rationalization |
Reality |
| "We are too small to be targeted" |
Automated attacks target everyone. Size does not matter. |
| "Security slows us down" |
A breach slows you down 100x more. Build security in from the start. |
| "We will fix it after launch" |
Vulnerabilities in production are exploited within hours. Fix before deploy. |
1---2name: hunting-advanced-persistent-threats3description: 'Use when proactively hunts for Advanced Persistent Threat (APT) activity4 within enterprise environments using hypothesis-driven searches across endpoint5 telemetry, network logs, and memory artifacts. Use when conducting scheduled threat6 hunting cycles, investigating anomalous behavior flagged by UEBA, or validating7 that known APT TTPs are not present in the environment. Activates for requests involving8 MITRE ATT&CK, Velociraptor, osquery, Zeek, or threat hunting playbooks.910 '11domain: cybersecurity12tags:13- MITRE-ATT&CK14- threat-hunting15- APT16- Velociraptor17- osquery18- Zeek19- TTP20- NIST-CSF21- EDR22subdomain: threat-intelligence23version: 1.0.024author: oyi7725license: Apache-2.026d3fend_techniques:27- File Metadata Consistency Validation28- Application Protocol Command Analysis29- Identifier Analysis30- Content Format Conversion31- Message Analysis32nist_csf:33- ID.RA-0134- ID.RA-0535- DE.CM-0136- DE.AE-0237category: cybersecurity38metadata:39 source: https://skillmd.com/skills/oyi77/hunting-advanced-persistent-threats40---4142# Hunting Advanced Persistent Threats4344## Overview4546Cybersecurity skill for hunting advanced persistent threats. Follows industry best practices and security standards.4748## When to Use4950**Trigger phrases:**51- "hunting advanced persistent threats"52- "Conducting proactive threat hunting sprints (typically 2–4 week cycles) based on"53- "A UEBA alert or anomaly detection system flags behavioral deviations warranting"54- "A peer organization or ISAC sharing partner reports active APT compromise and yo"555657Use this skill when:58- Conducting proactive threat hunting sprints (typically 2–4 week cycles) based on newly published APT intelligence59- A UEBA alert or anomaly detection system flags behavioral deviations warranting deeper investigation60- A peer organization or ISAC sharing partner reports active APT compromise and you need to validate your own exposure6162**Do not use** this skill as a substitute for incident response when a confirmed breach is in progress — escalate to IR procedures (NIST SP 800-61).636465## When NOT to Use6667- When you lack proper authorization for testing68- For production systems without change management69- When the task requires legal or compliance expertise beyond technical scope707172## Prerequisites7374- EDR platform with telemetry retention (CrowdStrike Falcon, Microsoft Defender for Endpoint, or SentinelOne) covering 30+ days75- Access to MITRE ATT&CK Navigator for hypothesis development76- Network flow data (NetFlow, Zeek, or Suricata logs) in a queryable SIEM77- Threat hunting platform or query interface (Velociraptor, osquery fleet, or Splunk ES)7879## Workflow8081```python82# Example: IOC detection83import re8485IOC_PATTERNS = {86 "ip": r"\b(?:\d{1,3}\.){3}\d{1,3}\b",87 "domain": r"\b[a-z0-9-]+\.[a-z]{2,}\b",88 "hash_md5": r"\b[a-f0-9]{32}\b",89 "hash_sha256": r"\b[a-f0-9]{64}\b",90}9192def extract_iocs(text: str) -> dict:93 return {k: re.findall(v, text) for k, v in IOC_PATTERNS.items()}94```95961. **Define Detection Scope** — Identify the specific advanced persistent threats techniques or indicators to hunt. Map to MITRE ATT&CK tactics/techniques where applicable.972. **Collect Baseline Data** — Gather historical logs and establish normal behavior patterns for advanced persistent threats.983. **Build Detection Queries** — Write detection rules, Sigma rules, or SIEM queries targeting advanced persistent threats indicators.994. **Execute Hunts** — Run queries against the collected data, starting with broad filters and narrowing down.1005. **Triage Results** — Investigate alerts, filter false positives, and validate findings against known-good behavior.1016. **Document Findings** — Record confirmed detections, IOCs, and affected systems. Update detection rules based on findings.102103## Tools104105- **SIEM Platform** — Central log aggregation and query execution106- **Sigma Rules** — Vendor-agnostic detection rule format107- **MITRE ATT&CK Navigator** — Technique mapping and coverage analysis108109110## Process1111121. **Reconnaissance** — Gather target information, identify attack surface, enumerate services1131. **Analysis/Exploitation** — Execute the technique, analyze results, document findings1141. **Reporting** — Document IOCs, write findings, provide remediation recommendations115116## Verification117118- [ ] All advanced persistent threats procedures executed completely and documented119- [ ] Findings validated against multiple data sources120- [ ] False positives identified and filtered121- [ ] Results documented with evidence and timestamps122- [ ] Recommendations provided with risk-based prioritization123124## Anti-Rationalization Table125126| Rationalization | Reality |127|---|---|128| "We are too small to be targeted" | Automated attacks target everyone. Size does not matter. |129| "Security slows us down" | A breach slows you down 100x more. Build security in from the start. |130| "We will fix it after launch" | Vulnerabilities in production are exploited within hours. Fix before deploy. |