mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-02-16 19:40:37 +03:00
minor beautification
This commit is contained in:
parent
27d244b326
commit
c57941c102
|
@ -7,6 +7,7 @@ Copyright (c) 2006-2011 sqlmap developers (http://www.sqlmap.org/)
|
||||||
See the file 'doc/COPYING' for copying permission
|
See the file 'doc/COPYING' for copying permission
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
import httplib
|
||||||
import logging
|
import logging
|
||||||
import re
|
import re
|
||||||
import socket
|
import socket
|
||||||
|
@ -972,7 +973,7 @@ def checkConnection(suppressOutput=False):
|
||||||
errMsg = getUnicode(errMsg)
|
errMsg = getUnicode(errMsg)
|
||||||
logger.critical(errMsg)
|
logger.critical(errMsg)
|
||||||
|
|
||||||
if any(code in kb.httpErrorCodes for code in (404, )):
|
if any(code in kb.httpErrorCodes for code in (httplib.NOT_FOUND, )):
|
||||||
msg = "it is not recommended to continue in this kind of cases. Do you want to quit and make sure that everything is set up properly? [Y/n] "
|
msg = "it is not recommended to continue in this kind of cases. Do you want to quit and make sure that everything is set up properly? [Y/n] "
|
||||||
if readInput(msg, default="Y") not in ("n", "N"):
|
if readInput(msg, default="Y") not in ("n", "N"):
|
||||||
raise sqlmapSilentQuitException
|
raise sqlmapSilentQuitException
|
||||||
|
|
|
@ -425,11 +425,11 @@ class Connect:
|
||||||
|
|
||||||
logger.log(7, responseMsg)
|
logger.log(7, responseMsg)
|
||||||
|
|
||||||
if e.code == 401:
|
if e.code == httplib.UNAUTHORIZED:
|
||||||
errMsg = "not authorized, try to provide right HTTP "
|
errMsg = "not authorized, try to provide right HTTP "
|
||||||
errMsg += "authentication type and valid credentials (%d)" % code
|
errMsg += "authentication type and valid credentials (%d)" % code
|
||||||
raise sqlmapConnectionException, errMsg
|
raise sqlmapConnectionException, errMsg
|
||||||
elif e.code == 404:
|
elif e.code == httplib.NOT_FOUND:
|
||||||
if raise404:
|
if raise404:
|
||||||
errMsg = "page not found (%d)" % code
|
errMsg = "page not found (%d)" % code
|
||||||
raise sqlmapConnectionException, errMsg
|
raise sqlmapConnectionException, errMsg
|
||||||
|
@ -437,7 +437,7 @@ class Connect:
|
||||||
debugMsg = "page not found (%d)" % code
|
debugMsg = "page not found (%d)" % code
|
||||||
logger.debug(debugMsg)
|
logger.debug(debugMsg)
|
||||||
processResponse(page, responseHeaders)
|
processResponse(page, responseHeaders)
|
||||||
elif e.code == 504:
|
elif e.code == httplib.GATEWAY_TIMEOUT:
|
||||||
if ignoreTimeout:
|
if ignoreTimeout:
|
||||||
return None, None, None
|
return None, None, None
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user