mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-03-22 10:54:22 +03:00
minor optimization
This commit is contained in:
parent
d1f5c1d7b7
commit
6700cabc36
|
@ -48,6 +48,7 @@ from lib.core.exception import sqlmapUserQuitException
|
||||||
from lib.core.session import setString
|
from lib.core.session import setString
|
||||||
from lib.core.session import setRegexp
|
from lib.core.session import setRegexp
|
||||||
from lib.core.settings import DYNAMICITY_MARK_LENGTH
|
from lib.core.settings import DYNAMICITY_MARK_LENGTH
|
||||||
|
from lib.core.settings import UPPER_RATIO_BOUND
|
||||||
from lib.core.unescaper import unescaper
|
from lib.core.unescaper import unescaper
|
||||||
from lib.request.connect import Connect as Request
|
from lib.request.connect import Connect as Request
|
||||||
from lib.request.templates import getPageTemplate
|
from lib.request.templates import getPageTemplate
|
||||||
|
@ -636,25 +637,30 @@ def checkStability():
|
||||||
errMsg = "Empty value supplied"
|
errMsg = "Empty value supplied"
|
||||||
raise sqlmapNoneDataException, errMsg
|
raise sqlmapNoneDataException, errMsg
|
||||||
else:
|
else:
|
||||||
checkDynamicContent(firstPage, secondPage)
|
conf.seqMatcher.set_seq1(firstPage)
|
||||||
|
conf.seqMatcher.set_seq2(secondPage)
|
||||||
|
|
||||||
count = 0
|
# In case of an intolerable difference turn on dynamicity removal engine
|
||||||
while not Request.queryPage():
|
if conf.seqMatcher.quick_ratio() <= UPPER_RATIO_BOUND:
|
||||||
count += 1
|
|
||||||
|
|
||||||
if count > conf.retries:
|
|
||||||
errMsg = "target url is too dynamic. unable to continue. "
|
|
||||||
errMsg += "consider using other switches (e.g. "
|
|
||||||
errMsg += "--longest-common, --string, --text-only, etc.)"
|
|
||||||
raise sqlmapSiteTooDynamic, errMsg
|
|
||||||
|
|
||||||
warnMsg = "target url is heavily dynamic"
|
|
||||||
warnMsg += ", sqlmap is going to retry the request"
|
|
||||||
logger.critical(warnMsg)
|
|
||||||
|
|
||||||
secondPage, _ = Request.queryPage(content=True)
|
|
||||||
checkDynamicContent(firstPage, secondPage)
|
checkDynamicContent(firstPage, secondPage)
|
||||||
|
|
||||||
|
count = 0
|
||||||
|
while not Request.queryPage():
|
||||||
|
count += 1
|
||||||
|
|
||||||
|
if count > conf.retries:
|
||||||
|
errMsg = "target url is too dynamic. unable to continue. "
|
||||||
|
errMsg += "consider using other switches (e.g. "
|
||||||
|
errMsg += "--longest-common, --string, --text-only, etc.)"
|
||||||
|
raise sqlmapSiteTooDynamic, errMsg
|
||||||
|
|
||||||
|
warnMsg = "target url is heavily dynamic"
|
||||||
|
warnMsg += ", sqlmap is going to retry the request"
|
||||||
|
logger.critical(warnMsg)
|
||||||
|
|
||||||
|
secondPage, _ = Request.queryPage(content=True)
|
||||||
|
checkDynamicContent(firstPage, secondPage)
|
||||||
|
|
||||||
return kb.pageStable
|
return kb.pageStable
|
||||||
|
|
||||||
def checkString():
|
def checkString():
|
||||||
|
|
Loading…
Reference in New Issue
Block a user