mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2026-08-28 12:42:18 +00:00
Implementation for an Issue #118
This commit is contained in:
parent
42f518b2d6
commit
f8c9868cb6
11 changed files with 39 additions and 29 deletions
|
|
@ -855,7 +855,7 @@ class Agent:
|
|||
return re.sub("(%s.*?%s)" % (PAYLOAD_DELIMITER, PAYLOAD_DELIMITER), ("%s%s%s" % (PAYLOAD_DELIMITER, payload, PAYLOAD_DELIMITER)).replace("\\", r"\\"), inpStr) if inpStr else inpStr
|
||||
|
||||
def runAsDBMSUser(self, query):
|
||||
if conf.dCred and "Ad Hoc Distributed Queries" not in query:
|
||||
if conf.dbmsCred and "Ad Hoc Distributed Queries" not in query:
|
||||
query = getSQLSnippet(DBMS.MSSQL, "run_statement_as_user", USER=conf.dbmsUsername, PASSWORD=conf.dbmsPassword, STATEMENT=query.replace("'", "''"))
|
||||
|
||||
return query
|
||||
|
|
|
|||
|
|
@ -3211,11 +3211,11 @@ def resetCookieJar(cookieJar):
|
|||
Cleans cookies from a given cookie jar
|
||||
"""
|
||||
|
||||
if not conf.loC:
|
||||
if not conf.loadCookies:
|
||||
cookieJar.clear()
|
||||
else:
|
||||
try:
|
||||
cookieJar.load(conf.loC)
|
||||
cookieJar.load(conf.loadCookies)
|
||||
cookieJar.clear_expired_cookies()
|
||||
except cookielib.LoadError, msg:
|
||||
errMsg = "there was a problem loading "
|
||||
|
|
|
|||
|
|
@ -150,7 +150,7 @@ def __urllib2Opener():
|
|||
handlers = [proxyHandler, authHandler, redirectHandler, rangeHandler, httpsHandler]
|
||||
|
||||
if not conf.dropSetCookie:
|
||||
if not conf.loC:
|
||||
if not conf.loadCookies:
|
||||
conf.cj = cookielib.CookieJar()
|
||||
else:
|
||||
conf.cj = cookielib.MozillaCookieJar()
|
||||
|
|
@ -562,13 +562,13 @@ def __setDBMSAuthentication():
|
|||
another user, not the session user
|
||||
"""
|
||||
|
||||
if not conf.dCred:
|
||||
if not conf.dbmsCred:
|
||||
return
|
||||
|
||||
debugMsg = "setting the DBMS authentication credentials"
|
||||
logger.debug(debugMsg)
|
||||
|
||||
match = re.search("^(.+?):(.*?)$", conf.dCred)
|
||||
match = re.search("^(.+?):(.*?)$", conf.dbmsCred)
|
||||
|
||||
if not match:
|
||||
errMsg = "DBMS authentication credentials value must be in format "
|
||||
|
|
@ -1730,7 +1730,7 @@ def __setTrafficOutputFP():
|
|||
conf.trafficFP = openFile(conf.trafficFile, "w+")
|
||||
|
||||
def __setDNSServer():
|
||||
if not conf.dName:
|
||||
if not conf.dnsName:
|
||||
return
|
||||
|
||||
infoMsg = "setting up DNS server instance"
|
||||
|
|
@ -1944,9 +1944,9 @@ def __basicOptionValidation():
|
|||
errMsg += "supported charsets"
|
||||
raise sqlmapSyntaxException, errMsg
|
||||
|
||||
if conf.loC:
|
||||
if not os.path.exists(conf.loC):
|
||||
errMsg = "cookies file '%s' does not exist" % conf.loC
|
||||
if conf.loadCookies:
|
||||
if not os.path.exists(conf.loadCookies):
|
||||
errMsg = "cookies file '%s' does not exist" % conf.loadCookies
|
||||
raise sqlmapFilePathException, errMsg
|
||||
|
||||
def __resolveCrossReferences():
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ optDict = {
|
|||
"data": "string",
|
||||
"pDel": "string",
|
||||
"cookie": "string",
|
||||
"loC": "string",
|
||||
"loadCookies": "string",
|
||||
"cookieUrlencode": "boolean",
|
||||
"dropSetCookie": "boolean",
|
||||
"agent": "string",
|
||||
|
|
@ -87,7 +87,7 @@ optDict = {
|
|||
"timeSec": "integer",
|
||||
"uCols": "string",
|
||||
"uChar": "string",
|
||||
"dName": "string"
|
||||
"dnsName": "string"
|
||||
},
|
||||
|
||||
"Fingerprint": {
|
||||
|
|
@ -171,7 +171,7 @@ optDict = {
|
|||
"checkTor": "boolean",
|
||||
"crawlDepth": "integer",
|
||||
"csvDel": "string",
|
||||
"dCred": "string",
|
||||
"dbmsCred": "string",
|
||||
"eta": "boolean",
|
||||
"flushSession": "boolean",
|
||||
"forms": "boolean",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue