Operator On The Wire
Join
← Back to Knowledge Base
BLUE TEAM / THREAT HUNT / LINUX / EVASION

Timestamp Tampering

This note documents detection patterns related to Timestamp Tampering on Linux systems.


Direct Indicators

SourceGrep Pattern / ArtifactMeaningForensic ValueNotes
Shell historytouch -rCopy timestamp from reference fileCriticalClassic timestomp method.
Shell historytouch -tManual timestamp setCriticalDirect anti-forensic action.
Shell historytouch --reference=Timestamp cloningCriticalStrong stealth indicator.
Shell historystat repeated before touchTimestamp prepHighCommon operator behavior.
File metadatasuspicious older mtime on new fileTimestompCriticalStrong anomaly.
File metadatactime newer than mtimeTimestamp inconsistencyCriticalCore forensic clue.
Hidden payload with old timestampConcealmentCriticalStrong anti-forensic signal.
Persistence file with mismatched timesStealth persistenceCriticalHigh-value finding.
auditdtouch executionCriticalAttribution.
Temp file cloned to system pathTimestamp camouflageCriticalStrong hostile sequence.

Indirect Indicators

IndicatorWhat To Look ForForensic ValueNotes
Timestamp change after payload dropAnti-forensicsCriticalStrong chain.
Same timestamp as legit binaryCamouflageCriticalMature operator behavior.
ctime mismatch across clusterStrong anomalyCriticalReliable clue.
Timestomp after privilege escalationCleanup disciplineCriticalMature hostile sequence.
Hidden file plus cloned timestampStealth persistenceCriticalHigh-confidence malicious signal.

Common Tools

ToolUsage
touch -rClone timestamp.
touch -tSet manual timestamp.
statCompare metadata.

Relevant Artifacts

ArtifactPath / CommandForensic ValueNotes
File metadatastatCriticalPrimary truth source.
Shell history.bash_historyCriticalTimestomp command evidence.
Audit logs/var/log/audit/audit.logCriticalAttribution.

MITRE ATT&CK References

  • T1070 Indicator Removal on Host
  • T1070.006 Timestomp

Decision Tree

  1. Was touch used suspiciously?
  2. Which file changed?
  3. ctime vs mtime mismatch?
  4. What file served as reference?
  5. Linked to payload or persistence?

Example Detection Templates

Grep

grep -R "touch -r\|touch -t\|touch --reference\|stat " /home/*/.bash_history /root/.bash_history 2>/dev/null

Journalctl

journalctl | grep touch

File Inspection

stat <file>

Sigma

title: Linux Timestamp Tampering
id: linux-timestamp-tampering
status: experimental
description: Detects suspicious timestomp activity on Linux
logsource:
  product: linux
detection:
  selection_keywords:
    message|contains:
      - 'touch -r'
      - 'touch -t'
      - 'touch --reference'
  condition: selection_keywords
level: high
tags:
  - attack.defense_evasion
  - attack.t1070.006

Mitigation & Hardening

Control AreaMitigationEffectivenessNotes
Metadata reviewCompare ctime/mtime systematicallyCriticalCore timestomp detection.
AuditdTrack touch executionHighAttribution.
File integrity monitoringDetect silent metadata changesHighStrong anti-forensic detection.