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

Related rules

to-top