Minor patches

This commit is contained in:
Miroslav Štampar
2026-07-29 08:20:08 +02:00
parent 39d22d26c3
commit 3a680be4eb
11 changed files with 42 additions and 28 deletions
+1 -1
View File
@@ -67,7 +67,7 @@ def comparison(page, headers, code=None, getRatioValue=False, pageLength=None):
return _
def _adjust(condition, getRatioValue):
if not any((conf.string, conf.notString, conf.regexp, conf.code)):
if not any((conf.string, conf.notString, conf.regexp, conf.code, conf.lengths)):
# Negative logic approach is used in raw page comparison scheme as that what is "different" than original
# PAYLOAD.WHERE.NEGATIVE response is considered as True; in switch based approach negative logic is not
# applied as that what is by user considered as True is that what is returned by the comparison mechanism
+4 -2
View File
@@ -406,7 +406,8 @@ class Connect(object):
errMsg = "problem occurred while loading cookies from file '%s'" % conf.liveCookies
raise SqlmapValueException(errMsg)
cookie = openFile(conf.liveCookies).read().strip()
with openFile(conf.liveCookies) as f:
cookie = f.read().strip()
cookie = re.sub(r"(?i)\ACookie:\s*", "", cookie)
if multipart:
@@ -545,7 +546,8 @@ class Connect(object):
headers = forgeHeaders(auxHeaders, headers)
if kb.headersFile:
content = openFile(kb.headersFile, 'r').read()
with openFile(kb.headersFile, 'r') as f:
content = f.read()
for line in content.split("\n"):
line = getText(line.strip())
if ':' in line: