mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2026-10-25 05:06:10 +00:00
added null connection check
This commit is contained in:
parent
ecd6b573f7
commit
b745331974
4 changed files with 44 additions and 12 deletions
|
|
@ -437,6 +437,29 @@ def checkRegexp():
|
|||
|
||||
return False
|
||||
|
||||
def checkNullConnection():
|
||||
infoMsg = "testing NULL connection to the target url"
|
||||
logger.info(infoMsg)
|
||||
|
||||
try:
|
||||
page, headers = Request.getPage(method="HEAD")
|
||||
if not page and 'Content-Length' in headers:
|
||||
kb.nullConnection = "HEAD"
|
||||
else:
|
||||
page, headers = Request.getPage(auxHeaders={"Range":"bytes=-1"})
|
||||
if page and len(page) == 1 and 'Content-Range' in headers:
|
||||
kb.nullConnection = "Range"
|
||||
|
||||
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():
|
||||
try:
|
||||
socket.gethostbyname(conf.hostname)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue