[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7D8THXD88XS0VFEENP2JZ1J":3,"skill-same:01M7D8THXD88XS0VFEENP2JZ1J":91},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":16,"sourceHtmlUrl":17,"categories":18,"keywords":19,"publishedAt":20,"linkOnly":21,"markdownContent":22,"markdownBody":23,"frontMatter":24,"refName":52,"commitSha":53,"skillDirectory":54,"forksCount":55,"repositoryHtmlUrl":56,"repositoryHomepageUrl":6,"ownerHtmlUrl":57,"ownerBlogUrl":58,"ownerDescription":59,"updatedAt":60,"install":61,"resources":74},"01M7D8THXD88XS0VFEENP2JZ1J","hunting-for-defense-evasion-via-timestomping",null,"Detect NTFS timestamp manipulation (MITRE T1070.006) by comparing $STANDARD_INFORMATION vs $FILE_NAME timestamps in the MFT. Uses analyzeMFT and Python to identify files with anomalous temporal patterns indicating anti-forensic timestomping activity.","SaiVatsal\u002FSkills-I-Use","SaiVatsal","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F242597752?v=4","01M7D5YM1T4VXW9203M0GFAHZ1","SaiVatsalPolimera","01M7D5YM2D61ST39XVR2V7B7ZJ",3,"Apache-2.0","https:\u002F\u002Fgithub.com\u002FSaiVatsal\u002FSkills-I-Use\u002Fblob\u002Fmain\u002FAnthropic-Cybersecurity-Skills-main\u002Fskills\u002Fhunting-for-defense-evasion-via-timestomping\u002FLICENSE","https:\u002F\u002Fgithub.com\u002FSaiVatsal\u002FSkills-I-Use\u002Fblob\u002Fmain\u002FAnthropic-Cybersecurity-Skills-main\u002Fskills\u002Fhunting-for-defense-evasion-via-timestomping\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: hunting-for-defense-evasion-via-timestomping\ndescription: 'Detect NTFS timestamp manipulation (MITRE T1070.006) by comparing $STANDARD_INFORMATION\n  vs $FILE_NAME timestamps in the MFT. Uses analyzeMFT and Python to identify files\n  with anomalous temporal patterns indicating anti-forensic timestomping activity.\n\n  '\ndomain: cybersecurity\nsubdomain: threat-hunting\ntags:\n- timestomping\n- ntfs-forensics\n- mft-analysis\n- defense-evasion\nversion: '1.0'\nauthor: mahipal\nlicense: Apache-2.0\nd3fend_techniques:\n- File Metadata Consistency Validation\n- Content Format Conversion\n- File Content Analysis\n- Platform Hardening\n- File Format Verification\nnist_csf:\n- DE.CM-01\n- DE.AE-02\n- DE.AE-07\n- ID.RA-05\nmitre_attack:\n- T1046\n- T1057\n- T1082\n- T1083\n- T1027\n---\n\n# Hunting for Defense Evasion via Timestomping\n\nDetect timestamp manipulation by analyzing NTFS MFT entries for\ndiscrepancies between $STANDARD_INFORMATION and $FILE_NAME attributes.\n\n## When to Use\n\n- Investigating suspected anti-forensic activity where an adversary may have altered file timestamps to blend malware into legitimate directories\n- Threat hunting for defense evasion (MITRE ATT&CK T1070.006) across compromised Windows systems\n- Validating timeline integrity during forensic examinations of disk images or live acquisitions\n- Triaging suspicious files that appear to have creation dates older than the OS installation or inconsistent with known deployment timelines\n- Detecting tools like Timestomp (Metasploit), NTimeStomp, SetMACE, or PowerShell Set-ItemProperty used to alter timestamps\n- Building automated detection pipelines that flag temporal anomalies in MFT data for SOC analysts\n\n**Do not use** as the sole detection method; advanced adversaries can manipulate both $STANDARD_INFORMATION and $FILE_NAME timestamps (though the latter requires raw disk access and is much harder). Combine with USN Journal, $LogFile, and ShimCache\u002FAmcache analysis for corroboration.\n\n## Prerequisites\n\n- Raw $MFT file extracted from a Windows system (via FTK Imager, KAPE, or live extraction)\n- `MFTECmd` (Eric Zimmerman tool) or `analyzeMFT` for MFT parsing\n- Python 3.8+ with `pandas` for analysis\n- Optional: `mft` Python library (`pip install mft`) for programmatic MFT parsing\n- Optional: KAPE (Kroll Artifact Parser and Extractor) for automated artifact collection\n- Timeline Explorer or Excel for visual analysis of parsed MFT output\n\n## Workflow\n\n### Step 1: Extract the $MFT from a Live System or Disk Image\n\n```powershell\n# Method 1: Using KAPE to collect MFT and related artifacts\n.\\kape.exe --tsource C: --tdest D:\\Evidence\\MFT_Collection --target !SANS_Triage\n\n# Method 2: Using FTK Imager CLI to extract $MFT\nftkimager.exe \\\\.\\C: D:\\Evidence\\mft_raw.bin --e01 --include $MFT\n\n# Method 3: Raw copy using RawCopy (handles locked NTFS system files)\nRawCopy.exe \u002FFileNamePath:C:0 \u002FOutputPath:D:\\Evidence\\ \u002FOutputName:$MFT\n```\n\n```bash\n# Method 4: On a mounted forensic image in Linux\nsudo mount -o ro,norecovery \u002Fdev\u002Fsdb1 \u002Fmnt\u002Fevidence\nsudo icat -o 2048 \u002Fdev\u002Fsdb 0 > \u002Fmnt\u002Foutput\u002F$MFT\n\n# Method 5: Using sleuthkit to extract MFT from disk image\nicat -o 2048 evidence.E01 0 > extracted_MFT\n```\n\n### Step 2: Parse the MFT with MFTECmd\n\nUse Eric Zimmerman's MFTECmd to produce a CSV with both $STANDARD_INFORMATION and $FILE_NAME timestamps:\n\n```powershell\n# Parse MFT to CSV with all timestamp columns\nMFTECmd.exe -f \"D:\\Evidence\\$MFT\" --csv D:\\Evidence\\Parsed\\ --csvf mft_parsed.csv\n\n# The output CSV contains these critical columns:\n# Created0x10         - $STANDARD_INFORMATION Created timestamp\n# LastModified0x10    - $STANDARD_INFORMATION Modified timestamp\n# LastAccess0x10      - $STANDARD_INFORMATION Accessed timestamp\n# LastRecordChange0x10 - $STANDARD_INFORMATION Entry Modified timestamp\n# Created0x30         - $FILE_NAME Created timestamp\n# LastModified0x30    - $FILE_NAME Modified timestamp\n# LastAccess0x30      - $FILE_NAME Accessed timestamp\n# LastRecordChange0x30 - $FILE_NAME Entry Modified timestamp\n```\n\n### Step 3: Detect Timestomping via SI vs FN Comparison\n\nThe core detection: $STANDARD_INFORMATION timestamps are easily modified by user-mode tools, but $FILE_NAME timestamps are updated only by the NTFS driver (kernel-mode). When SI timestamps are OLDER than FN timestamps, timestomping is likely:\n\n```python\nimport pandas as pd\nfrom datetime import datetime, timedelta\n\ndef load_mft_data(csv_path):\n    \"\"\"Load MFTECmd parsed CSV output.\"\"\"\n    df = pd.read_csv(csv_path, low_memory=False)\n\n    # Parse timestamp columns\n    timestamp_cols = [\n        \"Created0x10\", \"LastModified0x10\", \"LastAccess0x10\", \"LastRecordChange0x10\",\n        \"Created0x30\", \"LastModified0x30\", \"LastAccess0x30\", \"LastRecordChange0x30\"\n    ]\n\n    for col in timestamp_cols:\n        if col in df.columns:\n            df[col] = pd.to_datetime(df[col], errors=\"coerce\")\n\n    return df\n\ndef detect_timestomping(df):\n    \"\"\"Detect timestamp manipulation by comparing SI and FN attributes.\n\n    Key indicators:\n    1. SI Created \u003C FN Created (SI timestamp pushed back in time)\n    2. SI timestamps have nanoseconds = 0000000 (tool artifact)\n    3. SI Created \u003C FN Entry Modified (impossible under normal NTFS behavior)\n    4. Large gap between SI and FN timestamps\n    \"\"\"\n    results = []\n\n    for idx, row in df.iterrows():\n        si_created = row.get(\"Created0x10\")\n        fn_created = row.get(\"Created0x30\")\n        si_modified = row.get(\"LastModified0x10\")\n        fn_modified = row.get(\"LastModified0x30\")\n        si_entry = row.get(\"LastRecordChange0x10\")\n        fn_entry = row.get(\"LastRecordChange0x30\")\n\n        if pd.isna(si_created) or pd.isna(fn_created):\n            continue\n\n        filepath = row.get(\"FileName\", \"unknown\")\n        parent_path = row.get(\"ParentPath\", \"\")\n        full_path = f\"{parent_path}\\\\{filepath}\" if parent_path else filepath\n        indicators = []\n\n        # Detection 1: SI Created is BEFORE FN Created\n        # Under normal NTFS operations, SI Created >= FN Created\n        if si_created \u003C fn_created:\n            delta = fn_created - si_created\n            indicators.append({\n                \"check\": \"SI_Created \u003C FN_Created\",\n                \"si_value\": str(si_created),\n                \"fn_value\": str(fn_created),\n                \"delta\": str(delta),\n                \"confidence\": \"high\"\n            })\n\n        # Detection 2: SI Modified is BEFORE FN Created\n        # A file cannot be modified before it was created\n        if pd.notna(si_modified) and si_modified \u003C fn_created:\n            indicators.append({\n                \"check\": \"SI_Modified \u003C FN_Created\",\n                \"si_value\": str(si_modified),\n                \"fn_value\": str(fn_created),\n                \"confidence\": \"high\"\n            })\n\n        # Detection 3: Nanosecond precision check\n        # Many timestomping tools set timestamps with zero nanoseconds\n        if pd.notna(si_created):\n            si_created_str = str(si_created)\n            if \".000000\" in si_created_str or si_created_str.endswith(\"00:00:00\"):\n                # Check if FN has normal nanosecond precision\n                fn_str = str(fn_created)\n                if \".000000\" not in fn_str:\n                    indicators.append({\n                        \"check\": \"SI_nanoseconds_zeroed\",\n                        \"si_value\": si_created_str,\n                        \"fn_value\": fn_str,\n                        \"confidence\": \"medium\"\n                    })\n\n        # Detection 4: Large time gap between SI and FN\n        # Normal gap is seconds to minutes, not years\n        if abs((si_created - fn_created).days) > 365:\n            indicators.append({\n                \"check\": \"SI_FN_gap_exceeds_1_year\",\n                \"si_value\": str(si_created),\n                \"fn_value\": str(fn_created),\n                \"delta_days\": abs((si_created - fn_created).days),\n                \"confidence\": \"high\"\n            })\n\n        # Detection 5: SI Entry Modified much later than SI Created\n        # Indicates the SI attribute was rewritten\n        if pd.notna(si_entry) and pd.notna(si_created):\n            entry_delta = si_entry - si_created\n            if entry_delta.days > 365 * 5:  # Entry modified years after creation\n                indicators.append({\n                    \"check\": \"SI_entry_modified_years_after_creation\",\n                    \"si_created\": str(si_created),\n                    \"si_entry_modified\": str(si_entry),\n                    \"confidence\": \"medium\"\n                })\n\n        if indicators:\n            results.append({\n                \"file_path\": full_path,\n                \"entry_number\": row.get(\"EntryNumber\", \"\"),\n                \"in_use\": row.get(\"InUse\", True),\n                \"si_created\": str(si_created),\n                \"fn_created\": str(fn_created),\n                \"indicators\": indicators,\n                \"highest_confidence\": max(i[\"confidence\"] for i in indicators),\n            })\n\n    return results\n\n# Run detection\ndf = load_mft_data(\"D:\\\\Evidence\\\\Parsed\\\\mft_parsed.csv\")\nstomped_files = detect_timestomping(df)\n\nprint(f\"\\nTimestomping Detection Results\")\nprint(f\"{'='*60}\")\nprint(f\"Total MFT entries analyzed: {len(df)}\")\nprint(f\"Suspicious entries found: {len(stomped_files)}\")\nprint()\n\nfor entry in sorted(stomped_files, key=lambda x: x[\"highest_confidence\"], reverse=True):\n    print(f\"[{entry['highest_confidence'].upper()}] {entry['file_path']}\")\n    print(f\"  SI Created: {entry['si_created']}\")\n    print(f\"  FN Created: {entry['fn_created']}\")\n    for ind in entry[\"indicators\"]:\n        print(f\"  Check: {ind['check']} (confidence: {ind['confidence']})\")\n    print()\n```\n\n### Step 4: Corroborate with USN Journal Analysis\n\nThe USN Journal records metadata change events that persist even after timestomping:\n\n```python\ndef correlate_with_usn_journal(stomped_files, usn_csv_path):\n    \"\"\"Cross-reference timestomped files with USN Journal entries.\n\n    The USN Journal records a BASIC_INFO_CHANGE reason when timestamps\n    are modified, providing corroborating evidence of timestomping.\n    \"\"\"\n    usn_df = pd.read_csv(usn_csv_path, low_memory=False)\n    usn_df[\"UpdateTimestamp\"] = pd.to_datetime(usn_df[\"UpdateTimestamp\"], errors=\"coerce\")\n\n    corroborated = []\n    for entry in stomped_files:\n        filename = entry[\"file_path\"].split(\"\\\\\")[-1]\n\n        # Find USN entries for this file with BASIC_INFO_CHANGE\n        usn_matches = usn_df[\n            (usn_df[\"Name\"] == filename) &\n            (usn_df[\"UpdateReasons\"].str.contains(\"BASIC_INFO_CHANGE\", na=False))\n        ]\n\n        if not usn_matches.empty:\n            entry[\"usn_corroboration\"] = True\n            entry[\"usn_change_times\"] = usn_matches[\"UpdateTimestamp\"].tolist()\n            entry[\"highest_confidence\"] = \"critical\"\n            corroborated.append(entry)\n            print(f\"[CORROBORATED] {filename} - USN Journal confirms \"\n                  f\"BASIC_INFO_CHANGE at {usn_matches['UpdateTimestamp'].iloc[0]}\")\n\n    return corroborated\n\n# Parse USN Journal (use MFTECmd or ANJP)\n# MFTECmd.exe -f \"$J\" --csv D:\\Evidence\\Parsed\\ --csvf usn_parsed.csv\n```\n\n### Step 5: Check ShimCache and Amcache for Timeline Validation\n\n```python\ndef check_shimcache_timeline(stomped_files, shimcache_csv):\n    \"\"\"Validate timestamps against ShimCache (AppCompatCache) entries.\n\n    ShimCache records the last modification time of executables\n    independently of NTFS timestamps, providing another corroboration point.\n    \"\"\"\n    shim_df = pd.read_csv(shimcache_csv, low_memory=False)\n    shim_df[\"LastModifiedTimeUTC\"] = pd.to_datetime(\n        shim_df[\"LastModifiedTimeUTC\"], errors=\"coerce\"\n    )\n\n    for entry in stomped_files:\n        filepath = entry[\"file_path\"]\n        shim_match = shim_df[\n            shim_df[\"Path\"].str.lower() == filepath.lower()\n        ]\n\n        if not shim_match.empty:\n            shim_time = shim_match[\"LastModifiedTimeUTC\"].iloc[0]\n            si_modified = pd.to_datetime(entry.get(\"si_created\"))\n\n            if pd.notna(shim_time) and pd.notna(si_modified):\n                delta = abs((shim_time - si_modified).days)\n                if delta > 30:\n                    entry[\"shimcache_mismatch\"] = True\n                    entry[\"shimcache_time\"] = str(shim_time)\n                    print(f\"[SHIMCACHE MISMATCH] {filepath}\")\n                    print(f\"  SI timestamp: {si_modified}\")\n                    print(f\"  ShimCache timestamp: {shim_time}\")\n                    print(f\"  Delta: {delta} days\")\n\n    return stomped_files\n```\n\n### Step 6: Generate a Timestomping Detection Report\n\n```python\nimport json\n\ndef generate_report(stomped_files, output_path):\n    \"\"\"Generate a structured JSON report of all timestomping detections.\"\"\"\n    report = {\n        \"report_title\": \"Timestomping Detection Analysis\",\n        \"generated_at\": datetime.utcnow().isoformat() + \"Z\",\n        \"mitre_technique\": \"T1070.006 - Indicator Removal: Timestomp\",\n        \"total_suspicious_files\": len(stomped_files),\n        \"critical_findings\": len([f for f in stomped_files if f[\"highest_confidence\"] == \"critical\"]),\n        \"high_findings\": len([f for f in stomped_files if f[\"highest_confidence\"] == \"high\"]),\n        \"medium_findings\": len([f for f in stomped_files if f[\"highest_confidence\"] == \"medium\"]),\n        \"findings\": stomped_files,\n    }\n\n    with open(output_path, \"w\") as f:\n        json.dump(report, f, indent=2, default=str)\n    print(f\"Report written to {output_path}\")\n    print(f\"  Critical: {report['critical_findings']}\")\n    print(f\"  High: {report['high_findings']}\")\n    print(f\"  Medium: {report['medium_findings']}\")\n\ngenerate_report(stomped_files, \"D:\\\\Evidence\\\\timestomping_report.json\")\n```\n\n## Verification\n\n- Confirm MFTECmd parses the $MFT without errors and produces both 0x10 (SI) and 0x30 (FN) timestamp columns\n- Create a test file and use a timestomping tool (e.g., NTimeStomp) in a lab to verify the detection logic catches the manipulation\n- Validate that the nanosecond-zeroed check does not produce excessive false positives on files created by installers that legitimately set timestamps\n- Cross-reference flagged files with the USN Journal to confirm BASIC_INFO_CHANGE events exist at the expected times\n- Verify ShimCache and Amcache timestamps provide independent corroboration of timeline inconsistencies\n- Test against known-clean system images to establish a false-positive baseline (some backup\u002Fimaging software legitimately resets timestamps)\n- Confirm the detection pipeline correctly handles deleted MFT entries (InUse=false) which may contain evidence of timestomped files that were later removed\n","# Hunting for Defense Evasion via Timestomping\n\nDetect timestamp manipulation by analyzing NTFS MFT entries for\ndiscrepancies between $STANDARD_INFORMATION and $FILE_NAME attributes.\n\n## When to Use\n\n- Investigating suspected anti-forensic activity where an adversary may have altered file timestamps to blend malware into legitimate directories\n- Threat hunting for defense evasion (MITRE ATT&CK T1070.006) across compromised Windows systems\n- Validating timeline integrity during forensic examinations of disk images or live acquisitions\n- Triaging suspicious files that appear to have creation dates older than the OS installation or inconsistent with known deployment timelines\n- Detecting tools like Timestomp (Metasploit), NTimeStomp, SetMACE, or PowerShell Set-ItemProperty used to alter timestamps\n- Building automated detection pipelines that flag temporal anomalies in MFT data for SOC analysts\n\n**Do not use** as the sole detection method; advanced adversaries can manipulate both $STANDARD_INFORMATION and $FILE_NAME timestamps (though the latter requires raw disk access and is much harder). Combine with USN Journal, $LogFile, and ShimCache\u002FAmcache analysis for corroboration.\n\n## Prerequisites\n\n- Raw $MFT file extracted from a Windows system (via FTK Imager, KAPE, or live extraction)\n- `MFTECmd` (Eric Zimmerman tool) or `analyzeMFT` for MFT parsing\n- Python 3.8+ with `pandas` for analysis\n- Optional: `mft` Python library (`pip install mft`) for programmatic MFT parsing\n- Optional: KAPE (Kroll Artifact Parser and Extractor) for automated artifact collection\n- Timeline Explorer or Excel for visual analysis of parsed MFT output\n\n## Workflow\n\n### Step 1: Extract the $MFT from a Live System or Disk Image\n\n```powershell\n# Method 1: Using KAPE to collect MFT and related artifacts\n.\\kape.exe --tsource C: --tdest D:\\Evidence\\MFT_Collection --target !SANS_Triage\n\n# Method 2: Using FTK Imager CLI to extract $MFT\nftkimager.exe \\\\.\\C: D:\\Evidence\\mft_raw.bin --e01 --include $MFT\n\n# Method 3: Raw copy using RawCopy (handles locked NTFS system files)\nRawCopy.exe \u002FFileNamePath:C:0 \u002FOutputPath:D:\\Evidence\\ \u002FOutputName:$MFT\n```\n\n```bash\n# Method 4: On a mounted forensic image in Linux\nsudo mount -o ro,norecovery \u002Fdev\u002Fsdb1 \u002Fmnt\u002Fevidence\nsudo icat -o 2048 \u002Fdev\u002Fsdb 0 > \u002Fmnt\u002Foutput\u002F$MFT\n\n# Method 5: Using sleuthkit to extract MFT from disk image\nicat -o 2048 evidence.E01 0 > extracted_MFT\n```\n\n### Step 2: Parse the MFT with MFTECmd\n\nUse Eric Zimmerman's MFTECmd to produce a CSV with both $STANDARD_INFORMATION and $FILE_NAME timestamps:\n\n```powershell\n# Parse MFT to CSV with all timestamp columns\nMFTECmd.exe -f \"D:\\Evidence\\$MFT\" --csv D:\\Evidence\\Parsed\\ --csvf mft_parsed.csv\n\n# The output CSV contains these critical columns:\n# Created0x10         - $STANDARD_INFORMATION Created timestamp\n# LastModified0x10    - $STANDARD_INFORMATION Modified timestamp\n# LastAccess0x10      - $STANDARD_INFORMATION Accessed timestamp\n# LastRecordChange0x10 - $STANDARD_INFORMATION Entry Modified timestamp\n# Created0x30         - $FILE_NAME Created timestamp\n# LastModified0x30    - $FILE_NAME Modified timestamp\n# LastAccess0x30      - $FILE_NAME Accessed timestamp\n# LastRecordChange0x30 - $FILE_NAME Entry Modified timestamp\n```\n\n### Step 3: Detect Timestomping via SI vs FN Comparison\n\nThe core detection: $STANDARD_INFORMATION timestamps are easily modified by user-mode tools, but $FILE_NAME timestamps are updated only by the NTFS driver (kernel-mode). When SI timestamps are OLDER than FN timestamps, timestomping is likely:\n\n```python\nimport pandas as pd\nfrom datetime import datetime, timedelta\n\ndef load_mft_data(csv_path):\n    \"\"\"Load MFTECmd parsed CSV output.\"\"\"\n    df = pd.read_csv(csv_path, low_memory=False)\n\n    # Parse timestamp columns\n    timestamp_cols = [\n        \"Created0x10\", \"LastModified0x10\", \"LastAccess0x10\", \"LastRecordChange0x10\",\n        \"Created0x30\", \"LastModified0x30\", \"LastAccess0x30\", \"LastRecordChange0x30\"\n    ]\n\n    for col in timestamp_cols:\n        if col in df.columns:\n            df[col] = pd.to_datetime(df[col], errors=\"coerce\")\n\n    return df\n\ndef detect_timestomping(df):\n    \"\"\"Detect timestamp manipulation by comparing SI and FN attributes.\n\n    Key indicators:\n    1. SI Created \u003C FN Created (SI timestamp pushed back in time)\n    2. SI timestamps have nanoseconds = 0000000 (tool artifact)\n    3. SI Created \u003C FN Entry Modified (impossible under normal NTFS behavior)\n    4. Large gap between SI and FN timestamps\n    \"\"\"\n    results = []\n\n    for idx, row in df.iterrows():\n        si_created = row.get(\"Created0x10\")\n        fn_created = row.get(\"Created0x30\")\n        si_modified = row.get(\"LastModified0x10\")\n        fn_modified = row.get(\"LastModified0x30\")\n        si_entry = row.get(\"LastRecordChange0x10\")\n        fn_entry = row.get(\"LastRecordChange0x30\")\n\n        if pd.isna(si_created) or pd.isna(fn_created):\n            continue\n\n        filepath = row.get(\"FileName\", \"unknown\")\n        parent_path = row.get(\"ParentPath\", \"\")\n        full_path = f\"{parent_path}\\\\{filepath}\" if parent_path else filepath\n        indicators = []\n\n        # Detection 1: SI Created is BEFORE FN Created\n        # Under normal NTFS operations, SI Created >= FN Created\n        if si_created \u003C fn_created:\n            delta = fn_created - si_created\n            indicators.append({\n                \"check\": \"SI_Created \u003C FN_Created\",\n                \"si_value\": str(si_created),\n                \"fn_value\": str(fn_created),\n                \"delta\": str(delta),\n                \"confidence\": \"high\"\n            })\n\n        # Detection 2: SI Modified is BEFORE FN Created\n        # A file cannot be modified before it was created\n        if pd.notna(si_modified) and si_modified \u003C fn_created:\n            indicators.append({\n                \"check\": \"SI_Modified \u003C FN_Created\",\n                \"si_value\": str(si_modified),\n                \"fn_value\": str(fn_created),\n                \"confidence\": \"high\"\n            })\n\n        # Detection 3: Nanosecond precision check\n        # Many timestomping tools set timestamps with zero nanoseconds\n        if pd.notna(si_created):\n            si_created_str = str(si_created)\n            if \".000000\" in si_created_str or si_created_str.endswith(\"00:00:00\"):\n                # Check if FN has normal nanosecond precision\n                fn_str = str(fn_created)\n                if \".000000\" not in fn_str:\n                    indicators.append({\n                        \"check\": \"SI_nanoseconds_zeroed\",\n                        \"si_value\": si_created_str,\n                        \"fn_value\": fn_str,\n                        \"confidence\": \"medium\"\n                    })\n\n        # Detection 4: Large time gap between SI and FN\n        # Normal gap is seconds to minutes, not years\n        if abs((si_created - fn_created).days) > 365:\n            indicators.append({\n                \"check\": \"SI_FN_gap_exceeds_1_year\",\n                \"si_value\": str(si_created),\n                \"fn_value\": str(fn_created),\n                \"delta_days\": abs((si_created - fn_created).days),\n                \"confidence\": \"high\"\n            })\n\n        # Detection 5: SI Entry Modified much later than SI Created\n        # Indicates the SI attribute was rewritten\n        if pd.notna(si_entry) and pd.notna(si_created):\n            entry_delta = si_entry - si_created\n            if entry_delta.days > 365 * 5:  # Entry modified years after creation\n                indicators.append({\n                    \"check\": \"SI_entry_modified_years_after_creation\",\n                    \"si_created\": str(si_created),\n                    \"si_entry_modified\": str(si_entry),\n                    \"confidence\": \"medium\"\n                })\n\n        if indicators:\n            results.append({\n                \"file_path\": full_path,\n                \"entry_number\": row.get(\"EntryNumber\", \"\"),\n                \"in_use\": row.get(\"InUse\", True),\n                \"si_created\": str(si_created),\n                \"fn_created\": str(fn_created),\n                \"indicators\": indicators,\n                \"highest_confidence\": max(i[\"confidence\"] for i in indicators),\n            })\n\n    return results\n\n# Run detection\ndf = load_mft_data(\"D:\\\\Evidence\\\\Parsed\\\\mft_parsed.csv\")\nstomped_files = detect_timestomping(df)\n\nprint(f\"\\nTimestomping Detection Results\")\nprint(f\"{'='*60}\")\nprint(f\"Total MFT entries analyzed: {len(df)}\")\nprint(f\"Suspicious entries found: {len(stomped_files)}\")\nprint()\n\nfor entry in sorted(stomped_files, key=lambda x: x[\"highest_confidence\"], reverse=True):\n    print(f\"[{entry['highest_confidence'].upper()}] {entry['file_path']}\")\n    print(f\"  SI Created: {entry['si_created']}\")\n    print(f\"  FN Created: {entry['fn_created']}\")\n    for ind in entry[\"indicators\"]:\n        print(f\"  Check: {ind['check']} (confidence: {ind['confidence']})\")\n    print()\n```\n\n### Step 4: Corroborate with USN Journal Analysis\n\nThe USN Journal records metadata change events that persist even after timestomping:\n\n```python\ndef correlate_with_usn_journal(stomped_files, usn_csv_path):\n    \"\"\"Cross-reference timestomped files with USN Journal entries.\n\n    The USN Journal records a BASIC_INFO_CHANGE reason when timestamps\n    are modified, providing corroborating evidence of timestomping.\n    \"\"\"\n    usn_df = pd.read_csv(usn_csv_path, low_memory=False)\n    usn_df[\"UpdateTimestamp\"] = pd.to_datetime(usn_df[\"UpdateTimestamp\"], errors=\"coerce\")\n\n    corroborated = []\n    for entry in stomped_files:\n        filename = entry[\"file_path\"].split(\"\\\\\")[-1]\n\n        # Find USN entries for this file with BASIC_INFO_CHANGE\n        usn_matches = usn_df[\n            (usn_df[\"Name\"] == filename) &\n            (usn_df[\"UpdateReasons\"].str.contains(\"BASIC_INFO_CHANGE\", na=False))\n        ]\n\n        if not usn_matches.empty:\n            entry[\"usn_corroboration\"] = True\n            entry[\"usn_change_times\"] = usn_matches[\"UpdateTimestamp\"].tolist()\n            entry[\"highest_confidence\"] = \"critical\"\n            corroborated.append(entry)\n            print(f\"[CORROBORATED] {filename} - USN Journal confirms \"\n                  f\"BASIC_INFO_CHANGE at {usn_matches['UpdateTimestamp'].iloc[0]}\")\n\n    return corroborated\n\n# Parse USN Journal (use MFTECmd or ANJP)\n# MFTECmd.exe -f \"$J\" --csv D:\\Evidence\\Parsed\\ --csvf usn_parsed.csv\n```\n\n### Step 5: Check ShimCache and Amcache for Timeline Validation\n\n```python\ndef check_shimcache_timeline(stomped_files, shimcache_csv):\n    \"\"\"Validate timestamps against ShimCache (AppCompatCache) entries.\n\n    ShimCache records the last modification time of executables\n    independently of NTFS timestamps, providing another corroboration point.\n    \"\"\"\n    shim_df = pd.read_csv(shimcache_csv, low_memory=False)\n    shim_df[\"LastModifiedTimeUTC\"] = pd.to_datetime(\n        shim_df[\"LastModifiedTimeUTC\"], errors=\"coerce\"\n    )\n\n    for entry in stomped_files:\n        filepath = entry[\"file_path\"]\n        shim_match = shim_df[\n            shim_df[\"Path\"].str.lower() == filepath.lower()\n        ]\n\n        if not shim_match.empty:\n            shim_time = shim_match[\"LastModifiedTimeUTC\"].iloc[0]\n            si_modified = pd.to_datetime(entry.get(\"si_created\"))\n\n            if pd.notna(shim_time) and pd.notna(si_modified):\n                delta = abs((shim_time - si_modified).days)\n                if delta > 30:\n                    entry[\"shimcache_mismatch\"] = True\n                    entry[\"shimcache_time\"] = str(shim_time)\n                    print(f\"[SHIMCACHE MISMATCH] {filepath}\")\n                    print(f\"  SI timestamp: {si_modified}\")\n                    print(f\"  ShimCache timestamp: {shim_time}\")\n                    print(f\"  Delta: {delta} days\")\n\n    return stomped_files\n```\n\n### Step 6: Generate a Timestomping Detection Report\n\n```python\nimport json\n\ndef generate_report(stomped_files, output_path):\n    \"\"\"Generate a structured JSON report of all timestomping detections.\"\"\"\n    report = {\n        \"report_title\": \"Timestomping Detection Analysis\",\n        \"generated_at\": datetime.utcnow().isoformat() + \"Z\",\n        \"mitre_technique\": \"T1070.006 - Indicator Removal: Timestomp\",\n        \"total_suspicious_files\": len(stomped_files),\n        \"critical_findings\": len([f for f in stomped_files if f[\"highest_confidence\"] == \"critical\"]),\n        \"high_findings\": len([f for f in stomped_files if f[\"highest_confidence\"] == \"high\"]),\n        \"medium_findings\": len([f for f in stomped_files if f[\"highest_confidence\"] == \"medium\"]),\n        \"findings\": stomped_files,\n    }\n\n    with open(output_path, \"w\") as f:\n        json.dump(report, f, indent=2, default=str)\n    print(f\"Report written to {output_path}\")\n    print(f\"  Critical: {report['critical_findings']}\")\n    print(f\"  High: {report['high_findings']}\")\n    print(f\"  Medium: {report['medium_findings']}\")\n\ngenerate_report(stomped_files, \"D:\\\\Evidence\\\\timestomping_report.json\")\n```\n\n## Verification\n\n- Confirm MFTECmd parses the $MFT without errors and produces both 0x10 (SI) and 0x30 (FN) timestamp columns\n- Create a test file and use a timestomping tool (e.g., NTimeStomp) in a lab to verify the detection logic catches the manipulation\n- Validate that the nanosecond-zeroed check does not produce excessive false positives on files created by installers that legitimately set timestamps\n- Cross-reference flagged files with the USN Journal to confirm BASIC_INFO_CHANGE events exist at the expected times\n- Verify ShimCache and Amcache timestamps provide independent corroboration of timeline inconsistencies\n- Test against known-clean system images to establish a false-positive baseline (some backup\u002Fimaging software legitimately resets timestamps)\n- Confirm the detection pipeline correctly handles deleted MFT entries (InUse=false) which may contain evidence of timestomped files that were later removed\n",{"name":5,"tags":25,"author":30,"domain":31,"license":15,"version":32,"nist_csf":33,"subdomain":38,"description":39,"mitre_attack":40,"d3fend_techniques":46},[26,27,28,29],"timestomping","ntfs-forensics","mft-analysis","defense-evasion","mahipal","cybersecurity","1.0",[34,35,36,37],"DE.CM-01","DE.AE-02","DE.AE-07","ID.RA-05","threat-hunting","Detect NTFS timestamp manipulation (MITRE T1070.006) by comparing $STANDARD_INFORMATION vs $FILE_NAME timestamps in the MFT. Uses analyzeMFT and Python to identify files with anomalous temporal patterns indicating anti-forensic timestomping activity.\n",[41,42,43,44,45],"T1046","T1057","T1082","T1083","T1027",[47,48,49,50,51],"File Metadata Consistency Validation","Content Format Conversion","File Content Analysis","Platform Hardening","File Format Verification","main","8a3b3de73262a4c4db64523949360f3c599c2fb1","Anthropic-Cybersecurity-Skills-main\u002Fskills\u002Fhunting-for-defense-evasion-via-timestomping",0,"https:\u002F\u002Fgithub.com\u002FSaiVatsal\u002FSkills-I-Use","https:\u002F\u002Fgithub.com\u002FSaiVatsal","https:\u002F\u002Fsaivatsal.github.io\u002FPortfolio\u002F","The Longer It Takes The Stronger It Becomes ","2026-09-21 22:45:58",{"source":8,"skillName":5,"commands":62,"prompt":72,"zipAvailable":73},[63,66,69],{"tool":64,"command":65},"npx","npx skills add SaiVatsal\u002FSkills-I-Use --skill hunting-for-defense-evasion-via-timestomping",{"tool":67,"command":68},"bunx","bunx skills add SaiVatsal\u002FSkills-I-Use --skill hunting-for-defense-evasion-via-timestomping",{"tool":70,"command":71},"pnpm","pnpm dlx skills add SaiVatsal\u002FSkills-I-Use --skill hunting-for-defense-evasion-via-timestomping","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FSaiVatsal\u002FSkills-I-Use\u002Fblob\u002Fmain\u002FAnthropic-Cybersecurity-Skills-main\u002Fskills\u002Fhunting-for-defense-evasion-via-timestomping\u002FSKILL.md",true,[75,79,85],{"path":76,"resourceType":76,"resourceTypeDesc":77,"sizeBytes":78,"sourceHtmlUrl":16},"LICENSE","许可证",11255,{"path":80,"resourceType":81,"resourceTypeDesc":82,"sizeBytes":83,"sourceHtmlUrl":84},"references\u002Fapi-reference.md","REFERENCE","参考文档",1964,"https:\u002F\u002Fgithub.com\u002FSaiVatsal\u002FSkills-I-Use\u002Fblob\u002Fmain\u002FAnthropic-Cybersecurity-Skills-main\u002Fskills\u002Fhunting-for-defense-evasion-via-timestomping\u002Freferences\u002Fapi-reference.md",{"path":86,"resourceType":87,"resourceTypeDesc":88,"sizeBytes":89,"sourceHtmlUrl":90},"scripts\u002Fagent.py","SCRIPT","脚本",8161,"https:\u002F\u002Fgithub.com\u002FSaiVatsal\u002FSkills-I-Use\u002Fblob\u002Fmain\u002FAnthropic-Cybersecurity-Skills-main\u002Fskills\u002Fhunting-for-defense-evasion-via-timestomping\u002Fscripts\u002Fagent.py",[92,100,108,117,124,131],{"skillNo":93,"name":94,"nameZh":6,"description":95,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":96,"sourceHtmlUrl":97,"categories":98,"keywords":99,"publishedAt":20},"01M7DJZP6E6KMBQV4CZSDPZEZ8","webapp-testing","Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.","https:\u002F\u002Fgithub.com\u002FSaiVatsal\u002FSkills-I-Use\u002Fblob\u002Fmain\u002Fwebapp-testing\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002FSaiVatsal\u002FSkills-I-Use\u002Fblob\u002Fmain\u002Fwebapp-testing\u002FSKILL.md",[],[],{"skillNo":101,"name":102,"nameZh":6,"description":103,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":104,"sourceHtmlUrl":105,"categories":106,"keywords":107,"publishedAt":20},"01M7DJZFTS5TS06K2TV3MDTE67","web-artifacts-builder","Suite of tools for creating elaborate, multi-component claude.ai HTML artifacts using modern frontend web technologies (React, Tailwind CSS, shadcn\u002Fui). Use for complex artifacts requiring state management, routing, or shadcn\u002Fui components - not for simple single-file HTML\u002FJSX artifacts.","https:\u002F\u002Fgithub.com\u002FSaiVatsal\u002FSkills-I-Use\u002Fblob\u002Fmain\u002Fweb-artifacts-builder\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002FSaiVatsal\u002FSkills-I-Use\u002Fblob\u002Fmain\u002Fweb-artifacts-builder\u002FSKILL.md",[],[],{"skillNo":109,"name":110,"nameZh":6,"description":111,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":112,"licenseFileUrl":113,"sourceHtmlUrl":114,"categories":115,"keywords":116,"publishedAt":20},"01M7DJRK4SRQ908F2TJM6EZ7EV","ui-styling","Create beautiful, accessible user interfaces with shadcn\u002Fui components (built on Radix UI + Tailwind), Tailwind CSS utility-first styling, and canvas-based visual designs. Use when building user interfaces, implementing design systems, creating responsive layouts, adding accessible components (dialogs, dropdowns, forms, tables), customizing themes and colors, implementing dark mode, generating visual designs and posters, or establishing consistent styling patterns across applications.","MIT","https:\u002F\u002Fgithub.com\u002FSaiVatsal\u002FSkills-I-Use\u002Fblob\u002Fmain\u002Fui-ux-pro-max-skill-main\u002Fcli\u002Fassets\u002Fskills\u002Fui-styling\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002FSaiVatsal\u002FSkills-I-Use\u002Fblob\u002Fmain\u002Fui-ux-pro-max-skill-main\u002Fcli\u002Fassets\u002Fskills\u002Fui-styling\u002FSKILL.md",[],[],{"skillNo":118,"name":119,"nameZh":6,"description":120,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":112,"licenseFileUrl":6,"sourceHtmlUrl":121,"categories":122,"keywords":123,"publishedAt":20},"01M7DJR902059VEQP23PVM2WA0","design","Comprehensive design skill: brand identity, design tokens, UI styling, logo generation (55 styles, Gemini AI), corporate identity program (50 deliverables, CIP mockups), HTML presentations (Chart.js), banner design (22 styles, social\u002Fads\u002Fweb\u002Fprint), icon design (15 styles, SVG, Gemini 3.1 Pro), social photos (HTML→screenshot, multi-platform). Actions: design logo, create CIP, generate mockups, build slides, design banner, generate icon, create social photos, social media images, brand identity, design system. Platforms: Facebook, Twitter, LinkedIn, YouTube, Instagram, Pinterest, TikTok, Threads, Google Ads.","https:\u002F\u002Fgithub.com\u002FSaiVatsal\u002FSkills-I-Use\u002Fblob\u002Fmain\u002Fui-ux-pro-max-skill-main\u002Fcli\u002Fassets\u002Fskills\u002Fdesign\u002FSKILL.md",[],[],{"skillNo":125,"name":126,"nameZh":6,"description":127,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":112,"licenseFileUrl":6,"sourceHtmlUrl":128,"categories":129,"keywords":130,"publishedAt":20},"01M7DJR56QF5N6XYTCPCFHFMNP","design-system","Token architecture, component specifications, and slide generation. Three-layer tokens (primitive→semantic→component), CSS variables, spacing\u002Ftypography scales, component specs, strategic slide creation. Use for design tokens, systematic design, brand-compliant presentations.","https:\u002F\u002Fgithub.com\u002FSaiVatsal\u002FSkills-I-Use\u002Fblob\u002Fmain\u002Fui-ux-pro-max-skill-main\u002Fcli\u002Fassets\u002Fskills\u002Fdesign-system\u002FSKILL.md",[],[],{"skillNo":132,"name":133,"nameZh":6,"description":134,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":112,"licenseFileUrl":6,"sourceHtmlUrl":135,"categories":136,"keywords":137,"publishedAt":20},"01M7DJQXB6M0SFF7NX8J5N01AH","banner-design","Design banners for social media, ads, website heroes, creative assets, and print. Multiple art direction options with AI-generated visuals. Actions: design, create, generate banner. Platforms: Facebook, Twitter\u002FX, LinkedIn, YouTube, Instagram, Google Display, website hero, print. Styles: minimalist, gradient, bold typography, photo-based, illustrated, geometric, retro, glassmorphism, 3D, neon, duotone, editorial, collage. Uses ui-ux-pro-max, frontend-design, ai-artist, ai-multimodal skills.","https:\u002F\u002Fgithub.com\u002FSaiVatsal\u002FSkills-I-Use\u002Fblob\u002Fmain\u002Fui-ux-pro-max-skill-main\u002Fcli\u002Fassets\u002Fskills\u002Fbanner-design\u002FSKILL.md",[],[]]