Skip to content

Commit 04ce6ba

Browse files
committed
Minor patch
1 parent c1f98d0 commit 04ce6ba

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

extra/vulnserver/vulnserver.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
import traceback
1818

1919
PY3 = sys.version_info >= (3, 0)
20+
UNICODE_ENCODING = "utf-8"
2021

2122
if PY3:
2223
from http.client import INTERNAL_SERVER_ERROR
@@ -96,7 +97,7 @@ def do_REQUEST(self):
9697
self.send_response(INTERNAL_SERVER_ERROR)
9798
self.send_header("Connection", "close")
9899
self.end_headers()
99-
self.wfile.write("CLOUDFLARE_ERROR_500S_BOX".encode("utf8"))
100+
self.wfile.write("CLOUDFLARE_ERROR_500S_BOX".encode(UNICODE_ENCODING))
100101
return
101102

102103
if hasattr(self, "data"):
@@ -127,7 +128,7 @@ def do_REQUEST(self):
127128

128129
if not any(_ in self.params for _ in ("id", "query")):
129130
self.send_response(OK)
130-
self.send_header("Content-type", "text/html")
131+
self.send_header("Content-type", "text/html; charset=%s" % UNICODE_ENCODING)
131132
self.send_header("Connection", "close")
132133
self.end_headers()
133134
self.wfile.write(b"<html><p><h3>GET:</h3><a href='/?id=1'>link</a></p><hr><p><h3>POST:</h3><form method='post'>ID: <input type='text' name='id'><input type='submit' value='Submit'></form></p></html>")
@@ -171,7 +172,7 @@ def do_REQUEST(self):
171172
self.end_headers()
172173
else:
173174
self.end_headers()
174-
self.wfile.write(output.encode("utf8") if PY3 else output)
175+
self.wfile.write(quote(output if isinstance(output, bytes) else output.encode(UNICODE_ENCODING)))
175176
else:
176177
self.send_response(NOT_FOUND)
177178
self.send_header("Connection", "close")
@@ -190,7 +191,7 @@ def do_POST(self):
190191
length = int(self.headers.get("Content-length", 0))
191192
if length:
192193
data = self.rfile.read(length)
193-
data = unquote_plus(data.decode("utf8"))
194+
data = unquote_plus(data.decode(UNICODE_ENCODING))
194195
self.data = data
195196
self.do_REQUEST()
196197

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.3.11.115"
21+
VERSION = "1.3.11.116"
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)

0 commit comments

Comments
 (0)