Skip to content

Commit c56add2

Browse files
Samirboustradebot-elastic
authored andcommitted
[New] Potential Command Shell via NetCat (#5221)
* [New] Potential Command Shell via NetCat * Update execution_revshell_cmd_via_netcat.toml * Update execution_revshell_cmd_via_netcat.toml * Update execution_revshell_cmd_via_netcat.toml * Update execution_revshell_cmd_via_netcat.toml * Update execution_revshell_cmd_via_netcat.toml (cherry picked from commit 64a8290)
1 parent badaae7 commit c56add2

File tree

1 file changed

+97
-0
lines changed

1 file changed

+97
-0
lines changed
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
[metadata]
2+
creation_date = "2025/10/14"
3+
integration = ["endpoint"]
4+
maturity = "production"
5+
updated_date = "2025/10/14"
6+
7+
8+
[rule]
9+
author = ["Elastic"]
10+
description = """
11+
Identifies potential attempt to execute via a reverse shell using the netcat utility to execute Windows commands using
12+
the default interpreters like Cmd.exe and Powershell.
13+
"""
14+
from = "now-9m"
15+
index = ["logs-endpoint.events.process-*"]
16+
language = "eql"
17+
license = "Elastic License v2"
18+
name = "Potential Command Shell via NetCat"
19+
note = """## Triage and analysis
20+
21+
### Investigating Potential Command Shell via NetCat
22+
23+
Attackers may abuse the NetCat utility to execute commands remotely using the builtin Windows Command Shell interpreters.
24+
25+
#### Possible investigation steps
26+
27+
- Verify if the user is authorized to use the Netcat utility.
28+
- Investigate the process execution chain (parent process tree) and how the netcat binary was dropped.
29+
- Review the network connections made by the parent process and check their reputation.
30+
- Investiguate all child processes spawned by the Cmd or Powershell instance.
31+
- Examine the host for other alerts within the same period.
32+
33+
### False positive analysis
34+
35+
- IT Support or system amdinistrator authorized activity using NetCat.
36+
37+
### Response and remediation
38+
39+
- Initiate the incident response process based on the outcome of the triage.
40+
- Isolate the involved host to prevent further post-compromise behavior.
41+
- If the triage identified malware, search the environment for additional compromised hosts.
42+
- Implement temporary network rules, procedures, and segmentation to contain the malware.
43+
- Stop suspicious processes.
44+
- Immediately block the identified indicators of compromise (IoCs).
45+
- Inspect the affected systems for additional malware backdoors like reverse shells, reverse proxies, or droppers that attackers could use to reinfect the system.
46+
- Remove and block malicious artifacts identified during triage.
47+
- Run a full antimalware scan. This may reveal additional artifacts left in the system, persistence mechanisms, and malware components.
48+
- Investigate credential exposure on systems compromised or used by the attacker to ensure all compromised accounts are identified. Reset passwords for these accounts and other potentially compromised credentials, such as email, business systems, and web services.
49+
- Determine the initial vector abused by the attacker and take action to prevent reinfection through the same vector.
50+
- Using the incident response data, update logging and audit policies to improve the mean time to detect (MTTD) and the mean time to respond (MTTR).
51+
"""
52+
risk_score = 73
53+
rule_id = "9c0f61fa-abf4-4b11-8d9d-5978c09182dd"
54+
severity = "high"
55+
tags = [
56+
"Domain: Endpoint",
57+
"OS: Windows",
58+
"Use Case: Threat Detection",
59+
"Tactic: Execution",
60+
"Resources: Investigation Guide",
61+
"Data Source: Elastic Defend"
62+
]
63+
timestamp_override = "event.ingested"
64+
type = "eql"
65+
66+
query = '''
67+
process where host.os.type == "windows" and event.type == "start" and
68+
process.name : ("cmd.exe", "powershell.exe") and process.parent.args : "-e" and
69+
(
70+
(process.parent.args_count == 5 and process.parent.command_line regex~ """.*[0-9]{1,3}(\.[0-9]{1,3}){3}.*""") or
71+
(process.parent.args : "-*l*" and process.parent.args : "-*p*" and process.parent.args : ("cmd.exe", "powershell.exe"))
72+
)
73+
'''
74+
75+
76+
[[rule.threat]]
77+
framework = "MITRE ATT&CK"
78+
[[rule.threat.technique]]
79+
id = "T1059"
80+
name = "Command and Scripting Interpreter"
81+
reference = "https://attack.mitre.org/techniques/T1059/"
82+
[[rule.threat.technique.subtechnique]]
83+
id = "T1059.001"
84+
name = "PowerShell"
85+
reference = "https://attack.mitre.org/techniques/T1059/001/"
86+
87+
[[rule.threat.technique.subtechnique]]
88+
id = "T1059.003"
89+
name = "Windows Command Shell"
90+
reference = "https://attack.mitre.org/techniques/T1059/003/"
91+
92+
93+
[rule.threat.tactic]
94+
id = "TA0002"
95+
name = "Execution"
96+
reference = "https://attack.mitre.org/tactics/TA0002/"
97+

0 commit comments

Comments
 (0)