Indicators of Compromise (IOCs) are the digital fingerprints of attacks. Security analysts use them to detect compromises, investigate incidents, and hunt for threats proactively. This guide covers everything from IOC fundamentals to advanced threat hunting techniques.
What Are Indicators of Compromise?
π What Are Indicators of Compromise?: Understanding IOC fundamentals.
An IOC is digital evidence suggesting a system has been compromisedβspecific artifacts, patterns, or signatures that indicate an attack.
IOC Types
| Type | Examples | Use Case |
|---|---|---|
| Network | IPs, domains, URLs | Block at firewall, DNS sinkhole |
| File | Hashes, filenames, paths | Endpoint detection, AV signatures |
| Host | Registry keys, processes, services | Forensic analysis, endpoint hunting |
| Addresses, subjects, headers | Phishing detection, email blocking | |
| Behavioral | TTPs, patterns, sequences | Advanced detection rules |
IOC Examples by Attack Phase
Initial Access:
- Phishing email addresses
- Malicious attachment hashes
- Weaponized document filenames
Command & Control:
- C2 server IP addresses
- C2 domains
- Callback URLs
- Beacon intervals
Persistence:
- Registry key modifications
- Scheduled task names
- Service names
- Startup folder files
Exfiltration:
- Data staging directories
- Compression tool hashes
- Upload destination IPs
IOC Extraction
π How to Extract IOCs from Text: Practical extraction methods.
Extraction Sources
- Threat intelligence reports
- Security logs and alerts
- Incident response findings
- Malware analysis reports
- Vulnerability disclosures
- Community sharing platforms
Extraction Methods
Manual Extraction
- Careful reading and pattern identification
- Works for small datasets
- Time-consuming but thorough
Regular Expressions
# IPv4 addresses
\b(?:\d{1,3}\.){3}\d{1,3}\b
# Domains
([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}
# SHA256 hashes
\b[A-Fa-f0-9]{64}\b
Automated Tools
- Dedicated IOC extractors
- SIEM integrations
- Custom Python scripts
- Browser extensions
Extraction Best Practices
- Understand context - Not every IP address is malicious
- Normalize format - Lowercase domains, consistent hash format
- Deduplicate - Remove repeated indicators
- Document sources - Track where each IOC originated
IOC Validation
π How to Validate Extracted IOCs: Ensuring IOC quality.
Invalid IOCs waste time and generate false positives. Validate before using.
Format Validation
| IOC Type | Validation Checks |
|---|---|
| IPv4 | Four octets, 0-255 range each |
| IPv6 | Valid hex, proper colon placement |
| Domain | Valid TLD, DNS-compliant format |
| MD5 | Exactly 32 hex characters |
| SHA256 | Exactly 64 hex characters |
| URL | Valid protocol, proper syntax |
Semantic Validation
- Filter private IP ranges (10.x, 172.16.x, 192.168.x)
- Exclude reserved ranges (127.x, 0.x)
- Check against whitelists (CDNs, cloud providers)
- Verify against threat intelligence feeds
- Check IOC age and relevance
False Positive Prevention
π What Are IOC False Positives?: Reducing false alarms.
Common false positives:
- Version numbers extracted as IPs
- Legitimate cloud IPs
- Documentation examples
- Internal infrastructure
IOC Defanging
π What Are Defanged IOCs?: Safe IOC sharing.
Defanging modifies IOCs to prevent accidental activation while preserving information.
Why Defang?
- Prevent accidental clicks on malicious URLs
- Safe sharing in public forums
- Bypass email security filters
- Legal and ethical protection
- Legacy practice for safe handling
Common Defanging Techniques
| Original | Defanged |
|---|---|
http:// | hxxp:// or hxxps:// |
.com | [.]com |
@ | [at] |
192.168.1.1 | 192[.]168[.]1[.]1 |
π URL Defanging Styles Explained: Different defanging conventions.
Refanging
π URL Refanging: When and How: Converting back to operational IOCs.
Reverse defanging when you need functional IOCs for:
- Firewall rule creation
- SIEM query building
- Threat intelligence platform ingestion
IOC Sharing and Formats
π What IOC Formats Are Supported?: Common IOC formats.
π How to Share IOCs Securely: Safe sharing practices.
Standard Formats
| Format | Description | Use Case |
|---|---|---|
| STIX | Structured Threat Information eXpression | Industry standard |
| TAXII | Trusted Automated eXchange | Transport protocol |
| OpenIOC | Open Indicators of Compromise | Forensic focus |
| CSV | Simple comma-separated | Quick sharing |
| JSON | Structured data | API integration |
Sharing Platforms
- ISACs (Information Sharing and Analysis Centers)
- MISP (Malware Information Sharing Platform)
- AlienVault OTX
- VirusTotal
- Abuse.ch
Threat Hunting with IOCs
π How to Use IOCs for Threat Hunting: Proactive threat detection.
The Hunt Process
- Hypothesis - "Systems may have connected to this C2 IP"
- Data Collection - Gather relevant logs
- Search - Query for IOC presence
- Analysis - Investigate matches
- Response - Contain and remediate
- Document - Record findings and improve
Data Sources for Hunting
| Source | IOC Types | Value |
|---|---|---|
| DNS logs | Domains, subdomains | Early detection |
| Proxy logs | URLs, domains | User attribution |
| Firewall logs | IPs, ports | Network connections |
| Endpoint logs | Hashes, processes, paths | Host activity |
| Email logs | Addresses, subjects | Phishing detection |
| NetFlow | IPs, ports, volumes | Network patterns |
Hunt Queries
SIEM Example (Splunk):
index=proxy (url="*malicious-domain.com*" OR url="*evil-site.net*")
| stats count by src_ip, user
EDR Example:
process.hash:"abc123def456..."
OR
network.destination.ip:"203.0.113.45"
MITRE ATT&CK Integration
π What Is MITRE ATT&CK?: The threat framework.
π How to Use ATT&CK for Threat Hunting: Framework-based hunting.
ATT&CK provides context for IOCs:
- Map IOCs to techniques
- Understand adversary behavior
- Identify detection gaps
- Prioritize hunting hypotheses
Tools and Resources
| Tool | Purpose |
|---|---|
| IOC Extractor | Extract IOCs from text |
| URL Defanger | Defang URLs safely |
| Hash Lookup | Check file hash reputation |
| DNS Lookup | Investigate domain IOCs |
| WHOIS Lookup | Research domain registration |
IOC Lifecycle Management
Collection
- Threat feeds
- Incident response
- Malware analysis
- Community sharing
- Internal detection
Enrichment
- Add context and metadata
- Cross-reference sources
- Validate and verify
- Assign confidence scores
- Tag with ATT&CK techniques
Distribution
- SIEM rules
- Firewall blocklists
- Email gateway rules
- Endpoint detection
- DNS sinkholing
Retirement
- Age out old IOCs
- Remove false positives
- Update based on new intelligence
- Archive for historical reference
Best Practices
For IOC Collection
- Diversify sources - Multiple feeds reduce blind spots
- Validate immediately - Catch errors early
- Add context - IOCs without context have limited value
- Track provenance - Know where IOCs originated
For Threat Hunting
- Start with hypotheses - Don't just search randomly
- Understand your data - Know what logs you have
- Document everything - Findings, dead ends, improvements
- Iterate and improve - Each hunt informs the next
For IOC Sharing
- Defang appropriately - Prevent accidental activation
- Include context - What, when, confidence
- Use standard formats - Enable automation
- Respect TLP - Traffic Light Protocol for sensitivity
Conclusion
Indicators of Compromise are essential for modern security operations:
- Understand IOC types - Network, file, host, behavioral
- Extract carefully - Automate but validate
- Defang for safety - Prevent accidental activation
- Hunt proactively - Don't wait for alerts
- Share responsibly - Improve collective defense
IOCs are most valuable when combined with context, validated thoroughly, and acted upon quickly. Build workflows that turn raw indicators into actionable intelligence, and use them to hunt for threats before they cause damage.
The best IOC is one that helps you find a threat before it finds you.

