Created
March 26, 2015 19:59
-
-
Save s5csimmons/f7cd19a27c8803af1574 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
for website in $(awk --posix '/ServerName/ { if ( $2 !~ /([0-9]{1,3}\.){3}[0-9]+/ && $2 != ENVIRON["HOSTNAME"] && $2 !~ /^_wildcard_/ ) print $2 }' /etc/httpd/conf/httpd.conf) | |
do | |
((totalSites++)) | |
curl -s http://labs.sucuri.net/?is-my-wordpress-ddosing=$website | grep -q "Good: Your Website" | |
[ "$?" -ne "0" ] && badSites+=($website) || ((goodSites++)) | |
sleep 1 | |
done | |
echo "Out of $totalSites total websites on this server, $goodSites of them are clean." | |
[ "${badSites[0]}" ] && echo "The following sites came back as having been a part of a DDoS attack though:"; printf '%s\n' ${badSites[*]} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment