mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-02-18 04:20:35 +03:00
several bug fixes
This commit is contained in:
parent
043b189a4c
commit
71d0b1bcd7
|
@ -423,7 +423,7 @@ Sylphid <sylphid.su@sti.com.tw>
|
||||||
for suggesting some features
|
for suggesting some features
|
||||||
|
|
||||||
ToR <sstidus@email.it>
|
ToR <sstidus@email.it>
|
||||||
for reporting a minor bug
|
for reporting several bugs
|
||||||
|
|
||||||
== Organizations ==
|
== Organizations ==
|
||||||
|
|
||||||
|
|
|
@ -104,7 +104,7 @@ def heuristicCheckSqlInjection(place, parameter, value):
|
||||||
|
|
||||||
payload = "%s%s%s" % (prefix, randomStr(length=10, alphabet=['"', '\'', ')', '(']), postfix)
|
payload = "%s%s%s" % (prefix, randomStr(length=10, alphabet=['"', '\'', ')', '(']), postfix)
|
||||||
payload = agent.payload(place, parameter, value, payload)
|
payload = agent.payload(place, parameter, value, payload)
|
||||||
Request.queryPage(payload, place)
|
Request.queryPage(payload, place, raise404=False)
|
||||||
result = wasLastRequestError()
|
result = wasLastRequestError()
|
||||||
|
|
||||||
infoMsg = "(error based) heuristics shows that %s " % place
|
infoMsg = "(error based) heuristics shows that %s " % place
|
||||||
|
@ -154,6 +154,9 @@ def checkDynamicContent(firstPage, secondPage):
|
||||||
are dynamic, proper markings will be made.
|
are dynamic, proper markings will be made.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
if kb.nullConnection:
|
||||||
|
return
|
||||||
|
|
||||||
infoMsg = "searching for dynamic content"
|
infoMsg = "searching for dynamic content"
|
||||||
logger.info(infoMsg)
|
logger.info(infoMsg)
|
||||||
|
|
||||||
|
@ -245,6 +248,7 @@ def checkStability():
|
||||||
|
|
||||||
if test:
|
if test:
|
||||||
conf.string = test
|
conf.string = test
|
||||||
|
kb.nullConnection = None
|
||||||
else:
|
else:
|
||||||
raise sqlmapSilentQuitException
|
raise sqlmapSilentQuitException
|
||||||
|
|
||||||
|
@ -254,6 +258,7 @@ def checkStability():
|
||||||
|
|
||||||
if test:
|
if test:
|
||||||
conf.regex = test
|
conf.regex = test
|
||||||
|
kb.nullConnection = None
|
||||||
else:
|
else:
|
||||||
raise sqlmapSilentQuitException
|
raise sqlmapSilentQuitException
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -18,8 +18,12 @@ from lib.core.data import logger
|
||||||
from lib.core.session import setMatchRatio
|
from lib.core.session import setMatchRatio
|
||||||
|
|
||||||
def comparison(page, headers=None, getSeqMatcher=False, pageLength=None):
|
def comparison(page, headers=None, getSeqMatcher=False, pageLength=None):
|
||||||
|
if page is None and pageLength is None:
|
||||||
|
return None
|
||||||
|
|
||||||
regExpResults = None
|
regExpResults = None
|
||||||
|
|
||||||
|
if page:
|
||||||
# String to be excluded before calculating page hash
|
# String to be excluded before calculating page hash
|
||||||
if conf.eString and conf.eString in page:
|
if conf.eString and conf.eString in page:
|
||||||
index = page.index(conf.eString)
|
index = page.index(conf.eString)
|
||||||
|
@ -49,6 +53,7 @@ def comparison(page, headers=None, getSeqMatcher=False, pageLength=None):
|
||||||
return re.search(conf.regexp, page, re.I | re.M) is not None
|
return re.search(conf.regexp, page, re.I | re.M) is not None
|
||||||
|
|
||||||
# Dynamic content lines to be excluded before calculating page hash
|
# Dynamic content lines to be excluded before calculating page hash
|
||||||
|
if not kb.nullConnection:
|
||||||
for item in kb.dynamicMarkings:
|
for item in kb.dynamicMarkings:
|
||||||
prefix, postfix = item
|
prefix, postfix = item
|
||||||
if prefix is None:
|
if prefix is None:
|
||||||
|
@ -58,7 +63,7 @@ def comparison(page, headers=None, getSeqMatcher=False, pageLength=None):
|
||||||
else:
|
else:
|
||||||
page = re.sub('(?s)%s.+%s' % (prefix, postfix), '%s%s' % (prefix, postfix), page)
|
page = re.sub('(?s)%s.+%s' % (prefix, postfix), '%s%s' % (prefix, postfix), page)
|
||||||
|
|
||||||
if not pageLength and page:
|
if not pageLength:
|
||||||
pageLength = len(page)
|
pageLength = len(page)
|
||||||
|
|
||||||
if kb.locks.seqLock:
|
if kb.locks.seqLock:
|
||||||
|
|
|
@ -214,10 +214,10 @@ class Connect:
|
||||||
except urllib2.HTTPError, e:
|
except urllib2.HTTPError, e:
|
||||||
if e.code == 401:
|
if e.code == 401:
|
||||||
errMsg = "not authorized, try to provide right HTTP "
|
errMsg = "not authorized, try to provide right HTTP "
|
||||||
errMsg += "authentication type and valid credentials"
|
errMsg += "authentication type and valid credentials (%d)" % e.code
|
||||||
raise sqlmapConnectionException, errMsg
|
raise sqlmapConnectionException, errMsg
|
||||||
elif e.code == 404 and raise404:
|
elif e.code == 404 and raise404:
|
||||||
errMsg = "page not found"
|
errMsg = "page not found (%d)" % e.code
|
||||||
raise sqlmapConnectionException, errMsg
|
raise sqlmapConnectionException, errMsg
|
||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
|
@ -285,7 +285,7 @@ class Connect:
|
||||||
return page, responseHeaders
|
return page, responseHeaders
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def queryPage(value=None, place=None, content=False, getSeqMatcher=False, silent=False, method=None, auxHeaders=None, response=False):
|
def queryPage(value=None, place=None, content=False, getSeqMatcher=False, silent=False, method=None, auxHeaders=None, response=False, raise404 = None):
|
||||||
"""
|
"""
|
||||||
This method calls a function to get the target url page content
|
This method calls a function to get the target url page content
|
||||||
and returns its page MD5 hash or a boolean value in case of
|
and returns its page MD5 hash or a boolean value in case of
|
||||||
|
@ -302,7 +302,7 @@ class Connect:
|
||||||
page = None
|
page = None
|
||||||
pageLength = None
|
pageLength = None
|
||||||
uri = None
|
uri = None
|
||||||
raise404 = place != "URI"
|
raise404 = place != "URI" if raise404 is None else raise404
|
||||||
toUrlencode = { "GET": True, "POST": True, "Cookie": conf.cookieUrlencode, "User-Agent": True, "URI": False }
|
toUrlencode = { "GET": True, "POST": True, "Cookie": conf.cookieUrlencode, "User-Agent": True, "URI": False }
|
||||||
|
|
||||||
if not place:
|
if not place:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user