βββββββ βββββββ βββ ββββββββββββββββββ βββββββββββ ββββββββββββββ βββ
ββββββββββββββββββββ ββββββββββββββββββββββββββββββ ββββββββββββββ βββ
βββββββββββ ββββββ ββ βββββββββ ββββββββββββββββββββββββββββββ βββ βββ
βββββββ βββ βββββββββββββββββββ ββββββββββββββββββββββββββββββ βββ βββ
βββ ββββββββββββββββββββββββββββββ ββββββββββββββ βββββββββββββββββββββββββββ
βββ βββββββ ββββββββ βββββββββββ ββββββββββββββ βββββββββββββββββββββββββββ
PowerShell automation toolkit for cybersecurity operations, built for technical and non-technical users. Automates security hardening, incident response, log analysis, and compliance checks. Includes beginner-friendly documentation and advanced scripting modules for blue-team and red-team tasks. Strengthen your security posture with confidence.
- β¨ Overview
- π Features at a Glance
- βοΈ Prerequisites
- π¦ Installation
- ποΈ Module Structure
- π’ Beginner Quick Start
- π§ Advanced Usage
- π΅ Blue Team Modules
- π΄ Red Team Modules
- π‘οΈ Compliance & Hardening
- π¨ Incident Response
- π Log Analysis
- π€ Contributing
β οΈ Disclaimer- π License
Powershell-Automation is a modular, extensible cybersecurity automation framework built entirely in PowerShell. Whether you're a seasoned penetration tester, a blue-team analyst, or an IT administrator stepping into security for the first time β this toolkit gives you the scripts, documentation, and workflows to operate with speed and precision.
Every module is built with two audiences in mind:
| π€ Non-Technical Users | π§βπ» Security Professionals |
|---|---|
| Plain-English step-by-step guides | Full parameter control & pipeline support |
| Safe read-only modes by default | SIEM integration & API hooks |
| Auto-generated HTML reports | Custom rule sets & advanced filters |
| No prior PowerShell knowledge needed | Extendable modular architecture |
| Module | Capability | Standards |
|---|---|---|
| π Security Hardening | CIS Benchmark & STIG automated audits | CIS L1/L2, STIG |
| π¨ Incident Response | Containment, eradication & recovery workflows | NIST SP 800-61 |
| π Log Analysis | Windows Event Logs, Sysmon, PowerShell transcript parsing | MITRE ATT&CK |
| β Compliance Checks | Baseline audits with exportable reports | NIST, PCI-DSS, ISO 27001 |
| π΄ Red Team | Enumeration, lateral movement simulation, password auditing | MITRE ATT&CK TTPs |
| π΅ Blue Team | Threat hunting, anomaly detection, IOC searching | MITRE D3FEND |
| π Reporting | Auto-generate HTML/CSV/JSON security audit reports | β |
| π§© Modular Design | Import only the modules you need | β |
Ensure the following before getting started:
β PowerShell 5.1+ OR PowerShell Core 7.x (recommended)
β Windows 10 / 11 OR Windows Server 2016 / 2019 / 2022
β Administrator / Elevated Privileges (required for most modules)
Optional dependencies:
- Pester β for running module unit tests
- PSScriptAnalyzer β for script linting
Check your PowerShell version:
$PSVersionTable.PSVersiongit clone https://github.com/YourUsername/Powershell-Automation.git
cd Powershell-Automation- Click
CodeβDownload ZIPon this page - Extract to a folder of your choice
- Open PowerShell as Administrator and navigate to the folder
β οΈ Only apply this in a trusted, controlled environment.
Set-ExecutionPolicy RemoteSigned -Scope CurrentUserImport-Module .\CyberSecToolkit.psm1
# Verify loaded modules
Get-Module CyberSecToolkitPowershell-Automation/
β
βββ π BlueTeam/ # Detection, hunting & monitoring
β βββ Invoke-ThreatHunt.ps1
β βββ Get-SuspiciousProcesses.ps1
β βββ Watch-NetworkConnections.ps1
β βββ Get-FailedLogons.ps1
β
βββ π RedTeam/ # Authorized offensive testing
β βββ Invoke-Enumeration.ps1
β βββ Test-LateralMovement.ps1
β βββ Get-LocalPrivileges.ps1
β βββ Invoke-PasswordAudit.ps1
β
βββ π Hardening/ # System & policy hardening
β βββ Invoke-CISBenchmark.ps1
β βββ Set-SecureBaseline.ps1
β βββ Disable-LegacyProtocols.ps1
β βββ Enable-AuditPolicies.ps1
β
βββ π IncidentResponse/ # IR workflows & forensics
β βββ Start-IRWorkflow.ps1
β βββ Invoke-Containment.ps1
β βββ Collect-ForensicData.ps1
β βββ Export-IRReport.ps1
β
βββ π LogAnalysis/ # Log parsing & IOC detection
β βββ Parse-EventLogs.ps1
β βββ Analyze-SysmonLogs.ps1
β βββ Get-PowerShellHistory.ps1
β βββ Find-IOCs.ps1
β
βββ π Compliance/ # Regulatory baseline checks
β βββ Test-NISTBaseline.ps1
β βββ Test-PCIDSSControls.ps1
β βββ Export-ComplianceReport.ps1
β
βββ π Docs/ # Guides & references
β βββ BeginnerGuide.md
β βββ AdvancedScripting.md
β βββ ModuleReference.md
β
βββ π Reports/ # Auto-generated output reports
βββ CyberSecToolkit.psm1 # Main module manifest
βββ README.md
No PowerShell experience? Follow these 5 steps and you'll be running your first security check in under 2 minutes.
Step 1 β Open PowerShell as Administrator
Start Menu β Search "PowerShell" β Right-click β Run as Administrator
Step 2 β Navigate to the toolkit folder
cd C:\Path\To\Powershell-AutomationStep 3 β Import the toolkit
Import-Module .\CyberSecToolkit.psm1Step 4 β Run your first check (safe, read-only)
# Check for failed login attempts in the last 24 hours
.\BlueTeam\Get-FailedLogons.ps1 -Hours 24Step 5 β View your report
Results display in the terminal and are saved to .\Reports\ as an HTML file you can open in any browser.
π‘ Every script has built-in help. Just add
-Helpto any command:.\BlueTeam\Get-FailedLogons.ps1 -Help
All modules support pipeline input, custom parameters, verbose logging, and SIEM/API integration.
# Full CIS Level 1 Benchmark audit β exported as HTML
.\Hardening\Invoke-CISBenchmark.ps1 -Level 1 -ExportHTML -OutputPath "C:\Reports\CIS_Audit.html"
# Threat hunt mapped to MITRE ATT&CK T1059 (Command & Scripting Interpreter)
.\BlueTeam\Invoke-ThreatHunt.ps1 -IOC "mimikatz" -Scope EventLog,ProcessList,Network -MITREMap
# Full ransomware IR workflow with forensic collection
.\IncidentResponse\Start-IRWorkflow.ps1 -IncidentType Ransomware -AffectedHost WORKSTATION-01 -CollectForensics
# Pipeline: get suspicious processes and pipe results to IOC finder
.\BlueTeam\Get-SuspiciousProcesses.ps1 | .\LogAnalysis\Find-IOCs.ps1 -SearchScope AllQueries Windows Security Event Log (Event ID 4625) for failed authentication attempts. Useful for detecting brute-force and password spray attacks.
.\BlueTeam\Get-FailedLogons.ps1 -Hours 48 -ExportCSV -Threshold 5Identifies processes with anomalous parent-child relationships, unsigned binaries, or names matching known malicious patterns.
.\BlueTeam\Get-SuspiciousProcesses.ps1 -CheckSignatures -CompareBaselineMonitors live network connections and flags traffic to known malicious IPs using a local or remote threat intel feed.
.\BlueTeam\Watch-NetworkConnections.ps1 -ThreatFeed .\Data\malicious_ips.txt -Interval 30Structured threat hunting across event logs, processes, registry keys, and network artifacts β mapped to MITRE ATT&CK playbooks.
.\BlueTeam\Invoke-ThreatHunt.ps1 -Playbook MITRE_T1059 -Verboseπ¨ AUTHORIZED USE ONLY. These modules must only be run on systems you own or have explicit written permission to test. Unauthorized use is illegal. See Disclaimer.
Local and domain enumeration β users, groups, shares, services, and scheduled tasks.
.\RedTeam\Invoke-Enumeration.ps1 -Target localhost -Scope FullSimulates lateral movement paths via WMI, PsExec, and WinRM to identify over-permissioned accounts and exposed attack paths.
.\RedTeam\Test-LateralMovement.ps1 -TargetHost 192.168.1.50 -Method WinRMIdentifies local privilege escalation vectors including weak service permissions, unquoted paths, and token abuse opportunities.
.\RedTeam\Get-LocalPrivileges.ps1 -CheckAllTests password policies and checks active accounts against configurable wordlists to identify weak credentials.
.\RedTeam\Invoke-PasswordAudit.ps1 -WordList .\Data\common_passwords.txt -Domain CORP# Level 1 β Basic (most environments)
.\Hardening\Invoke-CISBenchmark.ps1 -Level 1
# Level 2 β Strict (high-security environments)
.\Hardening\Invoke-CISBenchmark.ps1 -Level 2 -ExportHTML# Always preview with -WhatIf first
.\Hardening\Set-SecureBaseline.ps1 -WhatIf
# Apply after review
.\Hardening\Set-SecureBaseline.ps1 -Confirm# Disables SMBv1, TLS 1.0/1.1, RC4, and weak cipher suites
.\Hardening\Disable-LegacyProtocols.ps1 -All.\Hardening\Enable-AuditPolicies.ps1 -Preset Recommended.\IncidentResponse\Start-IRWorkflow.ps1 -IncidentType Malware -AffectedHost WORKSTATION-01The workflow automatically executes:
[1] Notify analyst via console prompt
[2] Isolate affected host β requires confirmation
[3] Collect volatile data (processes, connections, memory artifacts)
[4] Pull Windows Event Logs (Security, System, Application)
[5] Package all evidence β timestamped ZIP
[6] Generate IR report β HTML + JSON
.\IncidentResponse\Collect-ForensicData.ps1 -Host WORKSTATION-01 -OutputPath C:\IR\Evidence\.\IncidentResponse\Invoke-Containment.ps1 -Host WORKSTATION-01 -Method NetworkIsolation# Logon events + failures over 7 days
.\LogAnalysis\Parse-EventLogs.ps1 -EventID 4624,4625,4648 -Days 7 -ExportCSV# Filter for suspicious network connections and process creations
.\LogAnalysis\Analyze-SysmonLogs.ps1 -Filter NetworkConnect,ProcessCreate -Suspicious# Pull all users' PSReadLine history and transcript logs
.\LogAnalysis\Get-PowerShellHistory.ps1 -AllUsers -IncludeTranscripts# Search across all log sources for known IOCs
.\LogAnalysis\Find-IOCs.ps1 -IOCFile .\Data\iocs.csv -SearchScope All -ExportReportContributions are welcome β new detection scripts, improved documentation, bug fixes, and hardening rules all strengthen the community toolkit.
1. Fork the repository
2. git checkout -b feature/your-module-name
3. git commit -m "Add: description of what you added"
4. git push origin feature/your-module-name
5. Open a Pull Request
Script standards for contributions:
- All scripts must include comment-based help (
Get-Helpcompatible) - Follow PowerShell Approved Verbs
- Include at least one usage example per script
- Red team scripts must include an authorization warning at runtime
This toolkit is intended strictly for authorized security testing, research, and educational purposes.
Unauthorized use of any offensive modules against systems you do not own or have explicit written authorization to test is illegal under the Computer Fraud and Abuse Act (CFAA), the Computer Misuse Act (CMA), and equivalent legislation worldwide.
The authors and contributors of this toolkit accept no liability for any misuse, damage, or legal consequences arising from unauthorized use. Always operate within legal and ethical boundaries.
This project is licensed under the MIT License β see the LICENSE file for full details.
Built for defenders. Sharpened by attackers. Trusted by both.
β Star this repo if it helped you Β |Β π Report a Bug Β |Β π‘ Request a Feature Β |Β π¬ Discussions