|
# Handala Threat Group - Atomic Red Team Chain Reaction |
|
# Run in order to simulate endpoint behaviors (initial access -> execution -> evasion -> discovery -> exfil -> impact). |
|
# Use with Invoke-AtomicRedTeam or Attack Range in a LAB only. |
|
# |
|
# Get Atomic Red Team: |
|
# git clone https://github.com/redcanaryco/atomic-red-team.git |
|
# Install-Module -Name Invoke-AtomicRedTeam -Scope CurrentUser |
|
# |
|
# Run full chain (PowerShell on Windows lab host): |
|
# Invoke-AtomicTest All -TestGuids (see test_guids below) -ShowDetailsBrief |
|
# Or run by technique: Invoke-AtomicTest T1059.003 -TestNumbers 1,2 |
|
# |
|
# Attack Range (if configured): |
|
# python attack_range.py simulate -e ART -te T1059.003 -t <windows_target> |
|
|
|
chain_name: Handala Endpoint Chain |
|
description: | |
|
Simulates Handala TTPs for detection validation: phishing-led execution, |
|
obfuscated batch/cmd, AutoIT, time-based evasion, victim info gathering, |
|
automated exfil pattern, and safe disk-wipe simulation. |
|
threat_group: Handala |
|
references: |
|
- https://www.splunk.com/en_us/blog/security/handalas-wiper-threat-analysis-and-detections.html |
|
- https://www.newsweek.com/stryker-cyber-attack-iran-handala-outage-11660284 |
|
- https://attack.mitre.org/groups/GXXXX/ |
|
|
|
# Ordered steps matching Handala attack flow |
|
steps: |
|
# --- Phase 1: Initial access (simulate user execution from phishing) --- |
|
- order: 1 |
|
phase: initial-access |
|
technique_id: T1566.001 |
|
technique_name: Phishing - Spearphishing Attachment |
|
art_tests: "Run 1-2 safe tests that simulate document/link leading to payload (see ART atomics)." |
|
run_commands: |
|
- "Invoke-AtomicTest T1566.001 -TestNumbers 1 -GetPrereqs # or 2 if available" |
|
detection_focus: Phishing / malicious doc or link leading to execution. |
|
|
|
# --- Phase 2: Execution - Command shell (NSIS -> cmd / copy & execute) --- |
|
- order: 2 |
|
phase: execution |
|
technique_id: T1059.003 |
|
technique_name: Windows Command Shell |
|
art_tests: "cmd.exe /c copy and execute; batch-style execution." |
|
run_commands: |
|
- "Invoke-AtomicTest T1059.003 -TestNumbers 1" |
|
- "Invoke-AtomicTest T1059.003 -TestNumbers 2" |
|
detection_focus: cmd.exe spawned from installer/script; copy then execute. |
|
|
|
# --- Phase 3: Execution - PowerShell (AI-assisted / scripting in campaigns) --- |
|
- order: 3 |
|
phase: execution |
|
technique_id: T1059.001 |
|
technique_name: PowerShell |
|
art_tests: "Encoded or script block execution." |
|
run_commands: |
|
- "Invoke-AtomicTest T1059.001 -TestNumbers 1" |
|
- "Invoke-AtomicTest T1059.001 -TestNumbers 2" |
|
detection_focus: PowerShell with -enc/-encodedcommand or suspicious parent. |
|
|
|
# --- Phase 4: Execution - AutoIT (wiper loader) --- |
|
- order: 4 |
|
phase: execution |
|
technique_id: T1059.010 |
|
technique_name: Command and Scripting Interpreter - AutoHotKey & AutoIT |
|
art_tests: "AutoIT3 execution." |
|
run_commands: |
|
- "Invoke-AtomicTest T1059.010 -TestNumbers 1" |
|
detection_focus: AutoIt3.exe or AutoIt*.exe execution; often from temp/public paths. |
|
|
|
# --- Phase 5: Defense evasion - Obfuscation --- |
|
- order: 5 |
|
phase: defense-evasion |
|
technique_id: T1027 |
|
technique_name: Obfuscated Files or Information |
|
art_tests: "Obfuscated script or encoded content (e.g. T1027.013)." |
|
run_commands: |
|
- "Invoke-AtomicTest T1027.013 -TestNumbers 1" |
|
detection_focus: Encoded/obfuscated scripts or binaries. |
|
|
|
# --- Phase 6: Defense evasion - Time-based (AV check + sleep) --- |
|
- order: 6 |
|
phase: defense-evasion |
|
technique_id: T1497.003 |
|
technique_name: Virtualization/Sandbox Evasion - Time Based Evasion |
|
art_tests: "Sleep/delay to evade sandbox." |
|
run_commands: |
|
- "Invoke-AtomicTest T1497.003 -TestNumbers 1" |
|
detection_focus: Long sleep/delay after process or script start. |
|
|
|
# --- Phase 7: Discovery - Gather victim info (IP, hostname, etc.) --- |
|
- order: 7 |
|
phase: discovery |
|
technique_id: T1590 |
|
technique_name: Gather Victim Information |
|
art_tests: "IP check or system info. Use T1016.001 (Internet connection discovery) or custom." |
|
run_commands: |
|
- "Invoke-AtomicTest T1016.001 -TestNumbers 1" |
|
detection_focus: DNS/HTTP to icanhazip.com, ipinfo.io, or similar; systeminfo/hostname. |
|
|
|
# --- Phase 8: Exfiltration - Automated (Telegram C2 pattern) --- |
|
- order: 8 |
|
phase: exfiltration |
|
technique_id: T1020 |
|
technique_name: Automated Exfiltration |
|
art_tests: "ART may have limited T1020 tests; simulate scheduled/automated data transfer." |
|
run_commands: |
|
- "Invoke-AtomicTest T1020 -TestNumbers 1" |
|
detection_focus: Automated or scripted outbound transfer of data. |
|
|
|
# --- Phase 9: Impact - Disk wipe (SAFE simulation only) --- |
|
- order: 9 |
|
phase: impact |
|
technique_id: T1561.002 |
|
technique_name: Disk Structure Wipe / Disk Content Wipe |
|
art_tests: "ART has no official T1561.002 test. Use custom safe atomic below." |
|
run_commands: |
|
- "Invoke-AtomicTest HANDALA-T1561.002-SAFE # custom atomic; see custom_atomic below" |
|
detection_focus: Raw disk access (Sysmon 9), or mass file overwrite/delete in a folder. |
|
warning: "Run ONLY in isolated lab. Custom atomic overwrites a single test file, not real disk." |
|
|
|
# Custom safe atomic for T1561.002 (no real wipe) |
|
# Deploy this to ART atomics folder or run inline in lab. |
|
custom_atomic: |
|
technique_id: T1561.002 |
|
display_name: "Handala-style disk overwrite (SAFE - single test file)" |
|
file: HANDALA-T1561.002-SAFE.yaml |
|
description: | |
|
Overwrites one file in %TEMP% with random bytes then deletes it. |
|
Validates detections for file overwrite/delete patterns and process behavior. |
|
Does NOT touch MBR, volume, or real data. |
|
executor: powershell |
|
command: | |
|
$f = "$env:TEMP\handala_wiper_test_$(Get-Random).dat" |
|
[System.IO.File]::WriteAllBytes($f, (New-Object byte[] 4096)) |
|
Start-Sleep -Seconds 1 |
|
Remove-Item $f -Force |
|
cleanup: "Remove-Item $env:TEMP\\handala_wiper_test_*.dat -Force -ErrorAction SilentlyContinue" |
|
|
|
# One-liner to run entire chain (PowerShell; run from lab host with ART installed) |
|
run_all_script: | |
|
# Handala chain - run each technique in order (adjust TestNumbers per your ART version) |
|
$techniques = @('T1566.001','T1059.003','T1059.001','T1059.010','T1027.013','T1497.003','T1016.001','T1020') |
|
foreach ($t in $techniques) { Invoke-AtomicTest $t -TestNumbers 1 } |
|
# Then run custom T1561.002 safe atomic if deployed |