[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7B6SMFZNF9505H5HNMSDX2P":3,"skill-same:01M7B6SMFZNF9505H5HNMSDX2P":87},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":15,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":51,"commitSha":52,"skillDirectory":53,"forksCount":13,"repositoryHtmlUrl":54,"repositoryHomepageUrl":6,"ownerHtmlUrl":55,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":56,"install":57,"resources":70},"01M7B6SMFZNF9505H5HNMSDX2P","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.","vikasvardhanv\u002Fjerry_skills","vikasvardhanv","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F99010657?v=4","01M7B2B0VN78W7529RQX5BR6DZ","01M7B2B0WDNTXJHRK3QNPNWRP6",0,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fcurated_premium_skills\u002FAnthropic-Cybersecurity-Skills\u002Fskills\u002Fhunting-for-defense-evasion-via-timestomping\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fcurated_premium_skills\u002FAnthropic-Cybersecurity-Skills\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":24,"author":29,"domain":30,"license":14,"version":31,"nist_csf":32,"subdomain":37,"description":38,"mitre_attack":39,"d3fend_techniques":45},[25,26,27,28],"timestomping","ntfs-forensics","mft-analysis","defense-evasion","mahipal","cybersecurity","1.0",[33,34,35,36],"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",[40,41,42,43,44],"T1046","T1057","T1082","T1083","T1027",[46,47,48,49,50],"File Metadata Consistency Validation","Content Format Conversion","File Content Analysis","Platform Hardening","File Format Verification","main","1eb986d0b0ecc180291597e08eb5a58288843536","skills\u002Fcurated_premium_skills\u002FAnthropic-Cybersecurity-Skills\u002Fskills\u002Fhunting-for-defense-evasion-via-timestomping","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv","2026-08-25 13:16:33",{"source":8,"skillName":5,"commands":58,"prompt":68,"zipAvailable":69},[59,62,65],{"tool":60,"command":61},"npx","npx skills add vikasvardhanv\u002Fjerry_skills --skill hunting-for-defense-evasion-via-timestomping",{"tool":63,"command":64},"bunx","bunx skills add vikasvardhanv\u002Fjerry_skills --skill hunting-for-defense-evasion-via-timestomping",{"tool":66,"command":67},"pnpm","pnpm dlx skills add vikasvardhanv\u002Fjerry_skills --skill hunting-for-defense-evasion-via-timestomping","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fcurated_premium_skills\u002FAnthropic-Cybersecurity-Skills\u002Fskills\u002Fhunting-for-defense-evasion-via-timestomping\u002FSKILL.md",true,[71,75,81],{"path":72,"resourceType":72,"resourceTypeDesc":73,"sizeBytes":74,"sourceHtmlUrl":15},"LICENSE","许可证",11255,{"path":76,"resourceType":77,"resourceTypeDesc":78,"sizeBytes":79,"sourceHtmlUrl":80},"references\u002Fapi-reference.md","REFERENCE","参考文档",1964,"https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fcurated_premium_skills\u002FAnthropic-Cybersecurity-Skills\u002Fskills\u002Fhunting-for-defense-evasion-via-timestomping\u002Freferences\u002Fapi-reference.md",{"path":82,"resourceType":83,"resourceTypeDesc":84,"sizeBytes":85,"sourceHtmlUrl":86},"scripts\u002Fagent.py","SCRIPT","脚本",8161,"https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fcurated_premium_skills\u002FAnthropic-Cybersecurity-Skills\u002Fskills\u002Fhunting-for-defense-evasion-via-timestomping\u002Fscripts\u002Fagent.py",[88,96,103,110,117,124],{"skillNo":89,"name":90,"nameZh":6,"description":91,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":92,"licenseFileUrl":6,"sourceHtmlUrl":93,"categories":94,"keywords":95,"publishedAt":19},"01M7BESR1CJ3H5SP9XM8KYJZ9W","syllabus","Generates a curated supplementary reading list from any course syllabus using Consensus academic search. Grill-me intake (syllabus input format + course audience + year range) plus a grouping forcing-options checkpoint before any search runs — so the reading list matches the course's level and recency need. Parses the syllabus to extract topics and learning outcomes, searches Consensus for recent peer-reviewed papers per topic, and produces a professionally formatted .docx with clickable Consensus links, plain-language summaries calibrated to audience level, and Bloom-higher-order discussion questions tied to course learning goals. Use when the user uploads a syllabus, course outline, or curriculum document and wants supplementary readings (e.g., 'create a reading list from this syllabus', 'find recent papers for my course') — even casual mentions with a syllabus attached should trigger this skill.","MIT","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fresearch\u002Fsyllabus\u002Fskills\u002Fsyllabus\u002FSKILL.md",[],[],{"skillNo":97,"name":98,"nameZh":6,"description":99,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":92,"licenseFileUrl":6,"sourceHtmlUrl":100,"categories":101,"keywords":102,"publishedAt":19},"01M7BES1YA6R97W7QPMFFM1PED","pulse","Multi-source recency research skill that takes the pulse of any topic across Reddit, Hacker News, the open web, and optionally X\u002FTwitter within a configurable recent window (default 30 days). Forcing intake clarifies topic specificity, angle (trend\u002Fsentiment\u002Fproblems\u002Fopportunities\u002Fcomparison), time window, and platform scope before searching. Returns a synthesized briefing with citations, engagement metrics, and cross-platform pattern analysis. Use when the user requests multi-source recency intelligence on a topic (e.g., 'pulse on [topic]', 'what's happening with [topic]', 'what are people saying about [topic]', 'current conversation about [topic]', 'take the pulse of [topic]', 'trending: [topic]', 'find me info on [topic]'), and for competitor research, trend discovery, tool comparisons, and audience sentiment analysis.","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fresearch\u002Fpulse\u002Fskills\u002Fpulse\u002FSKILL.md",[],[],{"skillNo":104,"name":105,"nameZh":6,"description":106,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":92,"licenseFileUrl":6,"sourceHtmlUrl":107,"categories":108,"keywords":109,"publishedAt":19},"01M7BERNHYGY035AR00VRT03KE","patent","Patent prior-art and landscape intelligence skill — not generic patent help. Commits to one of five sub-use-cases via forcing intake (novelty search \u002F freedom-to-operate \u002F competitive landscape \u002F acquisition diligence \u002F litigation prior-art) before any search runs. Searches Google Patents, Espacenet, USPTO, and optionally Lens.org for citation-graph signals. Output is an editable Word document (.docx) with verdict, ranked closest art (claim-text extracted), CPC-class-aware landscape, family-resolved hits, geographic coverage, FTO flags where applicable, strategy recommendations, and full audit log. Use when the user asks for patent searching or analysis (e.g., 'prior art search for [invention]', 'freedom to operate analysis for [product]'). Produces search signal, not legal advice — always recommends consulting a patent attorney before filing or licensing decisions. Trademark, copyright, and trade-secret questions are out of scope.","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fresearch\u002Fpatent\u002Fskills\u002Fpatent\u002FSKILL.md",[],[],{"skillNo":111,"name":112,"nameZh":6,"description":113,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":92,"licenseFileUrl":6,"sourceHtmlUrl":114,"categories":115,"keywords":116,"publishedAt":19},"01M7BERCK1EAKTWW7R436WAR0J","notebooklm","Browser automation skill for controlling Google's NotebookLM. Use when the user wants anything done in NotebookLM (e.g., 'open NotebookLM', 'check my [name] notebook', 'ask my notebook about X', 'add [source] to NotebookLM', 'generate a Video Overview from my notebook', 'use NotebookLM Studio'). Handles reading and querying notebooks, adding sources (URLs, text, files, YouTube links, synthesized content), generating Studio outputs (Audio\u002FVideo Overviews, Mind Maps, Reports incl. Briefing Doc\u002FStudy Guide\u002FFAQ, Flashcards, Quiz, slide decks, infographics — discover the exact set from the live Studio panel; the UI evolves fast), and creating new notebooks. Requires browser automation environment — fails gracefully when unavailable.","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fresearch\u002Fnotebooklm\u002Fskills\u002Fnotebooklm\u002FSKILL.md",[],[],{"skillNo":118,"name":119,"nameZh":6,"description":120,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":92,"licenseFileUrl":6,"sourceHtmlUrl":121,"categories":122,"keywords":123,"publishedAt":19},"01M7BEQZAZAQRTXFJRY7RHV3TY","litreview","Academic literature orientation skill that searches papers via free keyless APIs (PubMed E-utilities + OpenAlex) by default — with the Consensus MCP as an optional enhancement lane when connected — builds a strategic search plan using PICO (default) or SPIDER \u002F Decomposition \u002F hybrid as fallbacks, and synthesizes findings into a formatted Word (.docx) research guide. Grill-me intake (research question specificity + framework hint + tentative depth) before the recon search; a second forcing checkpoint after Phase 2 confirms framework + sub-areas + depth before searches consume budget. Configurable depth (5\u002F10\u002F20 queries) controls coverage vs. speed. Output is a 'launching pad' — an orientation guide that lets a researcher dive in confidently, not a finished review. Use when the user starts literature-oriented research (e.g., 'litreview on [topic]', 'literature review on [topic]', 'I'm starting a literature review on X', 'I'm writing a paper on X', 'help me research X', 'I'm doing research on X', 'can you help me research X'). Do NOT use for single one-off paper searches wanting a quick list — that's a plain PubMed\u002FOpenAlex (or Consensus) query.","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fresearch\u002Flitreview\u002Fskills\u002Flitreview\u002FSKILL.md",[],[],{"skillNo":125,"name":126,"nameZh":6,"description":127,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":92,"licenseFileUrl":6,"sourceHtmlUrl":128,"categories":129,"keywords":130,"publishedAt":19},"01M7BEQKJ45K31QK5VRAQSVJCJ","grants","NIH grant research skill for clinical researchers. Grill-me intake (research idea + career stage + preliminary data + environment + submission posture + known institute targets) locks down the funding strategy before any search runs. Runs a 5-facet Consensus positioning analysis (with draft Significance\u002FInnovation language), maps the research to the right NIH institutes and study sections via RePORTER, finds NOSIs and funded overlap, and produces an editable Word document (.docx) with budget\u002Fscope-aware mechanism recommendations, submission timelines, and a mandatory program officer recommendation. Use when the user asks about research funding or makes any grant-related request (e.g., 'grants for [topic]', 'find grants for my research idea', 'what grants match my research', 'help me find NIH funding', 'grant opportunities for my research'). NIH-only scope — non-NIH funders (PCORI, DOD CDMRP, VA, foundations) are out of scope and flagged at intake.","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fresearch\u002Fgrants\u002Fskills\u002Fgrants\u002FSKILL.md",[],[]]