Skip to content

Commit f48721b

Browse files
committed
1 parent 97e6d8b commit f48721b

File tree

2 files changed

+190
-0
lines changed

2 files changed

+190
-0
lines changed
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
[metadata]
2+
creation_date = "2025/04/26"
3+
integration = ["endpoint"]
4+
maturity = "production"
5+
updated_date = "2025/04/26"
6+
7+
[rule]
8+
author = ["Elastic"]
9+
description = """
10+
Identifies suspicious JSP file creation in the root directory of the SAP NetWeaver application. This may indicate an attempt to deploy a 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 WebShell Creation"
17+
references = [
18+
"https://reliaquest.com/blog/threat-spotlight-reliaquest-uncovers-vulnerability-behind-sap-netweaver-compromise/"
19+
]
20+
risk_score = 73
21+
rule_id = "f7d588ba-e4b0-442e-879d-7ec39fbd69c5"
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+
"Resources: Investigation Guide",
32+
]
33+
type = "eql"
34+
35+
query = '''
36+
file where host.os.type in ("linux", "windows") and event.action == "creation" and
37+
file.extension : "jsp" and file.path : ("/*/sap.com/*/servlet_jsp/irj/root/*.jsp", "?:\\*\\sap.com\\*\\servlet_jsp\\irj\\root\\*.jsp")
38+
'''
39+
note = """## Triage and analysis
40+
41+
### Investigating Potential SAP NetWeaver WebShell Creation
42+
43+
### Possible investigation steps
44+
45+
- Examine the file creation event and the associated HTTP post request logs details to identify the source of the creation.
46+
- 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).
47+
- Check the command line arguments and environment variables of the suspicious child processes to identify any potentially malicious payloads or commands being executed.
48+
- 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.
49+
- 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.
50+
51+
52+
### Response and remediation
53+
54+
- Immediately isolate the affected host from the network to prevent further outbound connections and potential lateral movement.
55+
- Terminate any suspicious Java processes identified in the alert, especially those making outbound connections to LDAP, RMI, or DNS ports.
56+
- 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.
57+
- Restore the affected system from a known good backup if unauthorized changes or malware are detected.
58+
- Update and patch Java and any related applications to the latest versions to mitigate known vulnerabilities.
59+
- 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."""
60+
61+
62+
[[rule.threat]]
63+
framework = "MITRE ATT&CK"
64+
[[rule.threat.technique]]
65+
id = "T1059"
66+
name = "Command and Scripting Interpreter"
67+
reference = "https://attack.mitre.org/techniques/T1059/"
68+
[[rule.threat.technique.subtechnique]]
69+
id = "T1059.007"
70+
name = "JavaScript"
71+
reference = "https://attack.mitre.org/techniques/T1059/007/"
72+
73+
74+
[[rule.threat.technique]]
75+
id = "T1203"
76+
name = "Exploitation for Client Execution"
77+
reference = "https://attack.mitre.org/techniques/T1203/"
78+
79+
80+
[rule.threat.tactic]
81+
id = "TA0002"
82+
name = "Execution"
83+
reference = "https://attack.mitre.org/tactics/TA0002/"
84+
Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
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

Comments
 (0)