mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2026-07-08 09:31:52 +00:00
Minor patch
This commit is contained in:
parent
8f6a37275c
commit
788c9fa134
2 changed files with 23 additions and 21 deletions
|
|
@ -20,7 +20,7 @@ from lib.core.enums import OS
|
||||||
from thirdparty import six
|
from thirdparty import six
|
||||||
|
|
||||||
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
|
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
|
||||||
VERSION = "1.10.7.32"
|
VERSION = "1.10.7.33"
|
||||||
TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable"
|
TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable"
|
||||||
TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34}
|
TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34}
|
||||||
VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE)
|
VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE)
|
||||||
|
|
|
||||||
|
|
@ -524,31 +524,33 @@ class Connect(object):
|
||||||
|
|
||||||
if webSocket:
|
if webSocket:
|
||||||
ws = websocket.WebSocket()
|
ws = websocket.WebSocket()
|
||||||
ws.settimeout(WEBSOCKET_INITIAL_TIMEOUT if kb.webSocketRecvCount is None else timeout)
|
try:
|
||||||
wsHeaders = tuple("%s: %s" % (getUnicode(key), getUnicode(value)) for key, value in headers.items() if getUnicode(key).upper() != HTTP_HEADER.HOST.upper())
|
ws.settimeout(WEBSOCKET_INITIAL_TIMEOUT if kb.webSocketRecvCount is None else timeout)
|
||||||
ws.connect(url, header=wsHeaders, cookie=cookie) # WebSocket will add Host field of headers automatically
|
wsHeaders = tuple("%s: %s" % (getUnicode(key), getUnicode(value)) for key, value in headers.items() if getUnicode(key).upper() != HTTP_HEADER.HOST.upper())
|
||||||
ws.send(urldecode(post or ""))
|
ws.connect(url, header=wsHeaders, cookie=cookie) # WebSocket will add Host field of headers automatically
|
||||||
|
ws.send(urldecode(post or ""))
|
||||||
|
|
||||||
_page = []
|
_page = []
|
||||||
|
|
||||||
if kb.webSocketRecvCount is None:
|
if kb.webSocketRecvCount is None:
|
||||||
while True:
|
while True:
|
||||||
try:
|
try:
|
||||||
_page.append(ws.recv())
|
_page.append(ws.recv())
|
||||||
if sum(len(_) for _ in _page) > MAX_CONNECTION_TOTAL_SIZE:
|
if sum(len(_) for _ in _page) > MAX_CONNECTION_TOTAL_SIZE:
|
||||||
warnMsg = "too large websocket response detected. Automatically trimming it"
|
warnMsg = "too large websocket response detected. Automatically trimming it"
|
||||||
singleTimeWarnMessage(warnMsg)
|
singleTimeWarnMessage(warnMsg)
|
||||||
|
break
|
||||||
|
except websocket.WebSocketTimeoutException:
|
||||||
|
kb.webSocketRecvCount = len(_page)
|
||||||
break
|
break
|
||||||
except websocket.WebSocketTimeoutException:
|
else:
|
||||||
kb.webSocketRecvCount = len(_page)
|
for i in xrange(max(1, kb.webSocketRecvCount)):
|
||||||
break
|
_page.append(ws.recv())
|
||||||
else:
|
|
||||||
for i in xrange(max(1, kb.webSocketRecvCount)):
|
|
||||||
_page.append(ws.recv())
|
|
||||||
|
|
||||||
page = "\n".join(_page)
|
page = "\n".join(_page)
|
||||||
|
finally:
|
||||||
|
ws.close()
|
||||||
|
|
||||||
ws.close()
|
|
||||||
code = ws.status
|
code = ws.status
|
||||||
status = _http_client.responses.get(code, "")
|
status = _http_client.responses.get(code, "")
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue