Skip to content

Instantly share code, notes, and snippets.

@k4kfh
Last active December 8, 2017 23:15
Show Gist options
  • Save k4kfh/376a00bcb0f1ee87bbdb329b27fef1b6 to your computer and use it in GitHub Desktop.
Save k4kfh/376a00bcb0f1ee87bbdb329b27fef1b6 to your computer and use it in GitHub Desktop.
Script to knock out the low hanging fruit on CyberPatriot Linux
#!/bin/bash
echo "-- UNDERGROUND CYBERNINJAS --"
echo "-- Linux Easy Button Script --"
echo ""
echo "Enabling firewall..."
sudo ufw enable
echo ""
echo "Listing unauthorized users (make sure you've filled in authorized_users.txt)..."
ls /home | grep -vf "./authorized_users.txt"
echo ""
echo "Listing ports you are listening on..."
sudo netstat -tulpn
echo ""
echo "Listing packages with suspicious descriptions..."
dpkg --list | grep -e "crack" -e "hack" -e "exploit"
echo ""
echo "Attempting to remove 'hacking tools' such as john, hydra, nmap, armitage, wireshark"
sudo apt-get autoremove --purge john hydra nmap wireshark
echo ""
echo "Disabling root login..."
sudo passwd -l root
echo ""
echo "Disabling the guest account..."
sudo mkdir /etc/lightdm/lightdm.conf.d
sudo sh -c 'printf "[SeatDefaults]\nallow-guest=false\n" > /etc/lightdm/lightdm.conf.d/50-no-guest.conf'
echo ""
echo "Updating applications..."
sudo apt-get update && sudo apt-get upgrade -y
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment