This PowerShell script performs a comprehensive security scan on a Windows machine, analyzing antivirus, firewall, network security, system hardening, and user security. It generates an HTML report and exports data to CSV.
- Introduction
- Prerequisites
- Usage
- Configuration
- Features
- Export Options
- Sample Output
- Troubleshooting
- Contributing
This script assesses Windows security, covering:
- Antivirus protection
- Windows updates
- Network security
- Firewall settings
- System hardening (e.g., UAC, PowerShell policy)
- User security (e.g., password policies)
It generates a security score and provides improvement recommendations.
- PowerShell: v5.1 or later.
- Administrator privileges.
- Internet access for Windows updates and third-party antivirus checks.
Run the script using the following command:
.\SecurityAssessment.ps1-Verbose: Outputs detailed logs.-DetailedReport: Generates and opens the HTML report.-ExportCSV: Exports findings to CSV.
Example:
.\SecurityAssessment.ps1 -Verbose -ExportCSVGlobal variables define paths for the HTML report, log, security charts, and CSV file.
- Antivirus: Status of Windows Defender and third-party AV.
- Updates: Pending Windows updates.
- Firewall: Status of firewall for different profiles.
- Network: Open ports, network interfaces, and DNS servers.
- Hardening: UAC, PowerShell policies, and SMBv1 settings.
- User Security: Password policies, blank passwords, etc.
- HTML Report: Includes a security score, charts, findings, and recommendations.
- CSV Export: Contains findings with categories, checks, status, and recommendations.
- Security Charts: Pie and bar charts showing score distributions.
The HTML report includes:
- Overall security score.
- Detailed findings table.
- Security charts.
The CSV file contains:
- Category, Check, Status, Points, Details, and Recommendations.
- Permissions: Run with administrator privileges.
- Internet: Some checks require internet access.
To contribute:
- Fork the repo.
- Create a branch.
- Commit and push.
- Submit a pull request.