Skip to content

Instantly share code, notes, and snippets.

@stahnma
Created December 22, 2015 05:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stahnma/5d1721ee11033c612938 to your computer and use it in GitHub Desktop.
Save stahnma/5d1721ee11033c612938 to your computer and use it in GitHub Desktop.
#!/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