From d2bbe80455d73ac291d5b9d887d4035e5f5fce1b Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Sat, 22 Oct 2016 22:07:29 +0200 Subject: [PATCH] Fixes #2243 --- lib/core/common.py | 5 ++++- lib/core/settings.py | 2 +- lib/request/dns.py | 5 ++++- thirdparty/socks/socks.py | 2 +- txt/checksum.md5 | 8 ++++---- 5 files changed, 14 insertions(+), 8 deletions(-) diff --git a/lib/core/common.py b/lib/core/common.py index 8989f4ed2..6af7976fa 100644 --- a/lib/core/common.py +++ b/lib/core/common.py @@ -2410,7 +2410,10 @@ def findLocalPort(ports): for port in ports: try: - s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + try: + s = socket._orig_socket(socket.AF_INET, socket.SOCK_STREAM) + except AttributeError: + s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.connect((LOCALHOST, port)) retVal = port break diff --git a/lib/core/settings.py b/lib/core/settings.py index d72059f28..3fd240d26 100644 --- a/lib/core/settings.py +++ b/lib/core/settings.py @@ -19,7 +19,7 @@ from lib.core.enums import DBMS_DIRECTORY_NAME from lib.core.enums import OS # sqlmap version (...) -VERSION = "1.0.10.53" +VERSION = "1.0.10.54" TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable" 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) diff --git a/lib/request/dns.py b/lib/request/dns.py index b619fbdfc..03487cf3d 100644 --- a/lib/request/dns.py +++ b/lib/request/dns.py @@ -62,7 +62,10 @@ class DNSServer(object): self._check_localhost() self._requests = [] self._lock = threading.Lock() - self._socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) + try: + self._socket = socket._orig_socket(socket.AF_INET, socket.SOCK_DGRAM) + except AttributeError: + self._socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) self._socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) self._socket.bind(("", 53)) self._running = False diff --git a/thirdparty/socks/socks.py b/thirdparty/socks/socks.py index 7301e236a..4dab15a1e 100644 --- a/thirdparty/socks/socks.py +++ b/thirdparty/socks/socks.py @@ -69,7 +69,7 @@ PROXY_TYPE_HTTP = HTTP = 3 PROXY_TYPES = {"SOCKS4": SOCKS4, "SOCKS5": SOCKS5, "HTTP": HTTP} PRINTABLE_PROXY_TYPES = dict(zip(PROXY_TYPES.values(), PROXY_TYPES.keys())) -_orgsocket = _orig_socket = socket.socket +socket._orig_socket = _orgsocket = _orig_socket = socket.socket _orgcreateconnection = socket.create_connection class ProxyError(IOError): diff --git a/txt/checksum.md5 b/txt/checksum.md5 index 37ce14d17..e2e57c375 100644 --- a/txt/checksum.md5 +++ b/txt/checksum.md5 @@ -26,7 +26,7 @@ ec007a1424da78cfdae90da6ae49ed9b lib/controller/handler.py cc9c82cfffd8ee9b25ba3af6284f057e lib/controller/__init__.py 04f16204c899438dc7599a9a8426bfee lib/core/agent.py eb0bd28b0bd9fbf67dcc3119116df377 lib/core/bigarray.py -7e424aadf807efa352733fb95a6ab431 lib/core/common.py +8d32e43491ab8d7082dadd3155e6a9fb lib/core/common.py 5680d0c446a3bed5c0f2a0402d031557 lib/core/convert.py e77cca1cb063016f71f6e6bdebf4ec73 lib/core/data.py 1d042f0bc0557d3fd564ea5a46deb77e lib/core/datatype.py @@ -45,7 +45,7 @@ e60456db5380840a586654344003d4e6 lib/core/readlineng.py 5ef56abb8671c2ca6ceecb208258e360 lib/core/replication.py 99a2b496b9d5b546b335653ca801153f lib/core/revision.py 7c15dd2777af4dac2c89cab6df17462e lib/core/session.py -c211b7b7ed1f4d628961e9e9457899da lib/core/settings.py +e55dc07a3c4c414ab324167d03fd54f9 lib/core/settings.py 7af83e4f18cab6dff5e67840eb65be80 lib/core/shell.py 23657cd7d924e3c6d225719865855827 lib/core/subprocessng.py c3ace7874a536d801f308cf1fd03df99 lib/core/target.py @@ -69,7 +69,7 @@ b40a4c5d91770d347df36d3065b63798 lib/parse/sitemap.py c48285682a61d49982cb508351013cb4 lib/request/comparison.py 9bff6fe291805380c6a74d0cda6684a5 lib/request/connect.py d4d52c1073c75a6eecd2ebb98b670b96 lib/request/direct.py -1a46f7bb26b23ec0c0d9d9c95828241b lib/request/dns.py +4ae7f4570fb859045f0487cc0b055a8e lib/request/dns.py 70ceefe39980611494d4f99afb96f652 lib/request/httpshandler.py cc9c82cfffd8ee9b25ba3af6284f057e lib/request/__init__.py 62aff2a7bdd43f6e4d33385f57ec3e4c lib/request/inject.py @@ -349,7 +349,7 @@ ff80a22ee858f5331b0c088efa98b3ff thirdparty/prettyprint/prettyprint.py 5c70f8e5f7353aedc6d8d21d4fb72b37 thirdparty/pydes/__init__.py a7f735641c5b695f3d6220fe7c91b030 thirdparty/pydes/pyDes.py d41d8cd98f00b204e9800998ecf8427e thirdparty/socks/__init__.py -a2f0ee74ccc895150f310ef8d680edca thirdparty/socks/socks.py +74fcae36f5a2cc440c1717ae8e3f64c4 thirdparty/socks/socks.py d41d8cd98f00b204e9800998ecf8427e thirdparty/termcolor/__init__.py ea649aae139d8551af513769dd913dbf thirdparty/termcolor/termcolor.py bf55909ad163b58236e44b86e8441b26 thirdparty/wininetpton/__init__.py