Create Data Tables First.
unc6508_iocs
indicator,type,notes
23.169.65.49,ip,admin_login_source_compromised_asus_router
BebitaBarefoot774@gmail.com,email,exfiltration_account_silent_bcc_forwarding
infinitered_iocs
sha256,malware_role
ba6b73b0ca0dc7f86b3b397893ac32d729fd53f9df20643288f141f29d020af7,web_shell_help_php
db65c1b9f9e4cb4d729f45ad4b6fcf3e277caf9eb4c875425dec93fd883f9136,credential_harvester
c1ac43d23f89d41eb4ff131678ab562ab2cfed9aa334b13767ef141d303b0e5b,credential_harvester
8f0158855a656b629ca76ebca565f18bc25563ded34b65d6771632c20edb68ec,backdoor
51a57bfc9ed3eb6451c1c289607814d59e1698c666fb97ac5f694c398f23d045,backdoor
4efbef69eb3b09bacff892d6a55778d07c418e7f15eba3cf1245e8cdfd8dda0b,dropper
58bb25777e0aa86bcd2125101e0bca4e8732b03d91bd8d2f205b446a2a8d5c86,dropper
// 1. Known INFINITERED / UNC6508 file hashes
// Data table required: infinitered_iocs (column: sha256, type STRING)
// Join makes this a multi-event rule -> match section required.
// =====================================================================
rule unc6508_infinitered_file_hashes {
meta:
author = "David Nehoda"
description = "Detects known INFINITERED malware file hashes (UNC6508, PRC-nexus) on or transiting hosts"
reference = "https://cloud.google.com/blog/topics/threat-intelligence/prc-targets-us-medical-research"
malware = "INFINITERED"
threat_actor = "UNC6508"
mitre_attack = "T1505.003,T1554"
severity = "CRITICAL"
priority = "HIGH"
events:
(
$e.target.file.sha256 = $sha256 or
$e.principal.process.file.sha256 = $sha256 or
$e.src.file.sha256 = $sha256
)
// data-table join (own line, AND-ed at top level)
$sha256 = %infinitered_iocs.sha256
match:
$sha256 over 5m
condition:
$e
}
// =====================================================================
// 2. help.php web shell access / drop on a REDCap server
// =====================================================================
rule unc6508_redcap_webshell_help_php {
meta:
author = "David Nehoda"
description = "Detects access to or creation of the INFINITERED help.php web shell"
reference = "https://cloud.google.com/blog/topics/threat-intelligence/prc-targets-us-medical-research"
threat_actor = "UNC6508"
mitre_attack = "T1190,T1505.003"
severity = "HIGH"
priority = "HIGH"
events:
(
// network access to the web shell
($e.metadata.event_type = "NETWORK_HTTP" and
re.regex($e.target.url, `/help\.php(\?|$)`)) or
// dropped on disk somewhere under a redcap path
($e.metadata.event_type = "FILE_CREATION" and
re.regex($e.target.file.full_path, `(?i)redcap.*/help\.php$`)) or
// strongest signal: the shell's known hash
$e.target.file.sha256 = "ba6b73b0ca0dc7f86b3b397893ac32d729fd53f9df20643288f141f29d020af7"
)
condition:
$e
}
// =====================================================================
// 3. INFINITERED C2 / credential-harvester magic strings over HTTP
// Requires HTTP logs that capture URI/cookie/body (WAF, proxy, EDR).
// =====================================================================
rule unc6508_infinitered_c2_magic_strings {
meta:
author = "David Nehoda"
description = "Detects INFINITERED backdoor magic strings, REDCAP-TOKEN C2 cookie, GUID upgrade-intercept marker, and stolen-credential session prefix"
reference = "https://cloud.google.com/blog/topics/threat-intelligence/prc-targets-us-medical-research"
malware = "INFINITERED"
threat_actor = "UNC6508"
mitre_attack = "T1071.001,T1056.003"
severity = "CRITICAL"
priority = "HIGH"
events:
$e.metadata.event_type = "NETWORK_HTTP"
(
// backdoor file-download magic flag
re.regex($e.target.url, `ej671a16i7fd8202nu6ltfg5p6x7u`) or
// upgrade-interception GUID delimiter
re.regex($e.target.url, `b49e334d-9c01-463e-9bc5-00a6920fb66e`) or
// stolen-credential session prefix
re.regex($e.target.url, `xc32038474a`) or
// C2 cookie name (if cookie/header captured into UDM)
re.regex($e.network.http.user_agent, `REDCAP-TOKEN`) or
re.regex($e.target.url, `REDCAP-TOKEN`)
)
condition:
$e
}
// =====================================================================
// 4. UNC6508 network IOCs — exfil Gmail + compromised-router login IP
// Data table required: unc6508_iocs (column: indicator, type STRING)
// rows hold both the IP (23.169.65.49) and the email
// (BebitaBarefoot774@gmail.com); IP rows simply never match email
// fields and vice-versa.
// Join makes this a multi-event rule -> match section required.
// =====================================================================
rule unc6508_network_iocs {
meta:
author = "David Nehoda"
description = "Detects UNC6508 attacker email (exfil account) and known login source IP (compromised ASUS router)"
reference = "https://cloud.google.com/blog/topics/threat-intelligence/prc-targets-us-medical-research"
threat_actor = "UNC6508"
mitre_attack = "T1567,T1090.003"
severity = "HIGH"
priority = "HIGH"
events:
(
$e.principal.ip = $ioc or
$e.target.ip = $ioc or
$e.src.ip = $ioc or
$e.network.email.to = $ioc or
$e.network.email.from = $ioc or
$e.about.user.email_addresses = $ioc
)
// data-table join (own line, AND-ed at top level)
$ioc = %unc6508_iocs.indicator
match:
$ioc over 5m
condition:
$e
}
// =====================================================================
// 5. Google Workspace silent email-forwarding / content-compliance abuse
// (the "Patroit" rule technique used to BCC-exfiltrate mail)
// NOTE: Workspace admin-audit field mapping varies by tenant.
// Tune product_event_type and recipient fields to your schema.
// =====================================================================
rule unc6508_workspace_silent_forwarding_abuse {
meta:
author = "David Nehoda"
description = "Detects creation/modification of Workspace content-compliance or forwarding rules pointing at an external Gmail (UNC6508 email-exfil TTP)"
reference = "https://cloud.google.com/blog/topics/threat-intelligence/prc-targets-us-medical-research"
threat_actor = "UNC6508"
mitre_attack = "T1114.003,T1562.001,T1567"
severity = "HIGH"
priority = "HIGH"
events:
re.regex($e.metadata.product_name, `(?i)workspace|gsuite|google`)
(
re.regex($e.metadata.product_event_type, `(?i)compliance|content_compliance|email_setting|forwarding|routing`) or
re.regex($e.security_result.summary, `(?i)compliance|forwarding`)
)
(
// external Gmail recipient, or the exact known exfil address
//re.regex($e.target.resource.name, `(?i)@gmail\.com`) or
//re.regex($e.security_result.detection_fields.value, `(?i)@gmail\.com`) or
$e.target.user.email_addresses in %unc6508_iocs.indicator
//re.regex($e.metadata.description, `(?i)BebitaBarefoot774@gmail\.com|Patroit`)
)
condition:
$e
}