Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4a12493

Browse files
committed
Python3 fix (parsing of headers)
1 parent b2c8ba1 commit 4a12493

4 files changed

Lines changed: 4 additions & 4 deletions

File tree

extra/vulnserver/vulnserver.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ def do_REQUEST(self):
9898

9999
if "<script>" in unquote_plus(query):
100100
self.send_response(INTERNAL_SERVER_ERROR)
101+
self.send_header("X-Powered-By", "Express")
101102
self.send_header("Connection", "close")
102103
self.end_headers()
103104
self.wfile.write("CLOUDFLARE_ERROR_500S_BOX".encode(UNICODE_ENCODING))

lib/core/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
from thirdparty.six import unichr as _unichr
1919

2020
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
21-
VERSION = "1.5.1.38"
21+
VERSION = "1.5.1.39"
2222
TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable"
2323
TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34}
2424
VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE)

lib/core/testing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def vulnTest():
4646
("--dummy", ("all tested parameters do not appear to be injectable", "does not seem to be injectable", "there is not at least one", "~might be injectable")),
4747
("-u '<url>&id2=1' -p id2 -v 5 --flush-session --level=5 --test-filter='AND boolean-based blind - WHERE or HAVING clause (MySQL comment)'", ("~1AND",)),
4848
("--list-tampers", ("between", "MySQL", "xforwardedfor")),
49-
("-r <request> --flush-session -v 5 --test-skip='heavy' --save=<config>", ("CloudFlare", "possible DBMS: 'SQLite'", "User-agent: foobar", "~Type: time-based blind", "saved command line options to the configuration file")),
49+
("-r <request> --flush-session -v 5 --test-skip='heavy' --save=<config>", ("CloudFlare", "web application technology: Express", "possible DBMS: 'SQLite'", "User-agent: foobar", "~Type: time-based blind", "saved command line options to the configuration file")),
5050
("-c <config>", ("CloudFlare", "possible DBMS: 'SQLite'", "User-agent: foobar", "~Type: time-based blind")),
5151
("<piped> -r <request> -l <log> --flush-session --banner --technique=B", ("banner: '3.", "STDIN")),
5252
("-l <log> --flush-session --keep-alive --skip-waf -v 5 --technique=U --union-from=users --banner --parse-errors", ("banner: '3.", "ORDER BY term out of range", "~xp_cmdshell", "Connection: keep-alive")),

lib/parse/headers.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
from lib.core.data import kb
1212
from lib.core.data import paths
1313
from lib.parse.handler import FingerprintHandler
14-
from thirdparty.six.moves import filter as _filter
1514

1615
def headersParser(headers):
1716
"""
@@ -30,7 +29,7 @@ def headersParser(headers):
3029
"x-powered-by": os.path.join(paths.SQLMAP_XML_BANNER_PATH, "x-powered-by.xml"),
3130
}
3231

33-
for header in _filter(lambda _: _ in kb.headerPaths, headers):
32+
for header in (_.lower() for _ in headers if _.lower() in kb.headerPaths):
3433
value = headers[header]
3534
xmlfile = kb.headerPaths[header]
3635
handler = FingerprintHandler(value, kb.headersFp)

0 commit comments

Comments
 (0)