| 
 | 1 | +# Confluence and WebLogic servers targeted by campaign  | 
 | 2 | + | 
 | 3 | +This query was originally published in the threat analytics report, *Confluence and WebLogic abuse*.  | 
 | 4 | + | 
 | 5 | +2019 has seen several seemingly related campaigns targeting Atlassian Confluence Server and Oracle WebLogic Server. Although these campaigns use different implants and delivery methods, they consistently use the same infrastructure, and exploit the same vulnerabilities.  | 
 | 6 | + | 
 | 7 | +The campaigns have specifically targeted:  | 
 | 8 | + | 
 | 9 | +* [CVE-2019-3396](https://nvd.nist.gov/vuln/detail/CVE-2019-3396) - [Software update](https://jira.atlassian.com/browse/CONFSERVER-57974)  | 
 | 10 | +* [CVE-2019-2725](https://nvd.nist.gov/vuln/detail/CVE-2019-2725) - [Software update](https://www.oracle.com/security-alerts/alert-cve-2019-2725.html)  | 
 | 11 | + | 
 | 12 | +The following query detects activity broadly associated with these campaigns.  | 
 | 13 | + | 
 | 14 | +## Query  | 
 | 15 | + | 
 | 16 | +```Kusto  | 
 | 17 | +DeviceProcessEvents  | 
 | 18 | +| where Timestamp >= ago(7d)  | 
 | 19 | +| where   | 
 | 20 | +// "Grandparent" process is Oracle WebLogic or some process loading Confluence  | 
 | 21 | +InitiatingProcessParentFileName == "beasvc.exe" or   | 
 | 22 | +InitiatingProcessFileName == "beasvc.exe"   | 
 | 23 | +or InitiatingProcessCommandLine contains "//confluence"  | 
 | 24 | +// Calculate for Base64 in Commandline  | 
 | 25 | +| extend Caps = countof(ProcessCommandLine, "[A-Z]", "regex"),   | 
 | 26 | +Total = countof(ProcessCommandLine, ".", "regex")  | 
 | 27 | +| extend Ratio = todouble(Caps) / todouble(Total)   | 
 | 28 | +| where  | 
 | 29 | +(  | 
 | 30 | +    FileName in~ ("powershell.exe" , "powershell_ise.exe") // PowerShell is spawned  | 
 | 31 | +    // Omit known clean processes  | 
 | 32 | +    and ProcessCommandLine !startswith "POWERSHELL.EXE  -C \"GET-WMIOBJECT -COMPUTERNAME"  | 
 | 33 | +    and ProcessCommandLine !contains "ApplicationNo"  | 
 | 34 | +    and ProcessCommandLine !contains "CustomerGroup"  | 
 | 35 | +    and ProcessCommandLine !contains "Cosmos"  | 
 | 36 | +    and ProcessCommandLine !contains "Unrestricted"  | 
 | 37 | +    and  | 
 | 38 | +    (  | 
 | 39 | +        ProcessCommandLine contains "$" // PowerShell variable declaration  | 
 | 40 | +        or ProcessCommandLine contains "-e " // Alias for "-EncodedCommand" parameter  | 
 | 41 | +        or ProcessCommandLine contains "encodedcommand"  | 
 | 42 | +        or ProcessCommandLine contains "wget"  | 
 | 43 | +        //or ( Ratio > 0.4 and Ratio < 1.0) // Presence of Base64 strings  | 
 | 44 | +    )  | 
 | 45 | +)  | 
 | 46 | +or  | 
 | 47 | +(  | 
 | 48 | +    FileName =~ "cmd.exe" // cmd.exe is spawned  | 
 | 49 | +    and ProcessCommandLine contains "@echo" and   | 
 | 50 | +    ProcessCommandLine contains ">" // Echoing commands into a file  | 
 | 51 | +)  | 
 | 52 | +or  | 
 | 53 | +(  | 
 | 54 | +    FileName =~ "certutil.exe" // CertUtil.exe abuse  | 
 | 55 | +    and ProcessCommandLine contains "-split"   | 
 | 56 | +    // the "-split" parameter is required to write files to the disk  | 
 | 57 | +)  | 
 | 58 | +| project  | 
 | 59 | +       Timestamp,  | 
 | 60 | +       InitiatingProcessCreationTime ,  | 
 | 61 | +       DeviceId ,  | 
 | 62 | +       Grandparent_PID = InitiatingProcessParentId,  | 
 | 63 | +       Grandparent = InitiatingProcessParentFileName,  | 
 | 64 | +       Parent_Account = InitiatingProcessAccountName,  | 
 | 65 | +       Parent_PID = InitiatingProcessId,  | 
 | 66 | +       Parent = InitiatingProcessFileName ,  | 
 | 67 | +       Parent_Commandline = InitiatingProcessCommandLine,  | 
 | 68 | +       Child_PID = ProcessId,  | 
 | 69 | +       Child = FileName ,  | 
 | 70 | +       Child_Commandline = ProcessCommandLine  | 
 | 71 | +```  | 
 | 72 | + | 
 | 73 | +## Category  | 
 | 74 | + | 
 | 75 | +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.  | 
 | 76 | + | 
 | 77 | +| Technique, tactic, or state | Covered? (v=yes) | Notes |  | 
 | 78 | +|-|-|-|  | 
 | 79 | +| Initial access |  |  |  | 
 | 80 | +| Execution |  |  |  | 
 | 81 | +| Persistence |  |  |  | 
 | 82 | +| Privilege escalation |  |  |  | 
 | 83 | +| Defense evasion |  |  |  | 
 | 84 | +| Credential Access |  |  |  | 
 | 85 | +| Discovery |  |  |  | 
 | 86 | +| Lateral movement |  |  |  | 
 | 87 | +| Collection |  |  |  | 
 | 88 | +| Command and control |  |  |  | 
 | 89 | +| Exfiltration |  |  |  | 
 | 90 | +| Impact |  |  |  | 
 | 91 | +| Vulnerability | v |  |  | 
 | 92 | +| Misconfiguration |  |  |  | 
 | 93 | +| Malware, component |  |  |  | 
 | 94 | + | 
 | 95 | +## Contributor info  | 
 | 96 | + | 
 | 97 | +**Contributor:** Microsoft Threat Protection team  | 
0 commit comments