#!/bin/bash

env x='() { :;}; echo vulnerable' bash -c "echo this is a test"
env X='() { (shellshocker.net)=>\' bash -c "echo date"; cat echo; rm ./echo
env X=' () { }; echo hello' bash -c 'date'
bash -c 'true <<EOF <<EOF <<EOF <<EOF <<EOF <<EOF <<EOF <<EOF <<EOF <<EOF <<EOF <<EOF <<EOF <<EOF' ||
echo "CVE-2014-7186 vulnerable, redir_stack"
(for x in {1..200} ; do echo "for x$x in ; do :"; done; for x in {1..200} ; do echo done ; done) | bash ||
echo "CVE-2014-7187 vulnerable, word_lineno"
shellshocker='() { echo You are vulnerable; }' bash -c shellshocker
bash -c "f() { x() { _;}; x() { _;} <<a; }" 2>/dev/null || echo vulnerable

