|
| 1 | +# Detect web server exploitation by DoublePulsar |
| 2 | + |
| 3 | +This query was originally published in the threat analytics report, *Motivated miners*. |
| 4 | + |
| 5 | +[Doublepulsar](https://www.microsoft.com/en-us/wdsi/threats/malware-encyclopedia-description?Name=Trojan:Win32/DoublePulsar&threatId=-2147239036) is a backdoor developed by the National Security Agency (NSA). First [disclosed in 2017](https://www.scmagazine.com/home/security-news/cybercrime/doublepulsar-malware-spreading-rapidly-in-the-wild-following-shadow-brokers-dump/), it is now used by many malicious actors. Software [patches](https://support.microsoft.com/help/4013389/title) are available. |
| 6 | + |
| 7 | +The following query detects activity broadly associated with campaigns that use DoublePulsar to exploit web servers. |
| 8 | + |
| 9 | +See [Detect DoublePulsar execution](detect-doublepulsar-execution.md) for a query that detects possible DoublePulsar execution events. |
| 10 | + |
| 11 | +## Query |
| 12 | + |
| 13 | +```Kusto |
| 14 | +DeviceProcessEvents |
| 15 | +| where Timestamp >= ago(7d) |
| 16 | +| where |
| 17 | +// "Grandparent" process is Oracle WebLogic or some process loading Confluence |
| 18 | +InitiatingProcessParentFileName == "beasvc.exe" or |
| 19 | +InitiatingProcessFileName == "beasvc.exe" |
| 20 | +or InitiatingProcessCommandLine contains "//confluence" |
| 21 | +// Calculate for Base64 in Commandline |
| 22 | +| extend Caps = countof(ProcessCommandLine, "[A-Z]", "regex"), |
| 23 | +Total = countof(ProcessCommandLine, ".", "regex") |
| 24 | +| extend Ratio = todouble(Caps) / todouble(Total) |
| 25 | +| where |
| 26 | +( |
| 27 | + FileName in~ ("powershell.exe" , "powershell_ise.exe") // PowerShell is spawned |
| 28 | + // Omit known clean processes |
| 29 | + and ProcessCommandLine !startswith "POWERSHELL.EXE -C \"GET-WMIOBJECT -COMPUTERNAME" |
| 30 | + and ProcessCommandLine !contains "ApplicationNo" |
| 31 | + and ProcessCommandLine !contains "CustomerGroup" |
| 32 | + and ProcessCommandLine !contains "Cosmos" |
| 33 | + and ProcessCommandLine !contains "Unrestricted" |
| 34 | + and |
| 35 | + ( |
| 36 | + ProcessCommandLine contains "$" // PowerShell variable declaration |
| 37 | + or ProcessCommandLine contains "-e " // Alias for "-EncodedCommand" parameter |
| 38 | + or ProcessCommandLine contains "encodedcommand" |
| 39 | + or ProcessCommandLine contains "wget" |
| 40 | + //or ( Ratio > 0.4 and Ratio < 1.0) // Presence of Base64 strings |
| 41 | + ) |
| 42 | +) |
| 43 | +or |
| 44 | +( |
| 45 | + FileName =~ "cmd.exe" // cmd.exe is spawned |
| 46 | + and ProcessCommandLine contains "@echo" and |
| 47 | + ProcessCommandLine contains ">" // Echoing commands into a file |
| 48 | +) |
| 49 | +or |
| 50 | +( |
| 51 | + FileName =~ "certutil.exe" // CertUtil.exe abuse |
| 52 | + and ProcessCommandLine contains "-split" |
| 53 | + // the "-split" parameter is required to write files to the disk |
| 54 | +) |
| 55 | +| project |
| 56 | + Timestamp, |
| 57 | + InitiatingProcessCreationTime , |
| 58 | + DeviceId , |
| 59 | + Grandparent_PID = InitiatingProcessParentId, |
| 60 | + Grandparent = InitiatingProcessParentFileName, |
| 61 | + Parent_Account = InitiatingProcessAccountName, |
| 62 | + Parent_PID = InitiatingProcessId, |
| 63 | + Parent = InitiatingProcessFileName , |
| 64 | + Parent_Commandline = InitiatingProcessCommandLine, |
| 65 | + Child_PID = ProcessId, |
| 66 | + Child = FileName , |
| 67 | + Child_Commandline = ProcessCommandLine |
| 68 | +``` |
| 69 | + |
| 70 | +## Category |
| 71 | + |
| 72 | +This query can be used to detect the following attack techniques and tactics ([see MITRE ATT&CK framework](https://attack.mitre.org/)) or security configuration states. |
| 73 | + |
| 74 | +| Technique, tactic, or state | Covered? (v=yes) | Notes | |
| 75 | +|-|-|-| |
| 76 | +| Initial access | | | |
| 77 | +| Execution | v | | |
| 78 | +| Persistence | | | |
| 79 | +| Privilege escalation | | | |
| 80 | +| Defense evasion | | | |
| 81 | +| Credential Access | | | |
| 82 | +| Discovery | | | |
| 83 | +| Lateral movement | | | |
| 84 | +| Collection | | | |
| 85 | +| Command and control | | | |
| 86 | +| Exfiltration | | | |
| 87 | +| Impact | | | |
| 88 | +| Vulnerability | | | |
| 89 | +| Misconfiguration | | | |
| 90 | +| Malware, component | | | |
| 91 | + |
| 92 | +## Contributor info |
| 93 | + |
| 94 | +**Contributor:** Microsoft Threat Protection team |
0 commit comments