Minor bug fix and adjustment to deal with Keep-Alive also against Google (-g)

This commit is contained in:
Bernardo Damele
2010-06-11 10:08:19 +00:00
parent 6f03a9ab5c
commit 9bce22683b
3 changed files with 24 additions and 17 deletions

View File

@@ -265,18 +265,26 @@ def __setGoogleDorking():
the results and save the testable hosts into the knowledge base.
"""
global proxyHandler
if not conf.googleDork:
return
global keepAliveHandler
global proxyHandler
debugMsg = "initializing Google dorking requests"
logger.debug(debugMsg)
logMsg = "first request to Google to get the session cookie"
logger.info(logMsg)
googleObj = Google(proxyHandler)
handlers = [ proxyHandler ]
# Use Keep-Alive (persistent HTTP connection) only if a proxy is not set
# Reference: http://www.w3.org/Protocols/rfc2616/rfc2616-sec8.html
if conf.keepAlive and not conf.proxy:
handlers.append(keepAliveHandler)
googleObj = Google(handlers)
googleObj.getCookie()
matches = googleObj.search(conf.googleDork)