Author: Maxwell McCormick
Copyright: Β© 2026 Maxwell McCormick
License: Apache License 2.0
A comprehensive C# console application that automates CyberPatriot competition security hardening tasks for Windows systems.
This repository is the canonical and official source of the CyberPatriot Automation Tool, authored and maintained by Maxwell McCormick.
Forks and derivative works are permitted under the Apache License 2.0 but are not endorsed or maintained by the author unless explicitly stated.
Trademark: "CyberPatriot Automation Tool" is an unregistered trademark of Maxwell McCormick. Use of the name or branding in derivative works is not permitted without permission. See NOTICE for details.
Easy Mode (Recommended):
Simply double-click RUN.bat and follow the menu!
Command Line:
git clone https://github.com/maxwellmccormick/CyberPatriotAutomation.git
cd CyberPatriotAutomation
# Build and run
dotnet build
cd src
dotnet run -- --all --dry-rungit clone https://github.com/NotMaxwell/CyberPatriotAutomation.git cd CyberPatriotAutomation
dotnet build cd src dotnet run -- --all --dry-run
## β¨ Features
| Feature | Description |
|---------|-------------|
| **README Parser** | Extracts users, services, software from competition README |
| **Password Policy** | Enforces NIST SP 800-63B compliant password policies |
| **User Management** | Creates, deletes, and fixes user permissions |
| **Service Hardening** | Disables 60+ insecure services |
| **Firewall Config** | Blocks 26+ dangerous ports |
| **Security Hardening** | Applies 40+ registry security settings |
| **Media Scanner** | Finds and removes prohibited files with backup |
| **Audit Policies** | Enables comprehensive Windows auditing |
## π Prerequisites
- [.NET 10.0 SDK](https://dotnet.microsoft.com/download/dotnet/10.0) or later
- Windows 10/11 or Windows Server 2019+
- Administrator privileges
## π§ Installation
### Option 1: Clone and Build
```powershell
git clone https://github.com/yourusername/CyberPatriotAutomation.git
cd CyberPatriotAutomation
# Restore dependencies
dotnet restore
# Build
dotnet build --configuration Release
# Run tests
dotnet test
git clone https://github.com/NotMaxwell/CyberPatriotAutomation.git cd CyberPatriotAutomation
dotnet restore
dotnet build --configuration Release
dotnet test
### Option 2: Download Release
Download the latest release from the [Releases](https://github.com/NotMaxwell/CyberPatriotAutomation/releases) page.
## π Usage
### Basic Commands
```powershell
# Run all tasks (dry run - preview only)
dotnet run -- --all --dry-run
# Run all tasks with README
dotnet run -- --readme "C:\Users\Public\Desktop\README.html" --all
# Auto-find README and run all tasks
dotnet run -- --auto-readme --all
# Parse README only (don't run tasks)
dotnet run -- --readme "README.html" --parse-readme
# Password policy enforcement
dotnet run -- --password-policy
# User management (requires README)
dotnet run -- --readme "README.html" --user-management
# Service management
dotnet run -- --service-management
# Firewall configuration
dotnet run -- --firewall
# Security hardening
dotnet run -- --security-hardening
# Media scanner
dotnet run -- --media-scan| Argument | Short | Description |
|---|---|---|
--readme <file> |
-r |
Path to competition README file |
--auto-readme |
-R |
Auto-find README in common locations |
--parse-readme |
Only parse and display README data | |
--dry-run |
-d |
Preview changes without applying |
--no-interactive |
Run without confirmation prompts | |
--password-policy |
-p |
Password policy enforcement |
--account-permissions |
-a |
Account permissions check |
--user-management |
-u |
User management (requires README) |
--service-management |
-s |
Service management |
--audit-policy |
-t |
Audit policy configuration |
--firewall |
-f |
Firewall configuration |
--security-hardening |
-h |
Security hardening |
--media-scan |
-m |
Prohibited media scanner |
--all |
Run all tasks |
# Run all tests
dotnet test
# Run with detailed output
dotnet test -v n
# Run specific test class
dotnet test --filter "FirewallConfigurationTaskTests"
# Generate coverage report
dotnet test --collect:"XPlat Code Coverage"Tests are automatically run on Release builds.
CyberPatriotAutomation/
βββ π RUN.bat # Easy-run script (double-click to use!)
βββ π RUN.ps1 # PowerShell run script
βββ π LICENSE # Apache License 2.0
βββ π NOTICE # Attribution & trademark notice
βββ π README.md # This file
βββ π .editorconfig # Code style settings
βββ π src/ # Source code
β βββ π Program.cs # Entry point
β βββ π CyberPatriotAutomation.csproj
β βββ π Core/
β βββ π AppConfig.cs # Configuration and defaults
β βββ π Models/ # Data models
β βββ π Tasks/ # Security task implementations
β βββ π Utilities/ # Helper classes
βββ π tests/ # Unit tests (xUnit)
βββ π scripts/ # Build and format scripts
β βββ format.bat # Code formatter (like Spotless)
β βββ format.ps1
βββ π docs/ # Documentation
β βββ CLAUDE.md # AI assistant instructions
β βββ CONTRIBUTING.md # How to contribute
β βββ TASK_ANALYSIS.md # Task roadmap
βββ π SampleData/ # Sample README files
| Setting | Value | Description |
|---|---|---|
| Minimum Length | 14 chars | Strong password minimum |
| Maximum Age | 60 days | Forced password change |
| History | 24 passwords | Prevents password reuse |
| Lockout Threshold | 5 attempts | Account lockout trigger |
| Lockout Duration | 30 minutes | Auto-unlock time |
| Port | Service |
|---|---|
| 20-21 | FTP |
| 22 | SSH |
| 23 | Telnet |
| 25 | SMTP |
| 69 | TFTP |
| 135 | RPC |
| 137-139 | NetBIOS |
| 161-162 | SNMP |
| 445 | SMB |
| 3389 | RDP |
| 5900-5902 | VNC |
- Remote Desktop, Remote Registry, Remote Access
- Telnet, FTP, SMTP, SNMP
- Xbox services, HomeGroup
- Network Discovery (SSDP, UPnP)
- And many more...
We welcome contributions! Please follow these steps:
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Write tests for your changes
- Commit your changes:
git commit -m 'Add amazing feature' - Push to the branch:
git push origin feature/amazing-feature - Open a Pull Request
- Follow Microsoft C# coding conventions
- Use
async/awaitfor I/O operations - All new features require unit tests
- Use Spectre.Console for UI output
- Tasks must inherit from
BaseTask
- Create task in
Tasks/directory - Inherit from
BaseTask - Implement
ReadSystemStateAsync(),ExecuteAsync(),VerifyAsync() - Add CLI flag in
Program.cs - Add unit tests in
Tests/ - Update this README
This project includes instructions for AI assistants:
CLAUDE.md- Comprehensive instructions for Claude AI.github/copilot-instructions.md- GitHub Copilot instructions
These files help AI assistants understand the project structure, coding patterns, and contribute effectively.
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
Under Apache 2.0, you must:
- Retain all copyright notices and attributions
- Include the NOTICE file with any distribution
- State changes made to the original code
"CyberPatriot Automation Tool" is an unregistered trademark of Maxwell McCormick. Derivative works must be renamed and may not use this branding without permission.
This tool is designed for CyberPatriot competition use. Always:
- Run with
--dry-runfirst to preview changes - Backup important data before running
- Run as Administrator for full functionality
- Never disable CCS Client - it's the scoring engine
- TASK_ANALYSIS.md - Detailed task analysis and roadmap
- CLAUDE.md - AI assistant development guide
- Spectre.Console - Beautiful console UI
- xUnit - Testing framework
- FluentAssertions - Assertion library
- CyberPatriot community for checklists and best practices