-
Notifications
You must be signed in to change notification settings - Fork 570
[New] Potential SAP NetWeaver Exploitation rules #4666
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Samirbous
wants to merge
7
commits into
main
Choose a base branch
from
SAP-NV
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 5 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
f48721b
[New] Potential SAP NetWeaver Exploitation
Samirbous 426e0d6
++
Samirbous 9c39262
Update execution_sap_netweaver_jsp_webshell.toml
Samirbous 69c1fc8
Update execution_sap_netweaver_webshell_exec.toml
Samirbous f49db08
Merge branch 'main' into SAP-NV
shashank-elastic 5b1011b
Merge branch 'main' into SAP-NV
DefSecSentinel 01d36bb
Update rules/cross-platform/execution_sap_netweaver_webshell_exec.toml
Samirbous File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
89 changes: 89 additions & 0 deletions
89
rules/cross-platform/execution_sap_netweaver_jsp_webshell.toml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
[metadata] | ||
creation_date = "2025/04/26" | ||
integration = ["endpoint"] | ||
maturity = "production" | ||
updated_date = "2025/04/26" | ||
|
||
[rule] | ||
author = ["Elastic"] | ||
description = """ | ||
Identifies suspicious Java file creation in the IRJ directory of the SAP NetWeaver application. This may indicate an attempt to deploy a webshell. | ||
""" | ||
from = "now-9m" | ||
index = ["auditbeat-*", "logs-endpoint.events.process*"] | ||
language = "eql" | ||
license = "Elastic License v2" | ||
name = "Potential SAP NetWeaver WebShell Creation" | ||
references = [ | ||
"https://reliaquest.com/blog/threat-spotlight-reliaquest-uncovers-vulnerability-behind-sap-netweaver-compromise/", | ||
"https://onapsis.com/blog/active-exploitation-of-sap-vulnerability-cve-2025-31324/" | ||
] | ||
risk_score = 73 | ||
rule_id = "f7d588ba-e4b0-442e-879d-7ec39fbd69c5" | ||
severity = "high" | ||
tags = [ | ||
"Domain: Endpoint", | ||
"OS: Linux", | ||
"OS: Windows", | ||
"Use Case: Threat Detection", | ||
"Tactic: Execution", | ||
"Use Case: Vulnerability", | ||
"Data Source: Elastic Defend", | ||
"Resources: Investigation Guide", | ||
] | ||
type = "eql" | ||
|
||
query = ''' | ||
file where host.os.type in ("linux", "windows") and event.action == "creation" and | ||
file.extension : ("jsp", "java", "class") and | ||
file.path : ("/*/sap.com/*/servlet_jsp/irj/root/*", | ||
"/*/sap.com/*/servlet_jsp/irj/work/*", | ||
"?:\\*\\sap.com\\*\\servlet_jsp\\irj\\root\\*", | ||
"?:\\*\\sap.com\\*\\servlet_jsp\\irj\\work\\*") | ||
''' | ||
note = """## Triage and analysis | ||
|
||
### Investigating Potential SAP NetWeaver WebShell Creation | ||
|
||
### Possible investigation steps | ||
|
||
- Examine the file creation event and the associated HTTP post request logs details to identify the source of the creation. | ||
- 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). | ||
- Check the command line arguments and environment variables of the suspicious child processes to identify any potentially malicious payloads or commands being executed. | ||
- 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. | ||
- 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. | ||
|
||
|
||
### Response and remediation | ||
|
||
- Immediately isolate the affected host from the network to prevent further outbound connections and potential lateral movement. | ||
- Terminate any suspicious Java processes identified in the alert, especially those making outbound connections to LDAP, RMI, or DNS ports. | ||
- 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. | ||
- Restore the affected system from a known good backup if unauthorized changes or malware are detected. | ||
- Update and patch Java and any related applications to the latest versions to mitigate known vulnerabilities. | ||
- 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.""" | ||
|
||
|
||
[[rule.threat]] | ||
framework = "MITRE ATT&CK" | ||
[[rule.threat.technique]] | ||
id = "T1059" | ||
name = "Command and Scripting Interpreter" | ||
reference = "https://attack.mitre.org/techniques/T1059/" | ||
[[rule.threat.technique.subtechnique]] | ||
id = "T1059.007" | ||
name = "JavaScript" | ||
reference = "https://attack.mitre.org/techniques/T1059/007/" | ||
|
||
|
||
[[rule.threat.technique]] | ||
id = "T1203" | ||
name = "Exploitation for Client Execution" | ||
reference = "https://attack.mitre.org/techniques/T1203/" | ||
|
||
|
||
[rule.threat.tactic] | ||
id = "TA0002" | ||
name = "Execution" | ||
reference = "https://attack.mitre.org/tactics/TA0002/" | ||
|
106 changes: 106 additions & 0 deletions
106
rules/cross-platform/execution_sap_netweaver_webshell_exec.toml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
[metadata] | ||
creation_date = "2025/04/26" | ||
integration = ["endpoint"] | ||
maturity = "production" | ||
updated_date = "2025/04/26" | ||
|
||
[rule] | ||
author = ["Elastic"] | ||
description = """ | ||
Identifies suspicious processes spawned from the SAP NetWeaver application. This may indicate an attempt to execute commands via webshell. | ||
""" | ||
from = "now-9m" | ||
index = ["auditbeat-*", "logs-endpoint.events.process*"] | ||
language = "eql" | ||
license = "Elastic License v2" | ||
name = "Potential SAP NetWeaver Exploitation" | ||
references = [ | ||
"https://reliaquest.com/blog/threat-spotlight-reliaquest-uncovers-vulnerability-behind-sap-netweaver-compromise/", | ||
"https://onapsis.com/blog/active-exploitation-of-sap-vulnerability-cve-2025-31324/" | ||
] | ||
risk_score = 73 | ||
rule_id = "23c53c4c-aa8b-4b07-85c0-fe46a9c8acaf" | ||
severity = "high" | ||
tags = [ | ||
"Domain: Endpoint", | ||
"OS: Linux", | ||
"OS: Windows", | ||
"Use Case: Threat Detection", | ||
"Tactic: Execution", | ||
"Use Case: Vulnerability", | ||
"Data Source: Elastic Defend", | ||
"Resources: Investigation Guide", | ||
] | ||
type = "eql" | ||
|
||
query = ''' | ||
process where event.type == "start" and file where host.os.type in ("linux", "windows") and | ||
process.name : ("sh", | ||
"bash", | ||
"dash", | ||
"ksh", | ||
"tcsh", | ||
"zsh", | ||
"curl", | ||
"perl*", | ||
"python*", | ||
"ruby*", | ||
"php*", | ||
"wget", | ||
"cmd.exe", | ||
"powershell.exe", | ||
"rundll32.exe", | ||
"msbuild.exe", | ||
"curl.exe", | ||
"certutil.exe") and | ||
( | ||
process.working_directory : ("/*/sap.com/*/servlet_jsp/irj/*", "*\\sap.com\\*\\servlet_jsp\\irj\\*") or | ||
process.command_line : ("*/sap.com/*/servlet_jsp/irj/*", "*\\sap.com\\*\\servlet_jsp\\irj\\*") or | ||
process.parent.command_line : ("*/sap.com/*/servlet_jsp/irj/*", "*\\sap.com\\*\\servlet_jsp\\irj\\*") | ||
) | ||
''' | ||
note = """## Triage and analysis | ||
|
||
### Investigating Potential SAP NetWeaver Exploitation | ||
|
||
### Possible investigation steps | ||
|
||
- 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). | ||
- Check the command line arguments and environment variables of the suspicious child processes to identify any potentially malicious payloads or commands being executed. | ||
- 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. | ||
- 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. | ||
|
||
|
||
### Response and remediation | ||
|
||
- Immediately isolate the affected host from the network to prevent further outbound connections and potential lateral movement. | ||
- Terminate any suspicious Java processes identified in the alert, especially those making outbound connections to LDAP, RMI, or DNS ports. | ||
- 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. | ||
- Restore the affected system from a known good backup if unauthorized changes or malware are detected. | ||
- Update and patch Java and any related applications to the latest versions to mitigate known vulnerabilities. | ||
- 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.""" | ||
|
||
|
||
[[rule.threat]] | ||
framework = "MITRE ATT&CK" | ||
[[rule.threat.technique]] | ||
id = "T1059" | ||
name = "Command and Scripting Interpreter" | ||
reference = "https://attack.mitre.org/techniques/T1059/" | ||
[[rule.threat.technique.subtechnique]] | ||
id = "T1059.007" | ||
name = "JavaScript" | ||
reference = "https://attack.mitre.org/techniques/T1059/007/" | ||
|
||
|
||
[[rule.threat.technique]] | ||
id = "T1203" | ||
name = "Exploitation for Client Execution" | ||
reference = "https://attack.mitre.org/techniques/T1203/" | ||
|
||
|
||
[rule.threat.tactic] | ||
id = "TA0002" | ||
name = "Execution" | ||
reference = "https://attack.mitre.org/tactics/TA0002/" | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.