Deprecated - Potential Reverse Shell via Suspicious Parent Process

This detection rule detects the creation of a shell through a suspicious parent child relationship. Any reverse shells spawned by the specified utilities that use a forked process to initialize the connection attempt will be captured through this rule. Attackers may spawn reverse shells to establish persistence onto a target system.

Elastic rule (View on GitHub)

  1[metadata]
  2creation_date = "2023/07/04"
  3deprecation_date = "2023/11/02"
  4integration = ["endpoint"]
  5maturity = "deprecated"
  6min_stack_comments = "New fields added: required_fields, related_integrations, setup"
  7min_stack_version = "8.3.0"
  8updated_date = "2023/11/02"
  9
 10[rule]
 11author = ["Elastic"]
 12description = """
 13This detection rule detects the creation of a shell through a suspicious parent child relationship. Any reverse shells
 14spawned by the specified utilities that use a forked process to initialize the connection attempt will be captured
 15through this rule. Attackers may spawn reverse shells to establish persistence onto a target system.
 16"""
 17from = "now-9m"
 18index = ["logs-endpoint.events.*"]
 19language = "eql"
 20license = "Elastic License v2"
 21name = "Deprecated - Potential Reverse Shell via Suspicious Parent Process"
 22note = "This rule was deprecated due to its addition to the umbrella `Potential Reverse Shell via Suspicious Child Process` (76e4d92b-61c1-4a95-ab61-5fd94179a1ee) rule."
 23references = [
 24    "https://github.com/swisskyrepo/PayloadsAllTheThings/blob/master/Methodology%20and%20Resources/Reverse%20Shell%20Cheatsheet.md",
 25]
 26risk_score = 47
 27rule_id = "4b1a807a-4e7b-414e-8cea-24bf580f6fc5"
 28setup = """
 29This rule requires data coming in from Elastic Defend.
 30
 31### Elastic Defend Integration Setup
 32Elastic Defend is integrated into the Elastic Agent using Fleet. Upon configuration, the integration allows the Elastic Agent to monitor events on your host and send data to the Elastic Security app.
 33
 34#### Prerequisite Requirements:
 35- Fleet is required for Elastic Defend.
 36- To configure Fleet Server refer to the [documentation](https://www.elastic.co/guide/en/fleet/current/fleet-server.html).
 37
 38#### The following steps should be executed in order to add the Elastic Defend integration on a Linux System:
 39- Go to the Kibana home page and click "Add integrations".
 40- In the query bar, search for "Elastic Defend" and select the integration to see more details about it.
 41- Click "Add Elastic Defend".
 42- Configure the integration name and optionally add a description.
 43- Select the type of environment you want to protect, either "Traditional Endpoints" or "Cloud Workloads".
 44- Select a configuration preset. Each preset comes with different default settings for Elastic Agent, you can further customize these later by configuring the Elastic Defend integration policy. [Helper guide](https://www.elastic.co/guide/en/security/current/configure-endpoint-integration-policy.html).
 45- We suggest selecting "Complete EDR (Endpoint Detection and Response)" as a configuration setting, that provides "All events; all preventions"
 46- Enter a name for the agent policy in "New agent policy name". If other agent policies already exist, you can click the "Existing hosts" tab and select an existing policy instead.
 47For more details on Elastic Agent configuration settings, refer to the [helper guide](https://www.elastic.co/guide/en/fleet/8.10/agent-policy.html).
 48- Click "Save and Continue".
 49- To complete the integration, select "Add Elastic Agent to your hosts" and continue to the next section to install the Elastic Agent on your hosts.
 50For more details on Elastic Defend refer to the [helper guide](https://www.elastic.co/guide/en/security/current/install-endpoint.html).
 51
 52"""
 53severity = "medium"
 54tags = [
 55    "Domain: Endpoint",
 56    "OS: Linux",
 57    "Use Case: Threat Detection",
 58    "Tactic: Execution",
 59    "Data Source: Elastic Defend",
 60]
 61type = "eql"
 62
 63query = '''
 64sequence by host.id, process.parent.entity_id with maxspan=1s
 65[ process where host.os.type == "linux" and event.type == "start" and event.action == "fork" and (
 66  (process.name : "python*" and process.args == "-c" and not process.args == "/usr/bin/supervisord") or
 67  (process.name : "php*" and process.args == "-r") or
 68  (process.name : "perl" and process.args == "-e") or
 69  (process.name : "ruby" and process.args in ("-e", "-rsocket")) or
 70  (process.name : "lua*" and process.args == "-e") or
 71  (process.name : "openssl" and process.args : "-connect") or
 72  (process.name : ("nc", "ncat", "netcat") and process.args_count >= 3 and not process.args == "-z") or
 73  (process.name : "telnet" and process.args_count >= 3) or
 74  (process.name : "awk")) and 
 75  process.parent.name : ("python*", "php*", "perl", "ruby", "lua*", "openssl", "nc", "netcat", "ncat", "telnet", "awk") ]
 76[ network where host.os.type == "linux" and event.type == "start" and event.action in ("connection_attempted", "connection_accepted") and 
 77  process.name : ("python*", "php*", "perl", "ruby", "lua*", "openssl", "nc", "netcat", "ncat", "telnet", "awk") and
 78  destination.ip != null and destination.ip != "127.0.0.1" and destination.ip != "::1" ]
 79'''
 80
 81
 82[[rule.threat]]
 83framework = "MITRE ATT&CK"
 84[[rule.threat.technique]]
 85id = "T1059"
 86name = "Command and Scripting Interpreter"
 87reference = "https://attack.mitre.org/techniques/T1059/"
 88[[rule.threat.technique.subtechnique]]
 89id = "T1059.004"
 90name = "Unix Shell"
 91reference = "https://attack.mitre.org/techniques/T1059/004/"
 92
 93
 94
 95[rule.threat.tactic]
 96id = "TA0002"
 97name = "Execution"
 98reference = "https://attack.mitre.org/tactics/TA0002/"
 99[[rule.threat]]
100framework = "MITRE ATT&CK"
101[[rule.threat.technique]]
102id = "T1071"
103name = "Application Layer Protocol"
104reference = "https://attack.mitre.org/techniques/T1071/"
105
106
107[rule.threat.tactic]
108id = "TA0011"
109name = "Command and Control"
110reference = "https://attack.mitre.org/tactics/TA0011/"

This rule was deprecated due to its addition to the umbrella Potential Reverse Shell via Suspicious Child Process (76e4d92b-61c1-4a95-ab61-5fd94179a1ee) rule.

References

Related rules

to-top