|
| 1 | +[metadata] |
| 2 | +creation_date = "2025/04/26" |
| 3 | +integration = ["endpoint", "auditd_manager"] |
| 4 | +maturity = "production" |
| 5 | +updated_date = "2025/04/26" |
| 6 | + |
| 7 | +[rule] |
| 8 | +author = ["Elastic"] |
| 9 | +description = """ |
| 10 | +Identifies suspicious processes spawned from the SAP NetWeaver application. This may indicate an attempt to execute commands via webshell. |
| 11 | +""" |
| 12 | +from = "now-9m" |
| 13 | +index = ["auditbeat-*", "logs-endpoint.events.process*"] |
| 14 | +language = "eql" |
| 15 | +license = "Elastic License v2" |
| 16 | +name = "Potential SAP NetWeaver Exploitation" |
| 17 | +references = [ |
| 18 | + "https://reliaquest.com/blog/threat-spotlight-reliaquest-uncovers-vulnerability-behind-sap-netweaver-compromise/" |
| 19 | +] |
| 20 | +risk_score = 73 |
| 21 | +rule_id = "23c53c4c-aa8b-4b07-85c0-fe46a9c8acaf" |
| 22 | +severity = "high" |
| 23 | +tags = [ |
| 24 | + "Domain: Endpoint", |
| 25 | + "OS: Linux", |
| 26 | + "OS: Windows", |
| 27 | + "Use Case: Threat Detection", |
| 28 | + "Tactic: Execution", |
| 29 | + "Use Case: Vulnerability", |
| 30 | + "Data Source: Elastic Defend", |
| 31 | + "Data Source: Auditd Manager", |
| 32 | + "Resources: Investigation Guide", |
| 33 | +] |
| 34 | +type = "eql" |
| 35 | + |
| 36 | +query = ''' |
| 37 | +process where event.type == "start" and file where host.os.type in ("linux", "windows") and |
| 38 | + process.name : ("sh", |
| 39 | + "bash", |
| 40 | + "dash", |
| 41 | + "ksh", |
| 42 | + "tcsh", |
| 43 | + "zsh", |
| 44 | + "curl", |
| 45 | + "perl*", |
| 46 | + "python*", |
| 47 | + "ruby*", |
| 48 | + "php*", |
| 49 | + "wget", |
| 50 | + "cmd.exe", |
| 51 | + "powershell.exe", |
| 52 | + "rundll32.exe", |
| 53 | + "msbuild.exe", |
| 54 | + "curl.exe", |
| 55 | + "certutil.exe") and |
| 56 | + ( |
| 57 | + process.working_directory : ("/*/sap.com/*/servlet_jsp/irj/root/*", "*\\sap.com\\*\\servlet_jsp\\irj\\root\\*") or |
| 58 | + process.command_line : ("*/sap.com/*/servlet_jsp/irj/root/*", "*\\sap.com\\*\\servlet_jsp\\irj\\root\\*") or |
| 59 | + process.parent.command_line : ("*/sap.com/*/servlet_jsp/irj/root/*", "*\\sap.com\\*\\servlet_jsp\\irj\\root\\*") |
| 60 | + ) |
| 61 | +''' |
| 62 | +note = """## Triage and analysis |
| 63 | +
|
| 64 | +### Investigating Potential SAP NetWeaver Exploitation |
| 65 | +
|
| 66 | +### Possible investigation steps |
| 67 | +
|
| 68 | +- Examine the process tree to verify the parent-child relationship between the Java process and any suspicious child processes such as shell scripts or scripting languages (e.g., sh, bash, curl, python). |
| 69 | +- Check the command line arguments and environment variables of the suspicious child processes to identify any potentially malicious payloads or commands being executed. |
| 70 | +- Investigate the host's recent activity and logs for any other indicators of compromise or unusual behavior that might correlate with the suspected exploitation attempt. |
| 71 | +- Assess the system for any unauthorized changes or new files that may have been introduced as a result of the exploitation attempt, focusing on JSP files under the IRJ root directory. |
| 72 | +
|
| 73 | +
|
| 74 | +### Response and remediation |
| 75 | +
|
| 76 | +- Immediately isolate the affected host from the network to prevent further outbound connections and potential lateral movement. |
| 77 | +- Terminate any suspicious Java processes identified in the alert, especially those making outbound connections to LDAP, RMI, or DNS ports. |
| 78 | +- Conduct a thorough review of the affected system for any unauthorized changes or additional malicious processes, focusing on child processes like shell scripts or scripting languages. |
| 79 | +- Restore the affected system from a known good backup if unauthorized changes or malware are detected. |
| 80 | +- Update and patch Java and any related applications to the latest versions to mitigate known vulnerabilities. |
| 81 | +- Escalate the incident to the security operations center (SOC) or incident response team for further investigation and to assess the potential impact on other systems within the network.""" |
| 82 | + |
| 83 | + |
| 84 | +[[rule.threat]] |
| 85 | +framework = "MITRE ATT&CK" |
| 86 | +[[rule.threat.technique]] |
| 87 | +id = "T1059" |
| 88 | +name = "Command and Scripting Interpreter" |
| 89 | +reference = "https://attack.mitre.org/techniques/T1059/" |
| 90 | +[[rule.threat.technique.subtechnique]] |
| 91 | +id = "T1059.007" |
| 92 | +name = "JavaScript" |
| 93 | +reference = "https://attack.mitre.org/techniques/T1059/007/" |
| 94 | + |
| 95 | + |
| 96 | +[[rule.threat.technique]] |
| 97 | +id = "T1203" |
| 98 | +name = "Exploitation for Client Execution" |
| 99 | +reference = "https://attack.mitre.org/techniques/T1203/" |
| 100 | + |
| 101 | + |
| 102 | +[rule.threat.tactic] |
| 103 | +id = "TA0002" |
| 104 | +name = "Execution" |
| 105 | +reference = "https://attack.mitre.org/tactics/TA0002/" |
| 106 | + |
0 commit comments