Skip to content

Instantly share code, notes, and snippets.

@bravo-kernel
Created October 4, 2014 14:32
Show Gist options
  • Save bravo-kernel/932a6ed3f7643d69f304 to your computer and use it in GitHub Desktop.
Save bravo-kernel/932a6ed3f7643d69f304 to your computer and use it in GitHub Desktop.
Update and run Shellshocker at login
#!/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