-
Notifications
You must be signed in to change notification settings - Fork 6
/
find-browserid.sh
executable file
·36 lines (25 loc) · 1.25 KB
/
find-browserid.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/bash
inputfile="input-browserid.txt"
outputdir="webbrowserid"
cat output-prod-owned.txt | sed -r 's/[\* ]+//' > $inputfile
outputfile="output-browserid.txt"
#####
exec `cat /dev/null > $outputfile`
exec `rm -rf $outputdir > /dev/null`
input=`cat $inputfile`
for address in $input; do
domain=`echo $address | sed -r 's/^(.+\/\/)([^/]+)(.*)/\2/'`
echo "Scanning $address"
exec `wget -D $domain -R .swf,.JPG,.PNG,.GIF,.tiff,.bmp,*smartproxy*,.ppt,.ics,.gz,.xpi,.pdf,.exe,.rss,.js,.png,.css,.gif,.jpg,.ico,.flv,.dmg,.zip,.txt -Q 2000k -q -l 1 -r -nc --connect-timeout=5 -P$outputdir --no-check-certificate --html-extension -U "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:2.0.1) Gecko/20100101 Firefox/9.0.1" $address`
numberfound=`grep -lriE "(browserid\.org)" ./$outputdir/$domain --include=*.html | wc -l | sed 's/ //g'`
# Some domains redirect to www.$domain and thus WGET will store them in that directory. Double check to see if that directory exists.
if [ $numberfound -lt 1 ]; then
numberfound=`grep -lriE "(browserid\.org)" ./$outputdir/www.$domain --include=*.html | wc -l | sed 's/ //g'`
fi
if [ $numberfound -ge 1 ]; then
echo "$address" >> $outputfile
fi
echo "deleting $domain"
exec `rm -rf $outputdir/$domain`
done
echo "Done".