Skip to content

VeryFluffed/Cyberpatriot-Linux-Bashscript

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

7 Commits
Β 
Β 
Β 
Β 

Repository files navigation

Linux CyberPatriots Bash Script

A modular Bash script designed for CyberPatriot Linux competitions to rapidly harden systems, secure users, and configure services across multiple Linux distributions. I built this tool to maximize scoring efficiency under time pressure, cutting hours off manual hardening during competition rounds.

Features

Here's what you can do:

  • Modular Tool Selection: Pick and choose which hardening actions to run based on the image and competition requirements.

  • User & Account Security: Enumerates users from /etc/passwd, secures or removes unautorized users, and configures administrator status.

  • Common Tasks: Enforces strong password complexity (PAM files), Firewall configuration, and system updates/package management.

  • Service Hardening: Disables unnessesary or insecure services and locks down common attack vectors (FTP, SSH, nginx, etc.)

🎯 Achievements & Impact:

  • Top 100 National Semifinalist β€” Platinum Tier (2Γ—)
  • Top 1% nationwide among CyberPatriot competitors
  • #1 in California Gold Tier prior to advancing to Platinum
  • Recognized as the Linux specialist on the team, consistently assigned the most technically demanding tasks
  • Developed a reputation for high-efficiency scripting, shaving multiple hours off team workflow during live competition

πŸ‘©πŸ½β€πŸ³ The Process

This script was built iteratively for real competitions, not as a theoretical exercise.

Next, I made sure users could move elements around. This was important for adjusting drawings. After that, I added the ability to resize elements to give more control over the shapes.

I realized I spent a large portion of the 6 or 4 hours of the competition repeating the same tasks during ever round. So, I started by identifying repeatable, high-impact tasks that consumed the most time during early rounds: user management, password policy enforcement, firewall setup, and updates. Each feature was added only after validating that it improved speed without risking stability.

The script was structured to be modular and readable, allowing me to:

  • Enable or disable actions quickly
  • Adapt to unknown competition images
  • Debug issues under strict time constraints

Throughout development, I documented:

  • Scoring rubrics and common pitfalls
  • Which changes consistently earned points
  • Which actions could accidentally break services

This approach ensured the script was competition-safe, not just technically correct.

πŸ“š What I Learned

This project significantly strengthened my Linux security, scripting, and systems thinking skills.

🧠 Bash Scripting Under Constraints

  • Learned to write clear, defensive Bash that prioritizes safety and reversibility
  • Balanced automation speed with system integrity

πŸ” Linux System Hardening

  • Deepended understasnding of ser privilege models, PAM authentication, password policies, service management, and firewall behavior

⚑ Competition-Grade Efficiency

  • Optimized workflows for maximum point gain per minute
  • Reduced cognitive load during live rounds by automating repetitive checks

🧩 Risk-Aware Automation

  • Learned when not to automate
  • Designed logic that avoids breaking required services or scoring items

πŸ“ˆ Leadership & Trust

  • Became the team’s go-to Linux specialist
  • Earned trust to run scripts that affected the entire system image

🚦 Running the Project

To run the project in your local environment, follow these steps:

  1. Create a text file in terminal. Make sure it has .sh at the end of hte name. Type: sudo gedit script.sh
  2. Copy and paste the script file into the text file.
  3. Save the script and exit.
  4. Make script executable. Type: sudo chmod +x script.sh
  5. Run the script as root. Type : sudo ./script.sh

About

Bash script for Linux CyberPatriots

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages