More verbose messages on successful --null-connection

This commit is contained in:
Bernardo Damele 2010-10-15 10:24:54 +00:00
parent 8883918ef9
commit 48cc8a308d

View File

@ -335,19 +335,21 @@ def checkNullConnection():
page, headers = Request.getPage(method="HEAD")
if not page and 'Content-Length' in headers:
kb.nullConnection = "HEAD"
infoMsg = "null connection is supported with HEAD header"
logger.info(infoMsg)
else:
page, headers = Request.getPage(auxHeaders={"Range":"bytes=-1"})
if page and len(page) == 1 and 'Content-Range' in headers:
kb.nullConnection = "Range"
infoMsg = "null connection is supported with GET header "
infoMsg += "'%s'" % kb.nullConnection
logger.info(infoMsg)
except sqlmapConnectionException, errMsg:
errMsg = getUnicode(errMsg)
raise sqlmapConnectionException, errMsg
if kb.nullConnection:
infoMsg = "method '%s' seems to be working" % kb.nullConnection
logger.info(infoMsg)
return kb.nullConnection is not None
def checkConnection():