Potential Linux Credential Dumping via Unshadow

Identifies the execution of the unshadow utility which is part of John the Ripper, a password-cracking tool on the host machine. Malicious actors can use the utility to retrieve the combined contents of the '/etc/shadow' and '/etc/password' files. Using the combined file generated from the utility, the malicious threat actors can use them as input for password-cracking utilities or prepare themselves for future operations by gathering credential information of the victim.

Elastic rule (View on GitHub)

 1[metadata]
 2creation_date = "2023/02/27"
 3integration = ["endpoint"]
 4maturity = "production"
 5min_stack_comments = "New fields added: required_fields, related_integrations, setup"
 6min_stack_version = "8.3.0"
 7updated_date = "2024/02/19"
 8
 9[rule]
10author = ["Elastic"]
11description = """
12Identifies the execution of the unshadow utility which is part of John the Ripper,
13a password-cracking tool on the host machine. Malicious actors can use the utility to retrieve
14the combined contents of the '/etc/shadow' and '/etc/password' files.
15Using the combined file generated from the utility, the malicious threat actors can use them as input
16for password-cracking utilities or prepare themselves for future operations by gathering
17credential information of the victim.
18"""
19from = "now-9m"
20index = ["logs-endpoint.events.*", "endgame-*"]
21language = "eql"
22license = "Elastic License v2"
23name = "Potential Linux Credential Dumping via Unshadow"
24references = [
25    "https://www.cyberciti.biz/faq/unix-linux-password-cracking-john-the-ripper/",
26]
27risk_score = 47
28rule_id = "e7cb3cfd-aaa3-4d7b-af18-23b89955062c"
29setup = """## Setup
30
31This rule requires data coming in from Elastic Defend.
32
33### Elastic Defend Integration Setup
34Elastic 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.
35
36#### Prerequisite Requirements:
37- Fleet is required for Elastic Defend.
38- To configure Fleet Server refer to the [documentation](https://www.elastic.co/guide/en/fleet/current/fleet-server.html).
39
40#### The following steps should be executed in order to add the Elastic Defend integration on a Linux System:
41- Go to the Kibana home page and click "Add integrations".
42- In the query bar, search for "Elastic Defend" and select the integration to see more details about it.
43- Click "Add Elastic Defend".
44- Configure the integration name and optionally add a description.
45- Select the type of environment you want to protect, either "Traditional Endpoints" or "Cloud Workloads".
46- 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).
47- We suggest selecting "Complete EDR (Endpoint Detection and Response)" as a configuration setting, that provides "All events; all preventions"
48- 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.
49For more details on Elastic Agent configuration settings, refer to the [helper guide](https://www.elastic.co/guide/en/fleet/8.10/agent-policy.html).
50- Click "Save and Continue".
51- 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.
52For more details on Elastic Defend refer to the [helper guide](https://www.elastic.co/guide/en/security/current/install-endpoint.html).
53"""
54severity = "medium"
55tags = [
56        "Domain: Endpoint",
57        "OS: Linux",
58        "Use Case: Threat Detection",
59        "Tactic: Credential Access",
60        "Data Source: Elastic Defend",
61        "Data Source: Elastic Endgame"
62        ]
63timestamp_override = "event.ingested"
64type = "eql"
65query = '''
66process where host.os.type == "linux" and event.type == "start" and event.action in ("exec", "exec_event") and
67process.name == "unshadow" and process.args_count >= 3
68'''
69
70[[rule.threat]]
71framework = "MITRE ATT&CK"
72
73[[rule.threat.technique]]
74id = "T1003"
75name = "OS Credential Dumping"
76reference = "https://attack.mitre.org/techniques/T1003/"
77
78[[rule.threat.technique.subtechnique]]
79id = "T1003.008"
80name = "/etc/passwd and /etc/shadow"
81reference = "https://attack.mitre.org/techniques/T1003/008/"
82
83[rule.threat.tactic]
84id = "TA0006"
85name = "Credential Access"
86reference = "https://attack.mitre.org/tactics/TA0006/"

References

Related rules

to-top