Last active
November 29, 2016 15:31
-
-
Save noushi/f50468678a581023a8e2 to your computer and use it in GitHub Desktop.
GHOST check in
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 | |
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 |
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 | |
# 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