Skip to content

Instantly share code, notes, and snippets.

@Caffe1neAdd1ct
Last active August 29, 2015 14:06
Show Gist options
  • Select an option

  • Save Caffe1neAdd1ct/2666ed3241b0249c8209 to your computer and use it in GitHub Desktop.

Select an option

Save Caffe1neAdd1ct/2666ed3241b0249c8209 to your computer and use it in GitHub Desktop.
Bash CVE shellshock testing script
#!/bin/bash
INJECTION="All your bash"
OUTPUT=$(env x='() { :;}; echo '"$INJECTION"'' bash -c "echo are belong to us." 2>&1);
if [[ $OUTPUT == *"$INJECTION"* ]]
then
echo -e "WARNING THIS SERVER IS VULNERABLE - UPDATE BASH NOW."
else
echo -e "All clear you can relax!";
fi
@Caffe1neAdd1ct

Copy link
Copy Markdown
Author

Run using:

wget https://gist.githubusercontent.com/Caffe1neAdd1ct/2666ed3241b0249c8209/raw/d43f4fc201a3d517e6726c5467ee483c66b24a01/shellshock-tester.sh && chmod +x shellshock-tester.sh && ./shellshock-tester.sh

CentOS / Fedora:

yum update bash

Ubuntu / Debian

apt-get update
apt-get upgrade bash

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment