Threat Hunting¶
Proactive searching for threats in your environment.
Scenario¶
You've received threat intelligence about a new campaign targeting organizations in your industry. Time to hunt for indicators in your environment.
Step 1: Gather Intelligence¶
Start with the IOCs from the threat report:
# Create hunting case
bsot case new threat-hunt-campaign-x --type apt
# Add IOC list as artifact
bsot case add campaign_iocs.txt
Step 2: Enrich IOCs¶
Validate and enrich the threat intel:
Sample Output
Step 3: Search Logs¶
Check authentication logs for suspicious activity:
# Analyze auth logs for known IOCs
bsot logs analyze -f /var/log/auth.log --checks brute_force,anomaly
Search for specific IPs:
Step 4: Network Analysis¶
Check DNS logs for domain IOCs:
Step 5: File System Checks¶
Search for IOC file hashes:
# Hash all executables in suspected directory
bsot file hash /tmp/*.exe -r --json | \
jq '.[] | select(.sha256 == "known_bad_hash")'
Step 6: Process Analysis¶
Check for suspicious processes:
Check network connections:
Step 7: Document Findings¶
bsot case note "No hits for campaign IOCs in authentication logs"
bsot case note "DNS logs clean - no queries to known C2 domains"
bsot case note "No matching file hashes found on sampled systems"
Step 8: Report¶
Generate hunt report:
Hunting Queries Reference¶
By IOC Type¶
# IP addresses
bsot intel enrich <ip>
# Domains
bsot intel whois <domain>
bsot network dns <domain>
# File hashes
bsot malware submit <file> --no-upload
# URLs
bsot intel defang <url> # For safe documentation
Log Hunting¶
# Failed logins
bsot logs analyze -f auth.log --checks brute_force
# All attack patterns
bsot logs analyze -f auth.log
# Statistics
bsot logs stats -f access.log --top-ips 50
File Hunting¶
# Hash directory
bsot file hash /path/to/check -r --json
# Check entropy (packed files)
bsot file entropy suspicious.exe
# Find executables with PDF extension
bsot file identify *.pdf
Automation¶
Bulk IOC Check Script¶
#!/bin/bash
# hunt.sh - Check IOCs against multiple sources
IOC_FILE=$1
echo "=== Enriching IOCs ==="
bsot intel bulk -f $IOC_FILE --json -o enriched.json
echo "=== Checking Malicious ==="
jq '.[] | select(.verdict == "malicious")' enriched.json
echo "=== Generating Report ==="
bsot report generate --template ioc