Created
October 4, 2014 14:32
-
-
Save bravo-kernel/932a6ed3f7643d69f304 to your computer and use it in GitHub Desktop.
Update and run Shellshocker at login
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Update and run Shellshocker at login (by adding script to ~/.bashrc). | |
# Assumes cloned https://github.com/wreiske/shellshocker repositiory | |
DIR=/home/vagrant/.shellshocker | |
SCRIPT=/home/vagrant/.shellshocker/shellshock_test.sh | |
LOG=$DIR/log | |
# Update git repository | |
printf "\n * Updating Shellshocker\n" | |
cd $DIR | |
git fetch --all --quiet | |
git reset --hard origin/master --quiet | |
# Run detection script | |
printf " * Scanning for bash vulnerabilities: " | |
$SCRIPT > $LOG 2>&1 | |
if [ $? -ne 0 ]; then | |
printf "\n" | |
awk '/VULNERABLE/ {print " - " $0}' $LOG | |
printf "\n" | |
else | |
printf "none found.\n\n" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment