diff --git a/lib/core/option.py b/lib/core/option.py index 64c2641b6..34391841d 100644 --- a/lib/core/option.py +++ b/lib/core/option.py @@ -2181,13 +2181,15 @@ def _setTorSocksProxySettings(): socks.wrapmodule(urllib2) def _checkWebSocket(): - infoMsg = "checking URL is WebSocket or not" + infoMsg = "checking for WebSocket" logger.debug(infoMsg) + if conf.url and (conf.url.startswith("ws:/") or conf.url.startswith("wss:/")): try: from websocket import ABNF except ImportError: - errMsg = "it seems that python 'websocket-client' third-party library not be installed. " + errMsg = "sqlmap requires third-party module 'websocket-client' " + errMsg += "in order to use WebSocket funcionality" raise SqlmapMissingDependence(errMsg) def _checkTor(): diff --git a/lib/request/connect.py b/lib/request/connect.py index 436bbaeaa..4dc9bb0f7 100644 --- a/lib/request/connect.py +++ b/lib/request/connect.py @@ -599,7 +599,7 @@ class Connect(object): warnMsg += "from the target URL" elif "Handshake status" in tbMsg: status = re.search("Handshake status ([\d]{3})", tbMsg) - errMsg = "websocket handshake status %s" % status.group(1) if status else 'unknown' + errMsg = "websocket handshake status %s" % status.group(1) if status else "unknown" raise SqlmapConnectionException(errMsg) else: warnMsg = "unable to connect to the target URL" diff --git a/lib/utils/deps.py b/lib/utils/deps.py index d25c8ea94..efca6e1c3 100644 --- a/lib/utils/deps.py +++ b/lib/utils/deps.py @@ -72,7 +72,7 @@ def checkDependencies(): debugMsg = "'python-ntlm' third-party library is found" logger.debug(debugMsg) except ImportError: - warnMsg = "sqlmap requires 'python-ntlm' third-party library for " + warnMsg = "sqlmap requires 'python-ntlm' third-party library " warnMsg += "if you plan to attack a web application behind NTLM " warnMsg += "authentication. Download from http://code.google.com/p/python-ntlm/" logger.warn(warnMsg) @@ -83,8 +83,8 @@ def checkDependencies(): debugMsg = "'python websocket-client' library is found" logger.debug(debugMsg) except ImportError: - warnMsg = "sqlmap requires 'python websocket-client' third-party library for " - warnMsg += "if you plan to attack a web application behind websocket. " + warnMsg = "sqlmap requires 'websocket-client' third-party library " + warnMsg += "if you plan to attack a web application using WebSocket. " warnMsg += "Download from https://pypi.python.org/pypi/websocket-client/" logger.warn(warnMsg) missing_libraries.add('websocket-client')