From 0f5d48ff20a5ade016a217bfdf88d2c4719f484a Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Mon, 5 Dec 2011 09:25:56 +0000 Subject: [PATCH] minor update --- extra/socks/socks.py | 6 ++---- lib/controller/checks.py | 2 ++ lib/core/option.py | 1 + lib/request/connect.py | 2 ++ 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/extra/socks/socks.py b/extra/socks/socks.py index 642c313fe..3bb9126ea 100644 --- a/extra/socks/socks.py +++ b/extra/socks/socks.py @@ -34,7 +34,7 @@ for tunneling connections through SOCKS proxies. """ Minor modifications made by Miroslav Stampar (http://www.sqlmap.org/) -for patching DNS-leakage occuring in create_connection() +for patching DNS-leakage occuring in socket.create_connection() Minor modifications made by Christopher Gilbert (http://motomastyle.com/) for use in PyLoris (http://pyloris.sourceforge.net/) @@ -392,9 +392,7 @@ class socksocket(socket.socket): def create_connection(address, timeout=socket._GLOBAL_DEFAULT_TIMEOUT, source_address=None): - """ - Patched for DNS-leakage - """ + # Patched for a DNS-leakage host, port = address sock = None try: diff --git a/lib/controller/checks.py b/lib/controller/checks.py index d60e22828..24d57fa7b 100644 --- a/lib/controller/checks.py +++ b/lib/controller/checks.py @@ -975,5 +975,7 @@ def checkConnection(suppressOutput=False): msg = "it is not recommended to continue in this kind of cases. Do you want to quit and make sure that everything is set up properly? [Y/n] " if readInput(msg, default="Y") not in ("n", "N"): raise sqlmapSilentQuitException + else: + kb.ignoreNotFound = True return True diff --git a/lib/core/option.py b/lib/core/option.py index b8c644041..d4859e638 100644 --- a/lib/core/option.py +++ b/lib/core/option.py @@ -1420,6 +1420,7 @@ def __setKnowledgeBaseAttributes(flushAll=True): kb.htmlFp = [] kb.httpErrorCodes = {} kb.inferenceMode = False + kb.ignoreNotFound = False kb.ignoreTimeout = False kb.injection = InjectionDict() kb.injections = [] diff --git a/lib/request/connect.py b/lib/request/connect.py index e50db0e96..3b87f93e8 100644 --- a/lib/request/connect.py +++ b/lib/request/connect.py @@ -177,6 +177,8 @@ class Connect: responseHeaders = None logHeaders = u"" + raise404 = raise404 and not kb.ignoreNotFound + # support for non-latin (e.g. cyrillic) URLs as urllib/urllib2 doesn't # support those by default url = asciifyUrl(url)