mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-06-06 14:13:15 +03:00
Minor style update
This commit is contained in:
parent
d95dd2d16e
commit
f08eb0fd9f
|
@ -119,7 +119,7 @@ class MOBILES:
|
||||||
NEXUS = ("Google Nexus 7", "Mozilla/5.0 (Linux; Android 4.1.1; Nexus 7 Build/JRO03D) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.166 Safari/535.19")
|
NEXUS = ("Google Nexus 7", "Mozilla/5.0 (Linux; Android 4.1.1; Nexus 7 Build/JRO03D) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.166 Safari/535.19")
|
||||||
NOKIA = ("Nokia N97", "Mozilla/5.0 (SymbianOS/9.4; Series60/5.0 NokiaN97-1/10.0.012; Profile/MIDP-2.1 Configuration/CLDC-1.1; en-us) AppleWebKit/525 (KHTML, like Gecko) WicKed/7.1.12344")
|
NOKIA = ("Nokia N97", "Mozilla/5.0 (SymbianOS/9.4; Series60/5.0 NokiaN97-1/10.0.012; Profile/MIDP-2.1 Configuration/CLDC-1.1; en-us) AppleWebKit/525 (KHTML, like Gecko) WicKed/7.1.12344")
|
||||||
|
|
||||||
class PROXYTYPE:
|
class PROXY_TYPE:
|
||||||
HTTP = "HTTP"
|
HTTP = "HTTP"
|
||||||
SOCKS4 = "SOCKS4"
|
SOCKS4 = "SOCKS4"
|
||||||
SOCKS5 = "SOCKS5"
|
SOCKS5 = "SOCKS5"
|
||||||
|
|
|
@ -69,7 +69,7 @@ from lib.core.enums import HTTPMETHOD
|
||||||
from lib.core.enums import MOBILES
|
from lib.core.enums import MOBILES
|
||||||
from lib.core.enums import PAYLOAD
|
from lib.core.enums import PAYLOAD
|
||||||
from lib.core.enums import PRIORITY
|
from lib.core.enums import PRIORITY
|
||||||
from lib.core.enums import PROXYTYPE
|
from lib.core.enums import PROXY_TYPE
|
||||||
from lib.core.enums import REFLECTIVE_COUNTER
|
from lib.core.enums import REFLECTIVE_COUNTER
|
||||||
from lib.core.enums import WIZARD
|
from lib.core.enums import WIZARD
|
||||||
from lib.core.exception import sqlmapConnectionException
|
from lib.core.exception import sqlmapConnectionException
|
||||||
|
@ -924,8 +924,8 @@ def __setHTTPProxy():
|
||||||
except:
|
except:
|
||||||
pass #drops into the next check block
|
pass #drops into the next check block
|
||||||
|
|
||||||
if not all((scheme, hasattr(PROXYTYPE, scheme), hostname, port)):
|
if not all((scheme, hasattr(PROXY_TYPE, scheme), hostname, port)):
|
||||||
errMsg = "proxy value must be in format '(%s)://url:port'" % "|".join(_[0].lower() for _ in getPublicTypeMembers(PROXYTYPE))
|
errMsg = "proxy value must be in format '(%s)://url:port'" % "|".join(_[0].lower() for _ in getPublicTypeMembers(PROXY_TYPE))
|
||||||
raise sqlmapSyntaxException, errMsg
|
raise sqlmapSyntaxException, errMsg
|
||||||
|
|
||||||
if conf.pCred:
|
if conf.pCred:
|
||||||
|
@ -938,8 +938,8 @@ def __setHTTPProxy():
|
||||||
username = _.group(1)
|
username = _.group(1)
|
||||||
password = _.group(2)
|
password = _.group(2)
|
||||||
|
|
||||||
if scheme in (PROXYTYPE.SOCKS4, PROXYTYPE.SOCKS5):
|
if scheme in (PROXY_TYPE.SOCKS4, PROXY_TYPE.SOCKS5):
|
||||||
socks.setdefaultproxy(socks.PROXY_TYPE_SOCKS5 if scheme == PROXYTYPE.SOCKS5 else socks.PROXY_TYPE_SOCKS4, hostname, port, username=username, password=password)
|
socks.setdefaultproxy(socks.PROXY_TYPE_SOCKS5 if scheme == PROXY_TYPE.SOCKS5 else socks.PROXY_TYPE_SOCKS4, hostname, port, username=username, password=password)
|
||||||
socks.wrapmodule(urllib2)
|
socks.wrapmodule(urllib2)
|
||||||
else:
|
else:
|
||||||
if conf.pCred:
|
if conf.pCred:
|
||||||
|
@ -1813,7 +1813,7 @@ def __setTorProxySettings():
|
||||||
if not conf.tor:
|
if not conf.tor:
|
||||||
return
|
return
|
||||||
|
|
||||||
if conf.torType == PROXYTYPE.HTTP:
|
if conf.torType == PROXY_TYPE.HTTP:
|
||||||
__setTorHttpProxySettings()
|
__setTorHttpProxySettings()
|
||||||
else:
|
else:
|
||||||
__setTorSocksProxySettings()
|
__setTorSocksProxySettings()
|
||||||
|
@ -1864,7 +1864,7 @@ def __setTorSocksProxySettings():
|
||||||
logger.info(infoMsg)
|
logger.info(infoMsg)
|
||||||
|
|
||||||
# Has to be SOCKS5 to prevent DNS leaks (http://en.wikipedia.org/wiki/Tor_%28anonymity_network%29)
|
# Has to be SOCKS5 to prevent DNS leaks (http://en.wikipedia.org/wiki/Tor_%28anonymity_network%29)
|
||||||
socks.setdefaultproxy(socks.PROXY_TYPE_SOCKS5 if conf.torType == PROXYTYPE.SOCKS5 else socks.PROXY_TYPE_SOCKS4, LOCALHOST, conf.torPort or DEFAULT_TOR_SOCKS_PORT)
|
socks.setdefaultproxy(socks.PROXY_TYPE_SOCKS5 if conf.torType == PROXY_TYPE.SOCKS5 else socks.PROXY_TYPE_SOCKS4, LOCALHOST, conf.torPort or DEFAULT_TOR_SOCKS_PORT)
|
||||||
socks.wrapmodule(urllib2)
|
socks.wrapmodule(urllib2)
|
||||||
|
|
||||||
def __checkTor():
|
def __checkTor():
|
||||||
|
@ -1973,8 +1973,8 @@ def __basicOptionValidation():
|
||||||
errMsg = "value for option '--tor-port' must be a positive integer"
|
errMsg = "value for option '--tor-port' must be a positive integer"
|
||||||
raise sqlmapSyntaxException, errMsg
|
raise sqlmapSyntaxException, errMsg
|
||||||
|
|
||||||
if conf.torType not in getPublicTypeMembers(PROXYTYPE, True):
|
if conf.torType not in getPublicTypeMembers(PROXY_TYPE, True):
|
||||||
errMsg = "option '--tor-type' accepts one of following values: %s" % ", ".join(getPublicTypeMembers(PROXYTYPE, True))
|
errMsg = "option '--tor-type' accepts one of following values: %s" % ", ".join(getPublicTypeMembers(PROXY_TYPE, True))
|
||||||
raise sqlmapSyntaxException, errMsg
|
raise sqlmapSyntaxException, errMsg
|
||||||
|
|
||||||
if conf.dumpFormat not in getPublicTypeMembers(DUMP_FORMAT, True):
|
if conf.dumpFormat not in getPublicTypeMembers(DUMP_FORMAT, True):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user