mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2026-08-04 14:55:40 +00:00
Initial support to automatically work around the dynamic page at each refresh
(Major refactor to the comparison algorithm (True/False response))
This commit is contained in:
parent
3fe493b63d
commit
d0d6632c22
6 changed files with 85 additions and 12 deletions
|
|
@ -68,5 +68,29 @@ def comparison(page, headers=None, content=False):
|
|||
return False
|
||||
|
||||
# By default it returns the page content MD5 hash
|
||||
else:
|
||||
if not conf.equalLines and not conf.contentLengths:
|
||||
return md5.new(page).hexdigest()
|
||||
|
||||
# TODO: ahead here
|
||||
elif conf.equalLines:
|
||||
counter = 0
|
||||
trueLines = 0
|
||||
pageLines = page.split("\n")
|
||||
|
||||
for commonLine in conf.equalLines:
|
||||
if counter >= len(pageLines):
|
||||
break
|
||||
|
||||
if commonLine in pageLines:
|
||||
trueLines += 1
|
||||
|
||||
counter += 1
|
||||
|
||||
# TODO: just debug prints
|
||||
print "trueLines:", trueLines, "len(conf.equalLines):", len(conf.equalLines)
|
||||
print "result:", ( trueLines * 100 ) / len(conf.equalLines)
|
||||
|
||||
if ( trueLines * 100 ) / len(conf.equalLines) >= 98:
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
|
|
|
|||
|
|
@ -269,7 +269,7 @@ class Connect:
|
|||
page, headers = Connect.getPage(get=get, post=post, cookie=cookie, ua=ua)
|
||||
|
||||
if content:
|
||||
return page
|
||||
return page, headers
|
||||
elif page and headers:
|
||||
return comparison(page, headers, content)
|
||||
else:
|
||||
|
|
|
|||
|
|
@ -340,6 +340,6 @@ def goStacked(expression):
|
|||
query = agent.prefixQuery("; %s" % expression)
|
||||
query = agent.postfixQuery("%s;%s" % (query, comment))
|
||||
payload = agent.payload(newValue=query)
|
||||
page = Request.queryPage(payload, content=True)
|
||||
page, _ = Request.queryPage(payload, content=True)
|
||||
|
||||
return payload, page
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue