YARA · Google Cloud Threat Intelligence (GCTI)
GCTI_Cobaltstrike_Resources_Template__X32_X64_Ps1_V1_45_To_V2_5_And_V3_11_To_V3_14
Cobalt Strike's resources/template.x64.ps1, resources/template.x32 from v3.11 to v3.14 and resources/template.ps1 from v1.45 to v2.5
- Author
- gssincla@google.com
- Date
- 2022-11-18
- Modified
- 2022-11-19
- Score / Quality
- 75 / 85
What this rule detects
Cobalt Strike's resources/template.x64.ps1, resources/template.x32 from v3.11 to v3.14 and resources/template.ps1 from v1.45 to v2.5
Associated malware family: Cobalt Strike.
It defines 8 patterns (8 text, 0 hex, 0 regex).
Summary generated from the rule's metadata and condition.
Rule source
rule GCTI_Cobaltstrike_Resources_Template__X32_X64_Ps1_V1_45_To_V2_5_And_V3_11_To_V3_14
{
meta:
= "Cobalt Strike's resources/template.x64.ps1, resources/template.x32 from v3.11 to v3.14 and resources/template.ps1 from v1.45 to v2.5 "
= "gssincla@google.com"
= "c9fa6a39-0098-5dde-9762-94bc6b2df299"
= "2022-11-18"
= "2022-11-19"
= "https://cloud.google.com/blog/products/identity-security/making-cobalt-strike-harder-for-threat-actors-to-abuse"
= "https://github.com/chronicle/GCTI/blob/1c5fd42b1895098527fde00c2d9757edf6b303bb/YARA/CobaltStrike/CobaltStrike__Resources_Template__x32_x64_Ps1_v1_45_to_v2_5_and_v3_11_to_v3_14.yara#L17-L43"
= "https://github.com/chronicle/GCTI/blob/1c5fd42b1895098527fde00c2d9757edf6b303bb/LICENSE"
= "ff743027a6bcc0fee02107236c1f5c96362eeb91f3a5a2e520a85294741ded87"
= "5196f111f257239d2e7e4ca342e7fc8bac1687743bc8c7ff23addf1f094b2e93"
= 75
= 85
= ""
strings:
$importVA = "[DllImport(\"kernel32.dll\")] public static extern IntPtr VirtualAlloc" nocase
$importCT = "[DllImport(\"kernel32.dll\")] public static extern IntPtr CreateThread" nocase
$importWFSO = "[DllImport(\"kernel32.dll\")] public static extern int WaitForSingleObject" nocase
$compiler = "New-Object Microsoft.CSharp.CSharpCodeProvider" nocase
$params = "New-Object System.CodeDom.Compiler.CompilerParameters" nocase
$paramsSys32 = ".ReferencedAssemblies.AddRange(@(\"System.dll\", [PsObject].Assembly.Location))" nocase
$paramsGIM = ".GenerateInMemory = $True" nocase
$result = "$compiler.CompileAssemblyFromSource($params, $assembly)" nocase
condition:
all of them
}
Strings (8 patterns)
| Identifier | Type | Value | Modifiers |
|---|---|---|---|
| $importVA | text | "[DllImport(\"kernel32.dll\")] public static extern IntPtr VirtualAlloc" | nocase |
| $importCT | text | "[DllImport(\"kernel32.dll\")] public static extern IntPtr CreateThread" | nocase |
| $importWFSO | text | "[DllImport(\"kernel32.dll\")] public static extern int WaitForSingleObject" | nocase |
| $compiler | text | "New-Object Microsoft.CSharp.CSharpCodeProvider" | nocase |
| $params | text | "New-Object System.CodeDom.Compiler.CompilerParameters" | nocase |
| $paramsSys32 | text | ".ReferencedAssemblies.AddRange(@(\"System.dll\", [PsObject].Assembly.Location))" | nocase |
| $paramsGIM | text | ".GenerateInMemory = $True" | nocase |
| $result | text | "$compiler.CompileAssemblyFromSource($params, $assembly)" | nocase |
Condition
all of themIn plain words (Heuristic)
- All patterns in the rule must match.
Test this rule in your browser
Drop a file to scan it with this rule using YARA-X compiled to WebAssembly. Nothing is uploaded.
Sample hashes
Hashes of samples the author lists in the rule's meta (look them up in your threat-intelligence platform).
- ff743027a6bcc0fee02107236c1f5c96362eeb91f3a5a2e520a85294741ded87
Licence & attribution
Author: gssincla@google.com
Source repository: Google Cloud Threat Intelligence (GCTI) @ 1c5fd42b18
Licence: Apache License 2.0 (repository licence)
Mirrored via YARA Forge 20260927, which prefixes rule names with the source and adds normalised meta fields.
Rule id: c9fa6a39-0098-5dde-9762-94bc6b2df299
Related rules
- Hack toolGoogle Cloud Threat Intelligence (GCTI)· gssincla@google.com· 2022-11-18
- Hack toolGoogle Cloud Threat Intelligence (GCTI)· gssincla@google.com· 2022-11-18
- Hack toolGoogle Cloud Threat Intelligence (GCTI)· gssincla@google.com· 2022-11-18
- Hack toolGoogle Cloud Threat Intelligence (GCTI)· gssincla@google.com· 2022-11-18
- Hack toolGoogle Cloud Threat Intelligence (GCTI)· gssincla@google.com· 2022-11-18
- Hack toolGoogle Cloud Threat Intelligence (GCTI)· gssincla@google.com· 2022-11-18
- Hack toolGoogle Cloud Threat Intelligence (GCTI)· gssincla@google.com· 2022-11-18
- Hack toolGoogle Cloud Threat Intelligence (GCTI)· gssincla@google.com· 2022-11-18