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

Skip to content

Commit dfb74ff

Browse files
committed
Minor update
1 parent 5044894 commit dfb74ff

2 files changed

Lines changed: 10 additions & 8 deletions

File tree

extra/vulnserver/vulnserver.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -124,22 +124,17 @@ def do_REQUEST(self):
124124
self.url, self.params = path, params
125125

126126
if self.url == '/':
127-
self.send_response(OK)
128127

129128
if not any(_ in self.params for _ in ("id", "query")):
129+
self.send_response(OK)
130130
self.send_header("Content-type", "text/html")
131131
self.send_header("Connection", "close")
132132
self.end_headers()
133133
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>")
134134
else:
135-
self.send_header("Content-type", "text/html")
136-
self.send_header("Connection", "close")
137-
138-
if not self.raw_requestline.startswith(b"HEAD"):
139-
self.end_headers()
135+
code, output = OK, ""
140136

141137
try:
142-
output = ""
143138

144139
if self.params.get("echo", ""):
145140
output += "%s<br>" % self.params["echo"]
@@ -163,12 +158,19 @@ def do_REQUEST(self):
163158
output += "</table>\n"
164159
output += "</body></html>"
165160
except Exception as ex:
161+
code = INTERNAL_SERVER_ERROR
166162
output = "%s: %s" % (re.search(r"'([^']+)'", str(type(ex))).group(1), ex)
167163

164+
self.send_response(code)
165+
166+
self.send_header("Content-type", "text/html")
167+
self.send_header("Connection", "close")
168+
168169
if self.raw_requestline.startswith(b"HEAD"):
169170
self.send_header("Content-Length", str(len(output)))
170171
self.end_headers()
171172
else:
173+
self.end_headers()
172174
self.wfile.write(output.encode("utf8"))
173175
else:
174176
self.send_response(NOT_FOUND)

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.78"
21+
VERSION = "1.3.11.79"
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)