Timestomping using Touch Command

Timestomping is an anti-forensics technique which is used to modify the timestamps of a file, often to mimic files that are in the same folder.

Elastic rule (View on GitHub)

 1[metadata]
 2creation_date = "2020/11/03"
 3integration = ["endpoint"]
 4maturity = "production"
 5min_stack_comments = "New fields added: required_fields, related_integrations, setup"
 6min_stack_version = "8.3.0"
 7updated_date = "2023/12/18"
 8
 9[rule]
10author = ["Elastic"]
11description = """
12Timestomping is an anti-forensics technique which is used to modify the timestamps of a file, often to mimic files that
13are in the same folder.
14"""
15from = "now-9m"
16index = ["auditbeat-*", "logs-endpoint.events.*"]
17language = "eql"
18license = "Elastic License v2"
19max_signals = 33
20name = "Timestomping using Touch Command"
21risk_score = 47
22rule_id = "b0046934-486e-462f-9487-0d4cf9e429c6"
23setup = """## Setup
24
25If enabling an EQL rule on a non-elastic-agent index (such as beats) for versions <8.2,
26events will not define `event.ingested` and default fallback for EQL rules was not added until version 8.2.
27Hence for this rule to work effectively, users will need to add a custom ingest pipeline to populate
28`event.ingested` to @timestamp.
29For more details on adding a custom ingest pipeline refer - https://www.elastic.co/guide/en/fleet/current/data-streams-pipeline-tutorial.html
30"""
31severity = "medium"
32tags = [
33        "Domain: Endpoint",
34        "OS: Linux",
35        "OS: macOS",
36        "Use Case: Threat Detection",
37        "Tactic: Defense Evasion",
38        "Data Source: Elastic Defend"
39        ]
40timestamp_override = "event.ingested"
41type = "eql"
42
43query = '''
44process where event.type == "start" and
45 process.name : "touch" and user.id != "0" and
46 process.args : ("-r", "-t", "-a*","-m*") and
47 not process.args : (
48   "/usr/lib/go-*/bin/go", "/usr/lib/dracut/dracut-functions.sh", "/tmp/KSInstallAction.*/m/.patch/*"
49) and not process.parent.name in ("pmlogger_daily", "pmlogger_janitor", "systemd")
50'''
51
52
53[[rule.threat]]
54framework = "MITRE ATT&CK"
55[[rule.threat.technique]]
56id = "T1070"
57name = "Indicator Removal"
58reference = "https://attack.mitre.org/techniques/T1070/"
59[[rule.threat.technique.subtechnique]]
60id = "T1070.006"
61name = "Timestomp"
62reference = "https://attack.mitre.org/techniques/T1070/006/"
63
64
65
66[rule.threat.tactic]
67id = "TA0005"
68name = "Defense Evasion"
69reference = "https://attack.mitre.org/tactics/TA0005/"

Related rules

to-top