|
1 | 1 | ## 🔵 BlueTeam-Tools: EventLog Monitoring Suite |
2 | 2 | ### Log Analysis · Threat Detection · Audit Readiness |
3 | 3 |
|
4 | | -[]() |
5 | | -[]() |
6 | | -[]() |
7 | | -[]() |
8 | | -[]() |
| 4 | +[]() []() []() []() []() |
9 | 5 |
|
10 | 6 | --- |
11 | 7 |
|
12 | | -The **EventLogMonitoring** directory contains **forensic‑grade PowerShell tooling** focused exclusively on **Windows Event Log (.evtx) analysis** for **Blue Team, DFIR, SOC, and audit workflows**. |
| 8 | +The **EventLogMonitoring** folder contains a specialized and forensic-oriented collection of **PowerShell scripts** designed to process, correlate, and audit **Windows Event Log (`.evtx`) data**. |
13 | 9 |
|
14 | | -This layer is **capability‑scoped**: it does **not** describe the full BlueTeam suite nor individual script internals, but defines *what this folder delivers operationally*. |
| 10 | +These tools are intended for use by **Blue Team operators, DFIR analysts, security engineers, and Windows administrators** in enterprise and public-sector environments where **auditability, repeatability, and evidentiary integrity** are required. |
15 | 11 |
|
16 | | -Core characteristics: |
| 12 | +Primary use cases include: |
17 | 13 |
|
18 | | -- 🎛️ **GUI‑driven execution** for analyst usability |
19 | | -- 📈 **Structured CSV outputs** for correlation, dashboards, and SIEM ingestion |
20 | | -- 🧾 **Deterministic execution logs** for audit trails |
21 | | -- 🔎 **Security‑relevant detections** aligned with Windows native Event IDs |
| 14 | +- Authentication and logon analysis |
| 15 | +- Privilege escalation and group membership auditing |
| 16 | +- Object lifecycle tracking in Active Directory |
| 17 | +- Print activity and service usage auditing |
| 18 | +- System restarts, crashes, and shutdown attribution |
22 | 19 |
|
23 | | -All scripts are **read‑only by design** (no state changes) and compatible with **PowerShell 5.1 corporate environments**. |
| 20 | +All scripts generate **structured `.log` and `.csv` artifacts**, suitable for investigations, compliance reporting, and long-term forensic readiness. |
24 | 21 |
|
25 | 22 | --- |
26 | 23 |
|
27 | | -## 🧪 Capability Scope |
| 24 | +## 📦 Script Inventory (Alphabetical) |
28 | 25 |
|
29 | | -[]() |
30 | | -[]() |
31 | | -[]() |
| 26 | +| Script | Purpose | |
| 27 | +|------|---------| |
| 28 | +| **EventID-Count-AllEvtx-Events.ps1** | Counts all Event IDs in selected `.evtx` files and exports a frequency summary to `.csv`. | |
| 29 | +| **EventID307-PrintAudit.ps1** | Audits print activity using Event ID 307. Complements `PrintService-Operational-EventLogs.md`. | |
| 30 | +| **EventID4624-ADUserLoginViaRDP.ps1** | Identifies successful logons (Event ID 4624) filtered specifically for RDP sessions. | |
| 31 | +| **EventID4624and4634-ADUserLoginTracking.ps1** | Correlates logon/logoff activity (Event IDs 4624 and 4634) into full user session timelines. | |
| 32 | +| **EventID4625-ADUserLoginAccountFailed.ps1** | Captures failed authentication attempts (Event ID 4625) with detailed failure reasons. | |
| 33 | +| **EventID4648-ExplicitCredentialsLogon.ps1** | Detects explicit credential usage (Event ID 4648), commonly associated with lateral movement. | |
| 34 | +| **EventID4663-TrackingObjectDeletions.ps1** | Tracks object deletions via Event ID 4663 with AccessMask `0x10000`. | |
| 35 | +| **EventID4720to4756-PrivilegedAccessTracking.ps1** | Monitors privileged account operations (creation, deletion, group changes, delegation). | |
| 36 | +| **EventID4771-KerberosPreAuthFailed.ps1** | Analyzes Kerberos pre-authentication failures (Event ID 4771). | |
| 37 | +| **EventID4800and4801-WorkstationLockStatus.ps1** | Records workstation lock and unlock events to infer user presence. | |
| 38 | +| **EventID5136-5137-5141-ADObjectChanges.ps1** | Audits Active Directory object creation, modification, and deletion events. | |
| 39 | +| **EventID6005-6006-6008-6009-6013-1074-1076-SystemRestarts.ps1** | Attributes system restarts, crashes, and shutdowns to users, services, or failures. | |
| 40 | +| **Migrate-WinEvtStructure-Tool.ps1** | Migrates the Windows Event Log storage path, updates registry settings, and preserves permissions. | |
32 | 41 |
|
33 | | -This folder supports: |
| 42 | +--- |
34 | 43 |
|
35 | | -- Authentication & logon auditing |
36 | | -- Failed logon and credential misuse detection |
37 | | -- Privileged group and object change tracking |
38 | | -- Kerberos authentication anomaly analysis |
39 | | -- System restart, shutdown, and crash auditing |
40 | | -- Print activity and operational event monitoring |
| 44 | +## 🧠 Migration Notes — `Migrate-WinEvtStructure-Tool.ps1` |
41 | 45 |
|
42 | | ---- |
| 46 | +> ⚠️ **This script performs low-level changes to the Windows Event Log infrastructure.** |
| 47 | +> It must be executed carefully and only by qualified administrators. |
43 | 48 |
|
44 | | -## 📦 Script Inventory (Alphabetical) |
| 49 | +### Safe Mode Requirement |
45 | 50 |
|
46 | | -| Script | Purpose | |
47 | | -|------|---------| |
48 | | -| **EventID-Count-AllEvtx-Events.ps1** | Counts Event IDs across `.evtx` files and exports summary statistics. | |
49 | | -| **EventID307-PrintAudit.ps1** | Audits print activity (Event ID 307). | |
50 | | -| **EventID4624-ADUserLoginViaRDP.ps1** | Tracks interactive logons via RDP (ID 4624). | |
51 | | -| **EventID4624and4634-ADUserLoginTracking.ps1** | Correlates logon / logoff sessions. | |
52 | | -| **EventID4625-ADUserLoginAccountFailed.ps1** | Reports failed authentication attempts. | |
53 | | -| **EventID4648-ExplicitCredentialsLogon.ps1** | Detects explicit credential usage (lateral movement indicator). | |
54 | | -| **EventID4663-TrackingObjectDeletions.ps1** | Identifies object deletions using AccessMask correlation. | |
55 | | -| **EventID4720to4756-PrivilegedAccessTracking.ps1** | Monitors privileged account lifecycle and group changes. | |
56 | | -| **EventID4771-KerberosPreAuthFailed.ps1** | Detects Kerberos pre‑authentication failures. | |
57 | | -| **EventID4800and4801-WorkstationLockStatus.ps1** | Tracks workstation lock / unlock events. | |
58 | | -| **EventID5136-5137-5141-ADObjectChanges.ps1** | Audits AD object create/modify/delete operations. | |
59 | | -| **EventID6005-6006-6008-6009-6013-1074-1076-SystemRestarts.ps1** | Audits system restarts, crashes, and shutdown causes. | |
60 | | -| **Migrate-WinEvtStructure-Tool.ps1** | Migrates Event Log storage location while preserving permissions. | |
| 51 | +To safely stop the Event Log service and migrate the `.evtx` structure: |
| 52 | + |
| 53 | +```powershell |
| 54 | +bcdedit /set {current} safeboot minimal |
| 55 | +shutdown /r /t 0 |
| 56 | +``` |
| 57 | + |
| 58 | +After completing the migration: |
| 59 | + |
| 60 | +```powershell |
| 61 | +bcdedit /deletevalue {current} safeboot |
| 62 | +shutdown /r /t 0 |
| 63 | +``` |
| 64 | + |
| 65 | +### Optional: DHCP Configuration Backup |
| 66 | + |
| 67 | +If executed on systems hosting DHCP services: |
| 68 | + |
| 69 | +```powershell |
| 70 | +netsh dhcp server export C:\Backup\dhcpconfig.dat all |
| 71 | +netsh dhcp server import C:\Backup\dhcpconfig.dat all |
| 72 | +``` |
| 73 | + |
| 74 | +> 🔎 Always validate Event Log integrity and permissions after migration. |
61 | 75 |
|
62 | 76 | --- |
63 | 77 |
|
64 | | -## 🚀 Usage Model |
| 78 | +## 🚀 How to Use |
65 | 79 |
|
66 | | -1. Execute via GUI or console |
67 | | -2. Select `.evtx` source files |
68 | | -3. Review generated artifacts: |
69 | | - - `.csv` → analytical data |
70 | | - - `.log` → execution trace |
| 80 | +1. Execute the desired script: |
| 81 | + - Right-click → **Run with PowerShell**, or |
| 82 | + - Launch from an elevated PowerShell console. |
71 | 83 |
|
72 | | -> ⚠️ Always preserve original evidence. Work on copies of `.evtx` files during investigations. |
| 84 | +2. Select one or more `.evtx` files when prompted (GUI or file picker). |
| 85 | + |
| 86 | +3. Review generated artifacts: |
| 87 | + - `.csv` — structured analytical output |
| 88 | + - `.log` — execution trace and warnings |
73 | 89 |
|
74 | 90 | --- |
75 | 91 |
|
76 | 92 | ## 🛠️ Requirements |
77 | 93 |
|
78 | | -[]() |
79 | | -[]() |
| 94 | +- **PowerShell 5.1 or later** |
| 95 | +```powershell |
| 96 | +$PSVersionTable.PSVersion |
| 97 | +``` |
| 98 | + |
| 99 | +- **Administrator privileges** (mandatory) |
80 | 100 |
|
81 | | -- PowerShell **5.1 minimum** |
82 | | -- Administrative privileges |
83 | | -- RSAT (when querying AD‑backed events) |
84 | | -- Optional: **Log Parser 2.2** (Microsoft) |
| 101 | +- **RSAT tools** (for Active Directory correlation) |
| 102 | +```powershell |
| 103 | +Get-WindowsCapability -Name RSAT* -Online | Add-WindowsCapability -Online |
| 104 | +``` |
| 105 | + |
| 106 | +- **Microsoft Log Parser 2.2** |
| 107 | + Required for advanced `.evtx` parsing operations. |
85 | 108 |
|
86 | 109 | --- |
87 | 110 |
|
88 | | -## 📊 Outputs |
| 111 | +## 📊 Logs and Exports |
| 112 | + |
| 113 | +- `.log` files |
| 114 | + Execution trace, warnings, and processing steps. |
89 | 115 |
|
90 | | -- **`.log`** — execution trace & warnings |
91 | | -- **`.csv`** — structured analytical output |
92 | | -- Ready for Excel, SIEMs, dashboards, and reports |
| 116 | +- `.csv` files |
| 117 | + Structured output suitable for Excel, SIEM ingestion, or forensic timelines. |
93 | 118 |
|
94 | 119 | --- |
95 | 120 |
|
96 | | -## 💡 Operational Guidance |
| 121 | +## 💡 Operational Recommendations |
97 | 122 |
|
98 | | -- Schedule periodic runs via **Task Scheduler** |
99 | | -- Centralize outputs to secured log repositories |
100 | | -- Combine with IncidentResponse tools for full timelines |
| 123 | +- Schedule recurring analysis via **Task Scheduler** |
| 124 | +- Centralize outputs on secured file shares (e.g., `\\logserver\exports`) |
| 125 | +- Apply pre-filters to reduce noise and improve signal quality |
| 126 | +- Preserve original `.evtx` files for evidentiary integrity |
101 | 127 |
|
102 | 128 | --- |
103 | 129 |
|
|
0 commit comments