[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6GXZKMFNC1E60CFPKJ6DRZD":3,"skill-same:01M6GXZKMFNC1E60CFPKJ6DRZD":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":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":38,"linkOnly":39,"markdownContent":40,"markdownBody":41,"frontMatter":42,"refName":49,"commitSha":50,"skillDirectory":51,"forksCount":52,"repositoryHtmlUrl":53,"repositoryHomepageUrl":6,"ownerHtmlUrl":54,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":55,"install":56,"resources":69},"01M6GXZKMFNC1E60CFPKJ6DRZD","extracting-windows-event-logs-artifacts",null,"Extract, parse, and analyze Windows Event Logs (EVTX) using Chainsaw, Hayabusa, and EvtxECmd to detect lateral movement, persistence, and privilege escalation.","micsapp\u002Fmicstec-skills","micsapp","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F82411001?v=4","01M6GWCFQ6D3PV8EHNY62NN5VW","01M6GWCFVE1PA5HG0DKC7AMFJ3",4,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fmicsapp\u002Fmicstec-skills\u002Fblob\u002Fmaster\u002F_universal\u002Fcybersecurity-skills\u002Fskills\u002Fextracting-windows-event-logs-artifacts\u002FSKILL.md",[],[18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"windows","artifacts","logs","extracting","event","extracting windows event logs artifacts","privilege escalation","cybersecurity","lateral movement","detect","incident","Rules","analyze","hayabusa","chainsaw","evtx","windows-event-logs","sigma-rules","escalation","event-logs","2026-11-10 10:12:30",false,"---\nname: extracting-windows-event-logs-artifacts\ndescription: Extract, parse, and analyze Windows Event Logs (EVTX) using Chainsaw, Hayabusa, and EvtxECmd to detect lateral movement, persistence, and privilege escalation.\ndomain: cybersecurity\nsubdomain: digital-forensics\ntags: [forensics, windows-event-logs, evtx, chainsaw, hayabusa, sigma-rules, incident-response]\nversion: \"1.0\"\nauthor: mahipal\nlicense: Apache-2.0\n---\n\n# Extracting Windows Event Logs Artifacts\n\n## When to Use\n- When investigating security incidents on Windows systems through event log analysis\n- For detecting lateral movement, privilege escalation, and persistence mechanisms\n- When performing threat hunting across Windows event log data\n- During compliance audits requiring review of authentication and access events\n- When building forensic timelines from Windows system activity\n\n## Prerequisites\n- Windows Event Log files (EVTX format) from forensic image or live system\n- Chainsaw, Hayabusa, or EvtxECmd for parsing and detection\n- Sigma rules for automated threat detection\n- Understanding of critical Windows Event IDs\n- Python with python-evtx or evtx library for custom parsing\n- PowerShell for live system analysis (if applicable)\n\n## Workflow\n\n### Step 1: Collect Windows Event Log Files\n\n```bash\n# Extract EVTX files from forensic image\nmount -o ro,loop,offset=$((2048*512)) \u002Fcases\u002Fcase-2024-001\u002Fimages\u002Fevidence.dd \u002Fmnt\u002Fevidence\n\nmkdir -p \u002Fcases\u002Fcase-2024-001\u002Fevtx\u002F\ncp \u002Fmnt\u002Fevidence\u002FWindows\u002FSystem32\u002Fwinevt\u002FLogs\u002F*.evtx \u002Fcases\u002Fcase-2024-001\u002Fevtx\u002F\n\n# Key event logs to prioritize\n# Security.evtx - Authentication, authorization, audit events\n# System.evtx - System services, drivers, hardware events\n# Application.evtx - Application errors and events\n# Microsoft-Windows-Sysmon%4Operational.evtx - Detailed process\u002Fnetwork monitoring\n# Microsoft-Windows-PowerShell%4Operational.evtx - PowerShell activity\n# Microsoft-Windows-TerminalServices-LocalSessionManager%4Operational.evtx - RDP sessions\n# Microsoft-Windows-TaskScheduler%4Operational.evtx - Scheduled tasks\n# Microsoft-Windows-WinRM%4Operational.evtx - Windows Remote Management\n# Microsoft-Windows-Bits-Client%4Operational.evtx - BITS transfers\n# Microsoft-Windows-Windows Defender%4Operational.evtx - AV detections\n\n# List available log files and sizes\nls -lhS \u002Fcases\u002Fcase-2024-001\u002Fevtx\u002F | head -20\n\n# Hash for integrity\nsha256sum \u002Fcases\u002Fcase-2024-001\u002Fevtx\u002F*.evtx > \u002Fcases\u002Fcase-2024-001\u002Fevtx\u002Fevtx_hashes.txt\n```\n\n### Step 2: Run Chainsaw for Sigma-Based Detection\n\n```bash\n# Install Chainsaw\nwget https:\u002F\u002Fgithub.com\u002FWithSecureLabs\u002Fchainsaw\u002Freleases\u002Flatest\u002Fdownload\u002Fchainsaw_all_platforms+rules.zip\nunzip chainsaw_all_platforms+rules.zip -d \u002Fopt\u002Fchainsaw\n\n# Run Chainsaw with bundled Sigma rules\n\u002Fopt\u002Fchainsaw\u002Fchainsaw hunt \u002Fcases\u002Fcase-2024-001\u002Fevtx\u002F \\\n   -s \u002Fopt\u002Fchainsaw\u002Fsigma\u002Frules\u002F \\\n   --mapping \u002Fopt\u002Fchainsaw\u002Fmappings\u002Fsigma-event-logs-all.yml \\\n   --output \u002Fcases\u002Fcase-2024-001\u002Fanalysis\u002Fchainsaw_results.txt\n\n# Run with CSV output for easier analysis\n\u002Fopt\u002Fchainsaw\u002Fchainsaw hunt \u002Fcases\u002Fcase-2024-001\u002Fevtx\u002F \\\n   -s \u002Fopt\u002Fchainsaw\u002Fsigma\u002Frules\u002F \\\n   --mapping \u002Fopt\u002Fchainsaw\u002Fmappings\u002Fsigma-event-logs-all.yml \\\n   --csv \\\n   --output \u002Fcases\u002Fcase-2024-001\u002Fanalysis\u002Fchainsaw_results\u002F\n\n# Run with JSON output\n\u002Fopt\u002Fchainsaw\u002Fchainsaw hunt \u002Fcases\u002Fcase-2024-001\u002Fevtx\u002F \\\n   -s \u002Fopt\u002Fchainsaw\u002Fsigma\u002Frules\u002F \\\n   --mapping \u002Fopt\u002Fchainsaw\u002Fmappings\u002Fsigma-event-logs-all.yml \\\n   --json \\\n   --output \u002Fcases\u002Fcase-2024-001\u002Fanalysis\u002Fchainsaw_results.json\n\n# Search for specific keywords\n\u002Fopt\u002Fchainsaw\u002Fchainsaw search \u002Fcases\u002Fcase-2024-001\u002Fevtx\u002F \\\n   -s \"mimikatz\" --json\n\n# Search for specific event IDs\n\u002Fopt\u002Fchainsaw\u002Fchainsaw search \u002Fcases\u002Fcase-2024-001\u002Fevtx\u002F \\\n   -e 4688 --json | head -100\n```\n\n### Step 3: Run Hayabusa for Fast Timeline Generation\n\n```bash\n# Install Hayabusa\nwget https:\u002F\u002Fgithub.com\u002FYamato-Security\u002Fhayabusa\u002Freleases\u002Flatest\u002Fdownload\u002Fhayabusa-linux-x64-musl.zip\nunzip hayabusa-linux-x64-musl.zip -d \u002Fopt\u002Fhayabusa\n\n# Generate CSV timeline with all detection rules\n\u002Fopt\u002Fhayabusa\u002Fhayabusa csv-timeline \\\n   -d \u002Fcases\u002Fcase-2024-001\u002Fevtx\u002F \\\n   -o \u002Fcases\u002Fcase-2024-001\u002Fanalysis\u002Fhayabusa_timeline.csv \\\n   -p verbose\n\n# Generate JSON timeline\n\u002Fopt\u002Fhayabusa\u002Fhayabusa json-timeline \\\n   -d \u002Fcases\u002Fcase-2024-001\u002Fevtx\u002F \\\n   -o \u002Fcases\u002Fcase-2024-001\u002Fanalysis\u002Fhayabusa_timeline.json\n\n# Run with only critical and high severity detections\n\u002Fopt\u002Fhayabusa\u002Fhayabusa csv-timeline \\\n   -d \u002Fcases\u002Fcase-2024-001\u002Fevtx\u002F \\\n   -o \u002Fcases\u002Fcase-2024-001\u002Fanalysis\u002Fhayabusa_critical.csv \\\n   -p verbose \\\n   --min-level critical\n\n# Generate detection summary (metrics)\n\u002Fopt\u002Fhayabusa\u002Fhayabusa metrics \\\n   -d \u002Fcases\u002Fcase-2024-001\u002Fevtx\u002F \\\n   -o \u002Fcases\u002Fcase-2024-001\u002Fanalysis\u002Fhayabusa_metrics.csv\n\n# Logon summary\n\u002Fopt\u002Fhayabusa\u002Fhayabusa logon-summary \\\n   -d \u002Fcases\u002Fcase-2024-001\u002Fevtx\u002F \\\n   -o \u002Fcases\u002Fcase-2024-001\u002Fanalysis\u002Flogon_summary.csv\n```\n\n### Step 4: Parse Specific Critical Event IDs\n\n```bash\n# Extract authentication events with python-evtx\npip install evtx\n\npython3 \u003C\u003C 'PYEOF'\nimport json\nfrom evtx import PyEvtxParser\n\nparser = PyEvtxParser(\"\u002Fcases\u002Fcase-2024-001\u002Fevtx\u002FSecurity.evtx\")\n\n# Critical Event IDs mapping\ncritical_events = {\n    '4624': 'Successful Logon',\n    '4625': 'Failed Logon',\n    '4634': 'Logoff',\n    '4648': 'Explicit Credential Logon',\n    '4672': 'Special Privileges Assigned',\n    '4688': 'Process Created',\n    '4689': 'Process Exited',\n    '4697': 'Service Installed',\n    '4698': 'Scheduled Task Created',\n    '4720': 'User Account Created',\n    '4724': 'Password Reset Attempted',\n    '4728': 'Member Added to Global Group',\n    '4732': 'Member Added to Local Group',\n    '4756': 'Member Added to Universal Group',\n    '1102': 'Audit Log Cleared',\n    '4688': 'New Process Created'\n}\n\nresults = {eid: [] for eid in critical_events}\n\nfor record in parser.records_json():\n    data = json.loads(record['data'])\n    event_id = str(data['Event']['System']['EventID'])\n\n    if event_id in critical_events:\n        event_data = data['Event'].get('EventData', {})\n        results[event_id].append({\n            'timestamp': data['Event']['System']['TimeCreated']['#attributes']['SystemTime'],\n            'event_id': event_id,\n            'description': critical_events[event_id],\n            'data': event_data\n        })\n\n# Print summary\nfor eid, events in results.items():\n    if events:\n        print(f\"\\n[{eid}] {critical_events[eid]}: {len(events)} events\")\n        for e in events[:3]:\n            print(f\"  {e['timestamp']}: {json.dumps(e['data'], default=str)[:200]}\")\n        if len(events) > 3:\n            print(f\"  ... and {len(events)-3} more\")\n\n# Save full results\nwith open('\u002Fcases\u002Fcase-2024-001\u002Fanalysis\u002Fcritical_events.json', 'w') as f:\n    json.dump(results, f, indent=2, default=str)\nPYEOF\n```\n\n### Step 5: Detect Specific Attack Patterns\n\n```bash\n# Detect Pass-the-Hash (Logon Type 9 with NTLM)\npython3 \u003C\u003C 'PYEOF'\nimport json\nfrom evtx import PyEvtxParser\n\nparser = PyEvtxParser(\"\u002Fcases\u002Fcase-2024-001\u002Fevtx\u002FSecurity.evtx\")\n\nprint(\"=== PASS-THE-HASH INDICATORS ===\")\nprint(\"Looking for: Event 4624, Logon Type 9, NTLM authentication\\n\")\n\nfor record in parser.records_json():\n    data = json.loads(record['data'])\n    event_id = str(data['Event']['System']['EventID'])\n\n    if event_id == '4624':\n        event_data = data['Event'].get('EventData', {})\n        logon_type = str(event_data.get('LogonType', ''))\n        auth_package = str(event_data.get('AuthenticationPackageName', ''))\n        logon_process = str(event_data.get('LogonProcessName', ''))\n\n        # Pass-the-Hash indicators\n        if logon_type == '9' and 'NTLM' in auth_package:\n            timestamp = data['Event']['System']['TimeCreated']['#attributes']['SystemTime']\n            target = event_data.get('TargetUserName', 'Unknown')\n            source_ip = event_data.get('IpAddress', 'N\u002FA')\n            print(f\"  [{timestamp}] PtH: User={target}, IP={source_ip}, Auth={auth_package}\")\n\n        # Network logon with NTLM (lateral movement)\n        if logon_type == '3' and 'NTLM' in auth_package:\n            timestamp = data['Event']['System']['TimeCreated']['#attributes']['SystemTime']\n            target = event_data.get('TargetUserName', 'Unknown')\n            source_ip = event_data.get('IpAddress', 'N\u002FA')\n            workstation = event_data.get('WorkstationName', 'N\u002FA')\n            print(f\"  [{timestamp}] Network NTLM: User={target}, IP={source_ip}, WS={workstation}\")\nPYEOF\n\n# Detect log clearing \u002F anti-forensics\npython3 \u003C\u003C 'PYEOF'\nimport json\nfrom evtx import PyEvtxParser\n\nfor log_file in ['Security.evtx', 'System.evtx']:\n    path = f\"\u002Fcases\u002Fcase-2024-001\u002Fevtx\u002F{log_file}\"\n    try:\n        parser = PyEvtxParser(path)\n        for record in parser.records_json():\n            data = json.loads(record['data'])\n            event_id = str(data['Event']['System']['EventID'])\n            if event_id in ('1102', '104'):  # Security log cleared, System log cleared\n                timestamp = data['Event']['System']['TimeCreated']['#attributes']['SystemTime']\n                print(f\"LOG CLEARED: [{timestamp}] EventID {event_id} in {log_file}\")\n    except Exception as e:\n        print(f\"Error parsing {log_file}: {e}\")\nPYEOF\n```\n\n## Key Concepts\n\n| Concept | Description |\n|---------|-------------|\n| EVTX format | Binary XML-based Windows Event Log format introduced in Vista\u002FServer 2008 |\n| Event ID | Numeric identifier for specific event types (e.g., 4624 = successful logon) |\n| Logon types | Classification of authentication methods (2=interactive, 3=network, 10=RDP) |\n| Sigma rules | Generic detection signatures that map to specific SIEM\u002Flog queries |\n| Sysmon | Microsoft system monitoring driver providing detailed process and network events |\n| Audit policy | GPO settings controlling which events Windows records |\n| Event forwarding (WEF) | Windows mechanism for centralized event log collection |\n| EVTX channels | Separate log files for different event categories and applications |\n\n## Tools & Systems\n\n| Tool | Purpose |\n|------|---------|\n| Chainsaw | Sigma-based EVTX analysis and threat hunting tool |\n| Hayabusa | Fast Windows Event Log forensic timeline generator |\n| EvtxECmd | Eric Zimmerman command-line EVTX parser with CSV\u002FJSON output |\n| python-evtx | Python library for EVTX file parsing |\n| LogParser | Microsoft SQL-like query engine for Windows logs |\n| Event Log Explorer | GUI tool for browsing and analyzing EVTX files |\n| KAPE | Automated triage collection including event logs |\n| Velociraptor | Endpoint agent with EVTX collection and hunting artifacts |\n\n## Common Scenarios\n\n**Scenario 1: Detecting Lateral Movement**\nFilter for Event 4624 with Logon Type 3 (network) and Type 10 (RDP), identify unusual source-destination pairs, check for Event 4648 (explicit credentials) indicating pass-the-hash, correlate with process creation events (4688) on target systems.\n\n**Scenario 2: Privilege Escalation Detection**\nSearch for Event 4672 (special privileges assigned) for unexpected users, check for Event 4728\u002F4732 (group membership changes) adding users to admin groups, look for Event 4697 (service installed) indicating new system-level access, correlate with 4720 (account creation).\n\n**Scenario 3: PowerShell Attack Detection**\nAnalyze PowerShell Operational log for Script Block Logging (Event 4104), search for encoded commands in Event 4688 (process creation with command line), detect AMSI bypass attempts, identify download cradles and invocation of known attack tools.\n\n**Scenario 4: Ransomware Incident Reconstruction**\nBuild timeline starting from initial access (4624 from external IP), trace privilege escalation through group membership changes, identify service installations for persistence, find process creation events for encryption executable, detect volume shadow copy deletion in System log.\n\n## Output Format\n\n```\nWindows Event Log Analysis Summary:\n  System: DC01.corp.local (Windows Server 2019)\n  Log Files Analyzed: 15 EVTX files\n  Total Events: 2,456,789\n  Analysis Period: 2024-01-10 to 2024-01-20\n\n  Chainsaw Detections:\n    Critical:  12 (Mimikatz usage, PsExec, log clearing)\n    High:      34 (Network NTLM logons, encoded PowerShell)\n    Medium:    89 (Unusual service installations, scheduled tasks)\n    Low:       234 (Informational)\n\n  Hayabusa Timeline:\n    Total Alerts: 369\n    Unique Rules Triggered: 45\n    Top Rules:\n      - Suspicious NTLM Authentication (34 hits)\n      - PowerShell Download Cradle (12 hits)\n      - Service Installation Suspicious Path (8 hits)\n\n  Critical Findings:\n    2024-01-15 14:32 - RDP brute force (234 failed, 1 success from 203.0.113.45)\n    2024-01-15 14:45 - Admin account created (svcbackup) - Event 4720\n    2024-01-16 02:30 - PsExec service installed on DC01 - Event 4697\n    2024-01-18 03:00 - Security log cleared - Event 1102\n\n  Reports:\n    Chainsaw: \u002Fanalysis\u002Fchainsaw_results\u002F\n    Hayabusa: \u002Fanalysis\u002Fhayabusa_timeline.csv\n    Critical Events: \u002Fanalysis\u002Fcritical_events.json\n```\n","# Extracting Windows Event Logs Artifacts\n\n## When to Use\n- When investigating security incidents on Windows systems through event log analysis\n- For detecting lateral movement, privilege escalation, and persistence mechanisms\n- When performing threat hunting across Windows event log data\n- During compliance audits requiring review of authentication and access events\n- When building forensic timelines from Windows system activity\n\n## Prerequisites\n- Windows Event Log files (EVTX format) from forensic image or live system\n- Chainsaw, Hayabusa, or EvtxECmd for parsing and detection\n- Sigma rules for automated threat detection\n- Understanding of critical Windows Event IDs\n- Python with python-evtx or evtx library for custom parsing\n- PowerShell for live system analysis (if applicable)\n\n## Workflow\n\n### Step 1: Collect Windows Event Log Files\n\n```bash\n# Extract EVTX files from forensic image\nmount -o ro,loop,offset=$((2048*512)) \u002Fcases\u002Fcase-2024-001\u002Fimages\u002Fevidence.dd \u002Fmnt\u002Fevidence\n\nmkdir -p \u002Fcases\u002Fcase-2024-001\u002Fevtx\u002F\ncp \u002Fmnt\u002Fevidence\u002FWindows\u002FSystem32\u002Fwinevt\u002FLogs\u002F*.evtx \u002Fcases\u002Fcase-2024-001\u002Fevtx\u002F\n\n# Key event logs to prioritize\n# Security.evtx - Authentication, authorization, audit events\n# System.evtx - System services, drivers, hardware events\n# Application.evtx - Application errors and events\n# Microsoft-Windows-Sysmon%4Operational.evtx - Detailed process\u002Fnetwork monitoring\n# Microsoft-Windows-PowerShell%4Operational.evtx - PowerShell activity\n# Microsoft-Windows-TerminalServices-LocalSessionManager%4Operational.evtx - RDP sessions\n# Microsoft-Windows-TaskScheduler%4Operational.evtx - Scheduled tasks\n# Microsoft-Windows-WinRM%4Operational.evtx - Windows Remote Management\n# Microsoft-Windows-Bits-Client%4Operational.evtx - BITS transfers\n# Microsoft-Windows-Windows Defender%4Operational.evtx - AV detections\n\n# List available log files and sizes\nls -lhS \u002Fcases\u002Fcase-2024-001\u002Fevtx\u002F | head -20\n\n# Hash for integrity\nsha256sum \u002Fcases\u002Fcase-2024-001\u002Fevtx\u002F*.evtx > \u002Fcases\u002Fcase-2024-001\u002Fevtx\u002Fevtx_hashes.txt\n```\n\n### Step 2: Run Chainsaw for Sigma-Based Detection\n\n```bash\n# Install Chainsaw\nwget https:\u002F\u002Fgithub.com\u002FWithSecureLabs\u002Fchainsaw\u002Freleases\u002Flatest\u002Fdownload\u002Fchainsaw_all_platforms+rules.zip\nunzip chainsaw_all_platforms+rules.zip -d \u002Fopt\u002Fchainsaw\n\n# Run Chainsaw with bundled Sigma rules\n\u002Fopt\u002Fchainsaw\u002Fchainsaw hunt \u002Fcases\u002Fcase-2024-001\u002Fevtx\u002F \\\n   -s \u002Fopt\u002Fchainsaw\u002Fsigma\u002Frules\u002F \\\n   --mapping \u002Fopt\u002Fchainsaw\u002Fmappings\u002Fsigma-event-logs-all.yml \\\n   --output \u002Fcases\u002Fcase-2024-001\u002Fanalysis\u002Fchainsaw_results.txt\n\n# Run with CSV output for easier analysis\n\u002Fopt\u002Fchainsaw\u002Fchainsaw hunt \u002Fcases\u002Fcase-2024-001\u002Fevtx\u002F \\\n   -s \u002Fopt\u002Fchainsaw\u002Fsigma\u002Frules\u002F \\\n   --mapping \u002Fopt\u002Fchainsaw\u002Fmappings\u002Fsigma-event-logs-all.yml \\\n   --csv \\\n   --output \u002Fcases\u002Fcase-2024-001\u002Fanalysis\u002Fchainsaw_results\u002F\n\n# Run with JSON output\n\u002Fopt\u002Fchainsaw\u002Fchainsaw hunt \u002Fcases\u002Fcase-2024-001\u002Fevtx\u002F \\\n   -s \u002Fopt\u002Fchainsaw\u002Fsigma\u002Frules\u002F \\\n   --mapping \u002Fopt\u002Fchainsaw\u002Fmappings\u002Fsigma-event-logs-all.yml \\\n   --json \\\n   --output \u002Fcases\u002Fcase-2024-001\u002Fanalysis\u002Fchainsaw_results.json\n\n# Search for specific keywords\n\u002Fopt\u002Fchainsaw\u002Fchainsaw search \u002Fcases\u002Fcase-2024-001\u002Fevtx\u002F \\\n   -s \"mimikatz\" --json\n\n# Search for specific event IDs\n\u002Fopt\u002Fchainsaw\u002Fchainsaw search \u002Fcases\u002Fcase-2024-001\u002Fevtx\u002F \\\n   -e 4688 --json | head -100\n```\n\n### Step 3: Run Hayabusa for Fast Timeline Generation\n\n```bash\n# Install Hayabusa\nwget https:\u002F\u002Fgithub.com\u002FYamato-Security\u002Fhayabusa\u002Freleases\u002Flatest\u002Fdownload\u002Fhayabusa-linux-x64-musl.zip\nunzip hayabusa-linux-x64-musl.zip -d \u002Fopt\u002Fhayabusa\n\n# Generate CSV timeline with all detection rules\n\u002Fopt\u002Fhayabusa\u002Fhayabusa csv-timeline \\\n   -d \u002Fcases\u002Fcase-2024-001\u002Fevtx\u002F \\\n   -o \u002Fcases\u002Fcase-2024-001\u002Fanalysis\u002Fhayabusa_timeline.csv \\\n   -p verbose\n\n# Generate JSON timeline\n\u002Fopt\u002Fhayabusa\u002Fhayabusa json-timeline \\\n   -d \u002Fcases\u002Fcase-2024-001\u002Fevtx\u002F \\\n   -o \u002Fcases\u002Fcase-2024-001\u002Fanalysis\u002Fhayabusa_timeline.json\n\n# Run with only critical and high severity detections\n\u002Fopt\u002Fhayabusa\u002Fhayabusa csv-timeline \\\n   -d \u002Fcases\u002Fcase-2024-001\u002Fevtx\u002F \\\n   -o \u002Fcases\u002Fcase-2024-001\u002Fanalysis\u002Fhayabusa_critical.csv \\\n   -p verbose \\\n   --min-level critical\n\n# Generate detection summary (metrics)\n\u002Fopt\u002Fhayabusa\u002Fhayabusa metrics \\\n   -d \u002Fcases\u002Fcase-2024-001\u002Fevtx\u002F \\\n   -o \u002Fcases\u002Fcase-2024-001\u002Fanalysis\u002Fhayabusa_metrics.csv\n\n# Logon summary\n\u002Fopt\u002Fhayabusa\u002Fhayabusa logon-summary \\\n   -d \u002Fcases\u002Fcase-2024-001\u002Fevtx\u002F \\\n   -o \u002Fcases\u002Fcase-2024-001\u002Fanalysis\u002Flogon_summary.csv\n```\n\n### Step 4: Parse Specific Critical Event IDs\n\n```bash\n# Extract authentication events with python-evtx\npip install evtx\n\npython3 \u003C\u003C 'PYEOF'\nimport json\nfrom evtx import PyEvtxParser\n\nparser = PyEvtxParser(\"\u002Fcases\u002Fcase-2024-001\u002Fevtx\u002FSecurity.evtx\")\n\n# Critical Event IDs mapping\ncritical_events = {\n    '4624': 'Successful Logon',\n    '4625': 'Failed Logon',\n    '4634': 'Logoff',\n    '4648': 'Explicit Credential Logon',\n    '4672': 'Special Privileges Assigned',\n    '4688': 'Process Created',\n    '4689': 'Process Exited',\n    '4697': 'Service Installed',\n    '4698': 'Scheduled Task Created',\n    '4720': 'User Account Created',\n    '4724': 'Password Reset Attempted',\n    '4728': 'Member Added to Global Group',\n    '4732': 'Member Added to Local Group',\n    '4756': 'Member Added to Universal Group',\n    '1102': 'Audit Log Cleared',\n    '4688': 'New Process Created'\n}\n\nresults = {eid: [] for eid in critical_events}\n\nfor record in parser.records_json():\n    data = json.loads(record['data'])\n    event_id = str(data['Event']['System']['EventID'])\n\n    if event_id in critical_events:\n        event_data = data['Event'].get('EventData', {})\n        results[event_id].append({\n            'timestamp': data['Event']['System']['TimeCreated']['#attributes']['SystemTime'],\n            'event_id': event_id,\n            'description': critical_events[event_id],\n            'data': event_data\n        })\n\n# Print summary\nfor eid, events in results.items():\n    if events:\n        print(f\"\\n[{eid}] {critical_events[eid]}: {len(events)} events\")\n        for e in events[:3]:\n            print(f\"  {e['timestamp']}: {json.dumps(e['data'], default=str)[:200]}\")\n        if len(events) > 3:\n            print(f\"  ... and {len(events)-3} more\")\n\n# Save full results\nwith open('\u002Fcases\u002Fcase-2024-001\u002Fanalysis\u002Fcritical_events.json', 'w') as f:\n    json.dump(results, f, indent=2, default=str)\nPYEOF\n```\n\n### Step 5: Detect Specific Attack Patterns\n\n```bash\n# Detect Pass-the-Hash (Logon Type 9 with NTLM)\npython3 \u003C\u003C 'PYEOF'\nimport json\nfrom evtx import PyEvtxParser\n\nparser = PyEvtxParser(\"\u002Fcases\u002Fcase-2024-001\u002Fevtx\u002FSecurity.evtx\")\n\nprint(\"=== PASS-THE-HASH INDICATORS ===\")\nprint(\"Looking for: Event 4624, Logon Type 9, NTLM authentication\\n\")\n\nfor record in parser.records_json():\n    data = json.loads(record['data'])\n    event_id = str(data['Event']['System']['EventID'])\n\n    if event_id == '4624':\n        event_data = data['Event'].get('EventData', {})\n        logon_type = str(event_data.get('LogonType', ''))\n        auth_package = str(event_data.get('AuthenticationPackageName', ''))\n        logon_process = str(event_data.get('LogonProcessName', ''))\n\n        # Pass-the-Hash indicators\n        if logon_type == '9' and 'NTLM' in auth_package:\n            timestamp = data['Event']['System']['TimeCreated']['#attributes']['SystemTime']\n            target = event_data.get('TargetUserName', 'Unknown')\n            source_ip = event_data.get('IpAddress', 'N\u002FA')\n            print(f\"  [{timestamp}] PtH: User={target}, IP={source_ip}, Auth={auth_package}\")\n\n        # Network logon with NTLM (lateral movement)\n        if logon_type == '3' and 'NTLM' in auth_package:\n            timestamp = data['Event']['System']['TimeCreated']['#attributes']['SystemTime']\n            target = event_data.get('TargetUserName', 'Unknown')\n            source_ip = event_data.get('IpAddress', 'N\u002FA')\n            workstation = event_data.get('WorkstationName', 'N\u002FA')\n            print(f\"  [{timestamp}] Network NTLM: User={target}, IP={source_ip}, WS={workstation}\")\nPYEOF\n\n# Detect log clearing \u002F anti-forensics\npython3 \u003C\u003C 'PYEOF'\nimport json\nfrom evtx import PyEvtxParser\n\nfor log_file in ['Security.evtx', 'System.evtx']:\n    path = f\"\u002Fcases\u002Fcase-2024-001\u002Fevtx\u002F{log_file}\"\n    try:\n        parser = PyEvtxParser(path)\n        for record in parser.records_json():\n            data = json.loads(record['data'])\n            event_id = str(data['Event']['System']['EventID'])\n            if event_id in ('1102', '104'):  # Security log cleared, System log cleared\n                timestamp = data['Event']['System']['TimeCreated']['#attributes']['SystemTime']\n                print(f\"LOG CLEARED: [{timestamp}] EventID {event_id} in {log_file}\")\n    except Exception as e:\n        print(f\"Error parsing {log_file}: {e}\")\nPYEOF\n```\n\n## Key Concepts\n\n| Concept | Description |\n|---------|-------------|\n| EVTX format | Binary XML-based Windows Event Log format introduced in Vista\u002FServer 2008 |\n| Event ID | Numeric identifier for specific event types (e.g., 4624 = successful logon) |\n| Logon types | Classification of authentication methods (2=interactive, 3=network, 10=RDP) |\n| Sigma rules | Generic detection signatures that map to specific SIEM\u002Flog queries |\n| Sysmon | Microsoft system monitoring driver providing detailed process and network events |\n| Audit policy | GPO settings controlling which events Windows records |\n| Event forwarding (WEF) | Windows mechanism for centralized event log collection |\n| EVTX channels | Separate log files for different event categories and applications |\n\n## Tools & Systems\n\n| Tool | Purpose |\n|------|---------|\n| Chainsaw | Sigma-based EVTX analysis and threat hunting tool |\n| Hayabusa | Fast Windows Event Log forensic timeline generator |\n| EvtxECmd | Eric Zimmerman command-line EVTX parser with CSV\u002FJSON output |\n| python-evtx | Python library for EVTX file parsing |\n| LogParser | Microsoft SQL-like query engine for Windows logs |\n| Event Log Explorer | GUI tool for browsing and analyzing EVTX files |\n| KAPE | Automated triage collection including event logs |\n| Velociraptor | Endpoint agent with EVTX collection and hunting artifacts |\n\n## Common Scenarios\n\n**Scenario 1: Detecting Lateral Movement**\nFilter for Event 4624 with Logon Type 3 (network) and Type 10 (RDP), identify unusual source-destination pairs, check for Event 4648 (explicit credentials) indicating pass-the-hash, correlate with process creation events (4688) on target systems.\n\n**Scenario 2: Privilege Escalation Detection**\nSearch for Event 4672 (special privileges assigned) for unexpected users, check for Event 4728\u002F4732 (group membership changes) adding users to admin groups, look for Event 4697 (service installed) indicating new system-level access, correlate with 4720 (account creation).\n\n**Scenario 3: PowerShell Attack Detection**\nAnalyze PowerShell Operational log for Script Block Logging (Event 4104), search for encoded commands in Event 4688 (process creation with command line), detect AMSI bypass attempts, identify download cradles and invocation of known attack tools.\n\n**Scenario 4: Ransomware Incident Reconstruction**\nBuild timeline starting from initial access (4624 from external IP), trace privilege escalation through group membership changes, identify service installations for persistence, find process creation events for encryption executable, detect volume shadow copy deletion in System log.\n\n## Output Format\n\n```\nWindows Event Log Analysis Summary:\n  System: DC01.corp.local (Windows Server 2019)\n  Log Files Analyzed: 15 EVTX files\n  Total Events: 2,456,789\n  Analysis Period: 2024-01-10 to 2024-01-20\n\n  Chainsaw Detections:\n    Critical:  12 (Mimikatz usage, PsExec, log clearing)\n    High:      34 (Network NTLM logons, encoded PowerShell)\n    Medium:    89 (Unusual service installations, scheduled tasks)\n    Low:       234 (Informational)\n\n  Hayabusa Timeline:\n    Total Alerts: 369\n    Unique Rules Triggered: 45\n    Top Rules:\n      - Suspicious NTLM Authentication (34 hits)\n      - PowerShell Download Cradle (12 hits)\n      - Service Installation Suspicious Path (8 hits)\n\n  Critical Findings:\n    2024-01-15 14:32 - RDP brute force (234 failed, 1 success from 203.0.113.45)\n    2024-01-15 14:45 - Admin account created (svcbackup) - Event 4720\n    2024-01-16 02:30 - PsExec service installed on DC01 - Event 4697\n    2024-01-18 03:00 - Security log cleared - Event 1102\n\n  Reports:\n    Chainsaw: \u002Fanalysis\u002Fchainsaw_results\u002F\n    Hayabusa: \u002Fanalysis\u002Fhayabusa_timeline.csv\n    Critical Events: \u002Fanalysis\u002Fcritical_events.json\n```\n",{"name":5,"tags":43,"author":46,"domain":25,"license":14,"version":47,"subdomain":48,"description":7},[44,34,33,32,31,35,45],"forensics","incident-response","mahipal","1.0","digital-forensics","master","3f5d983eb4ef375b749adcd6b07ec03bd82ae8a8","_universal\u002Fcybersecurity-skills\u002Fskills\u002Fextracting-windows-event-logs-artifacts",0,"https:\u002F\u002Fgithub.com\u002Fmicsapp\u002Fmicstec-skills","https:\u002F\u002Fgithub.com\u002Fmicsapp","2026-03-20 11:24:18",{"source":8,"skillName":5,"commands":57,"prompt":67,"zipAvailable":68},[58,61,64],{"tool":59,"command":60},"npx","npx skills add micsapp\u002Fmicstec-skills --skill extracting-windows-event-logs-artifacts",{"tool":62,"command":63},"bunx","bunx skills add micsapp\u002Fmicstec-skills --skill extracting-windows-event-logs-artifacts",{"tool":65,"command":66},"pnpm","pnpm dlx skills add micsapp\u002Fmicstec-skills --skill extracting-windows-event-logs-artifacts","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fmicsapp\u002Fmicstec-skills\u002Fblob\u002Fmaster\u002F_universal\u002Fcybersecurity-skills\u002Fskills\u002Fextracting-windows-event-logs-artifacts\u002FSKILL.md",true,[70,75,81],{"path":71,"resourceType":71,"resourceTypeDesc":72,"sizeBytes":73,"sourceHtmlUrl":74},"LICENSE","许可证",11255,"https:\u002F\u002Fgithub.com\u002Fmicsapp\u002Fmicstec-skills\u002Fblob\u002Fmaster\u002F_universal\u002Fcybersecurity-skills\u002Fskills\u002Fextracting-windows-event-logs-artifacts\u002FLICENSE",{"path":76,"resourceType":77,"resourceTypeDesc":78,"sizeBytes":79,"sourceHtmlUrl":80},"references\u002Fapi-reference.md","REFERENCE","参考文档",2817,"https:\u002F\u002Fgithub.com\u002Fmicsapp\u002Fmicstec-skills\u002Fblob\u002Fmaster\u002F_universal\u002Fcybersecurity-skills\u002Fskills\u002Fextracting-windows-event-logs-artifacts\u002Freferences\u002Fapi-reference.md",{"path":82,"resourceType":83,"resourceTypeDesc":84,"sizeBytes":85,"sourceHtmlUrl":86},"scripts\u002Fagent.py","SCRIPT","脚本",11178,"https:\u002F\u002Fgithub.com\u002Fmicsapp\u002Fmicstec-skills\u002Fblob\u002Fmaster\u002F_universal\u002Fcybersecurity-skills\u002Fskills\u002Fextracting-windows-event-logs-artifacts\u002Fscripts\u002Fagent.py",[88,116,138,158,176,201],{"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":38},"01M6HBTJ02FXBFG9NYEHHYAP52","azure-apim-architecture","Analyzes and explains Azure API Management architecture decisions for enterprise API marketplace implementations using VNet Internal mode, Front Door, hybrid authentication, and multi-environment strategies. Use when discussing APIM component selection, network topology, cost optimization, or comparing alternatives like workspaces vs instances, VNet Internal vs External mode, or Front Door vs Application Gateway.","MIT","https:\u002F\u002Fgithub.com\u002Fmicsapp\u002Fmicstec-skills\u002Fblob\u002Fmaster\u002Fcopilot-cli\u002Fcopilot-agent-skills\u002F.github\u002Fskills\u002Fazure-apim-architecture\u002FSKILL.md",[],[96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115],"architecture","azure","azure apim architecture","component","authentication","gateway","topology","Optimization","network","api","team","environment","multi-environment","workspaces","instances","selection","strategies","azure api management","mode","for",{"skillNo":117,"name":118,"nameZh":6,"description":119,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":92,"licenseFileUrl":6,"sourceHtmlUrl":120,"categories":121,"keywords":122,"publishedAt":38},"01M6HBT7J4H082JEEA670B3EQ9","apiops-deployment","Guides deployment of Azure API Management infrastructure using Infrastructure as Code (Bicep\u002FTerraform), CI\u002FCD pipelines (GitHub Actions\u002FAzure DevOps), and APIOps workflows. Use when deploying APIM, creating pipelines, or implementing dev→test→prod promotion strategies.","https:\u002F\u002Fgithub.com\u002Fmicsapp\u002Fmicstec-skills\u002Fblob\u002Fmaster\u002Fcopilot-cli\u002Fcopilot-agent-skills\u002F.github\u002Fskills\u002Fapiops-deployment\u002FSKILL.md",[],[123,124,125,126,97,127,128,129,130,131,132,133,105,106,112,134,135,113,136,137],"deployment","apiops deployment","workflows","azure devops","infrastructure","code","infrastructure as code","actions","ci","github actions","github-actions","as","guides","CI\u002FCD","implementing",{"skillNo":139,"name":140,"nameZh":6,"description":141,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":92,"licenseFileUrl":6,"sourceHtmlUrl":142,"categories":143,"keywords":144,"publishedAt":38},"01M6HBT2HEA23THNE9E00GYQBE","apim-policy-authoring","Creates production-ready Azure API Management policy XML for authentication (OAuth 2.0, JWT validation, subscription keys), rate limiting, CORS configuration, error handling, and API transformations. Use when implementing API security, access control, or request\u002Fresponse processing logic.","https:\u002F\u002Fgithub.com\u002Fmicsapp\u002Fmicstec-skills\u002Fblob\u002Fmaster\u002Fcopilot-cli\u002Fcopilot-agent-skills\u002F.github\u002Fskills\u002Fapim-policy-authoring\u002FSKILL.md",[],[145,146,147,148,97,100,105,106,149,150,151,152,153,154,155,113,156,157,137,115],"policy","authoring","apim policy authoring","security","access","use","ready","api security","Access Control","error","processing","cors configuration","production-ready",{"skillNo":159,"name":160,"nameZh":6,"description":161,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":92,"licenseFileUrl":6,"sourceHtmlUrl":162,"categories":163,"keywords":164,"publishedAt":38},"01M6HBSY65SB29J9WE9KYD0K6T","api-security-review","Reviews Azure API Management configurations for security vulnerabilities, OWASP API Security Top 10 compliance, VNet Internal mode validation, Private Link verification, and Azure Security Benchmark alignment. Use when performing security audits, pre-deployment validation, or compliance reviews.","https:\u002F\u002Fgithub.com\u002Fmicsapp\u002Fmicstec-skills\u002Fblob\u002Fmaster\u002Fcopilot-cli\u002Fcopilot-agent-skills\u002F.github\u002Fskills\u002Fapi-security-review\u002FSKILL.md",[],[165,148,166,105,152,167,97,123,168,169,170,171,106,172,113,173,174,175,114,115],"review","security review","api security review","benchmark","verification","owasp","owasp-api","alignment","azure security","reviews","top",{"skillNo":177,"name":178,"nameZh":6,"description":179,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":92,"licenseFileUrl":6,"sourceHtmlUrl":180,"categories":181,"keywords":182,"publishedAt":38},"01M6HBSRW4PDFE6K4F8JYPZQ05","jira-cli","Interact with Jira from the command line to create, list, view, edit, and transition issues, manage sprints and epics, and perform common Jira workflows. Use when the user asks about Jira tasks, tickets, issues, sprints, or needs to manage project work items.","https:\u002F\u002Fgithub.com\u002Fmicsapp\u002Fmicstec-skills\u002Fblob\u002Fmaster\u002Fcopilot-cli\u002Fawesome-copilot-agents\u002Fskills\u002Fjira-cli\u002FSKILL.md",[],[183,184,185,125,186,187,188,189,105,190,191,192,193,194,195,196,197,198,199,200],"cli","jira","jira cli","init","tasks","create","issues","common","work","command","edit","list","view","project","project work","token","line","sprints",{"skillNo":202,"name":203,"nameZh":6,"description":204,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":92,"licenseFileUrl":6,"sourceHtmlUrl":205,"categories":206,"keywords":207,"publishedAt":38},"01M6HBSNS3JHMW603G47TWE31H","calculator","Performs arbitrary-precision arithmetic calculations including addition, subtraction, multiplication, division, and exponents. Use when the user asks to calculate, compute, or evaluate math expressions, or when precise decimal arithmetic is needed to avoid floating-point errors.","https:\u002F\u002Fgithub.com\u002Fmicsapp\u002Fmicstec-skills\u002Fblob\u002Fmaster\u002Fcopilot-cli\u002Fawesome-copilot-agents\u002Fskills\u002Fcalculator\u002FSKILL.md",[],[203,208,209,210,211,212,213,150,214,215],"npm","js","calculate","node","math","user","compute","errors"]