Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
GHOST check in
#!/bin/bash
check_ghost=https://gist.githubusercontent.com/noushi/f50468678a581023a8e2/raw/86f299e33958a13baaca7d2d2705184f973ea49a/check_ghost
for dock in `docker ps | awk '{print $2;}' | tail -n +2 ` ; do
echo -n -e "$dock\t=>\t" ; curl -s $check_ghost | docker run -i $dock bash
done
#!/bin/bash
# This script checks for GHOST vulnerability in the system, using Python by default, or C otherwise.
# the output is either "vulnerable" or "not vulnerable"
has_python() {
[ -e "`which python >/dev/null`" ]
}
if has_python ; then
python -c 'import socket;y="0"*50000000;socket.gethostbyname(y); print "not vulnerable"' 2>/dev/null || echo "vulnerable"
else
wget -q https://webshare.uchicago.edu/orgs/ITServices/itsec/Downloads/GHOST.c
gcc GHOST.c -o GHOST >/dev/null
./GHOST
rm -f GHOST.c GHOST
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment