How eseigbeihinosen/soc-powershell-labs works
Purpose and execution model
SOC-PowerShell-Labs is a collection of independent Windows PowerShell monitoring exercises for SOC investigation and learning. There is no shared application host or orchestrator: operators invoke scripts directly from scripts/, and each script reads local Windows state, produces local reports/logs, or runs until manually stopped.
Security event collection and reporting
The log-analysis scripts query Windows Security events and transform them into CSV-oriented investigation outputs:
• scripts/log-analysis/event-log-monitor.ps1 collects login success, login failure, and administrative-privilege events.
• scripts/log-analysis/failed-login-analysis.ps1 analyzes Event ID 4625 over the prior seven days, aggregates failures by user, and flags a brute-force threshold of five or more attempts.
• scripts/log-analysis/user-activity-report.ps1 records logon/logoff activity with event type, timestamp, user, and source.
Boundary: these depend on the local Windows event-log subsystem and potentially on permissions to read Security logs. Outputs are written under the Git-ignored Logs area.
File-integrity baseline and comparison
scripts/file-monitoring/file-integrity-check.ps1 implements a two-stage integrity workflow:
1. -Mode baseline recursively captures monitored-file SHA-256 hashes into a CSV baseline within the target folder.
2. -Mode check recomputes hashes and compares current contents to that baseline, classifying modified, newly added, and missing files.
The monitored filesystem path is an explicit operator input. Storing the baseline beside monitored content is an important trust boundary: baseline protection determines the reliability of later change reports.
Process lifecycle monitoring
scripts/process-monitoring/process-monitor.ps1 is a continuous local-process observer. It polls/runs repeatedly to identify process starts and stops, correlating events with timestamps, names, and PIDs. It writes a default append-style operational log to C:\Temp\ProcessMonitorLog.txt.
Its boundary is the local Windows process table; PID reuse and multi-process applications can affect interpretation. The loop is operator-controlled and stops with Ctrl+C.
Network connection monitoring
scripts/network-monitoring/connection-monitor.ps1 continuously captures local TCP and UDP connection state. Each interval, it records local/remote addressing, ports, TCP state where applicable, and owning PID, allowing analysts to correlate network activity with processes. The documented default interval is 30 seconds, and output is scripts\Logs\NetworkConnections.log.
This stage depends on Windows networking/connection inspection facilities. It observes endpoint metadata rather than packet contents or remote-service identity.
Storage, privacy, and operational boundaries
Generated Logs content is excluded by .gitignore, separating potentially sensitive endpoint telemetry from source control. CSV serves as the interchange/reporting format for event and file workflows; plaintext logs serve continuous process and network workflows. The repository has no cloud services, databases, agents, or centralized ingestion pipeline: all collection, analysis, storage, and review occur on the executing Windows host.
Main entry points: file-integrity-check.ps1 Integrity check · event-log-monitor.ps1 Event log monitor · failed-login-analysis.ps1 Failed login analysis · user-activity-report.ps1 User activity report
Components 18
Security event reporting
- Windows Security logs · Security-log access may require permissions.
- Event log monitor · Collects login and privilege events.
scripts/log-analysis/event-log-monitor.ps1 - Failed login analysis · Analyzes seven days of Event ID 4625 data.
scripts/log-analysis/failed-login-analysis.ps1 - Failure aggregation · Groups failures by user and flags five or more attempts.
- User activity report · Records logon and logoff activity.
scripts/log-analysis/user-activity-report.ps1 - Event CSV reports · Investigation-oriented local reports.
File integrity
- Monitored filesystem · The target folder is an explicit input.
- Integrity check · Runs baseline or check mode with SHA-256 hashes.
scripts/file-monitoring/file-integrity-check.ps1 - Hash baseline CSV · Stored beside monitored content; its protection is a trust boundary.
- File change report · Classifies modified, added, and missing files.
Continuous monitors
- Windows process table · PID reuse and multi-process applications affect interpretation.
- Process monitor · Continuously detects process starts and stops until Ctrl+C.
scripts/process-monitoring/process-monitor.ps1 - Process monitor log · Written to the local C:\Temp path.
- Windows connection inspection · Provides endpoint metadata, not packet contents or remote identity.
- Connection monitor · Polls TCP and UDP connections at a 30-second default interval.
scripts/network-monitoring/connection-monitor.ps1 - Network connections log · Written under the local Logs area.
Other components
- SOC operator · Invokes and stops scripts locally.
- Git ignore rules · Excludes generated Logs telemetry from source control.
.gitignore
Connections 23
- SOC operator → Event log monitor: runs
- SOC operator → Failed login analysis: runs
- SOC operator → User activity report: runs
- SOC operator → Integrity check: runs with mode and target
- SOC operator → Process monitor: runs / stops
- SOC operator → Connection monitor: runs / stops
- Windows Security logs → Event log monitor: security events
- Windows Security logs → Failed login analysis: Event ID 4625
- Windows Security logs → User activity report: logon/logoff events
- Event log monitor → Event CSV reports: writes
- Failed login analysis → Failure aggregation: transforms
- Failure aggregation → Event CSV reports: writes findings
- User activity report → Event CSV reports: writes
- Monitored filesystem → Integrity check: hashes recursively
- Integrity check → Hash baseline CSV: baseline mode writes
- Hash baseline CSV → Integrity check: check mode compares
- Integrity check → File change report: writes classifications
- Windows process table → Process monitor: process state
- Process monitor → Process monitor log: appends
- Windows connection inspection → Connection monitor: TCP/UDP state
- Connection monitor → Network connections log: appends
- Git ignore rules → Event CSV reports: excludes Logs output
- Git ignore rules → Network connections log: excludes Logs output