File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2020from lib .core .revision import getRevisionNumber
2121
2222# sqlmap version and site
23- VERSION = "1.0.0.8 "
23+ VERSION = "1.0.0.9 "
2424REVISION = getRevisionNumber ()
2525STABLE = VERSION .count ('.' ) <= 2
2626VERSION_STRING = "sqlmap/%s#%s" % (VERSION , "stable" if STABLE else "dev" )
Original file line number Diff line number Diff line change 1414
1515import sys
1616import urllib
17+ import urllib2
18+
19+ TIMEOUT = 10
1720
1821def get_pagerank (url ):
1922 url = url .encode ('utf8' ) if isinstance (url , unicode ) else url
2023 _ = 'http://toolbarqueries.google.com/tbr?client=navclient-auto&features=Rank&ch=%s&q=info:%s' % (check_hash (hash_url (url )), urllib .quote (url ))
2124 try :
22- f = urllib . urlopen (_ )
23- rank = f .read ().strip ()[9 :]
24- except Exception :
25+ req = urllib2 . Request (_ )
26+ rank = urllib2 . urlopen ( req , timeout = TIMEOUT ) .read ().strip ()[9 :]
27+ except :
2528 rank = 'N/A'
2629 else :
2730 rank = '0' if not rank or not rank .isdigit () else rank
You can’t perform that action at this time.
0 commit comments