Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
scan a range of ip's with nmap looking for wordpress sites
#!/bin/bash
#https://lerie.us/blog
#scan a range of ip's with nmap looking for wordpress sites
#lerie,11:29pm,6/6/18
#fxbg,11:57,6/6/18
#get nmap argument for ip range
if [ "$1" == "" ]; then
echo 'no argument set'
exit
fi
#find some sites by ip
printf "Scanning...\n"
nmap --open -p80 $1 >scan
#get all the ip's from the scan
printf "gathering...\n"
grep -oPi "\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}" scan >scan2
#get the status code from url from each ip
while read line; do
printf "checking $line: "
status=`curl -I -s "http://$line/wp-json" |head -n 1|cut -d$' ' -f2|tr '\n' ' '`
printf "$status\n"
done < scan2
printf "finished\n"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.