-
-
Save stahnma/5d1721ee11033c612938 to your computer and use it in GitHub Desktop.
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 | |
OUTDIR=thehubs | |
n=`ls -1 /usr/bin | wc -l` | |
echo "/usr/bin contains $n files" | |
function findhubs() { | |
for file in `ls -1 /usr/bin` | |
do | |
if host ${file}hub.com &> /dev/null ; then | |
echo "Domain found for ${file}hub.com " | |
echo ${file}hub.com >> hub.log | |
fi | |
done | |
} | |
function findwebs() { | |
for domain in `cat hub.log` | |
do | |
echo -n $domain, | |
str="$domain," | |
#response=`curl -s -I -L $domain | head -1 | awk '{print $2}'` | |
curl --connect-timeout 4 -s -I -L -o file $domain | |
if [ $? == 0 ] ; then | |
head -1 file | awk '{print $2}' | |
str+=`head -1 file | awk '{print $2}'` | |
else | |
echo | |
fi | |
echo $str >> codes.log | |
done | |
} | |
function statweb() { | |
cut -d, -f2 codes.log | sort | uniq -c | |
} | |
function isitparked() { | |
mkdir -p ${OUTDIR}output ${OUTDIR}screens | |
for domain in `egrep ',2|,3' codes.log | cut -d, -f1` | |
do | |
echo $domain | |
curl -v --connect-timeout 4 -s -L $domain &> ${OUTDIR}output/$domain | |
CutyCapt --url=http://$domain --out=${OUTDIR}screens/${domain}.png | |
done | |
} | |
findhubs | |
findwebs | |
statweb | |
isitparked |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment