From 0d8d6a4acec0002062a91c421382097deaaec865 Mon Sep 17 00:00:00 2001 From: Bernardo Damele Date: Wed, 8 Jun 2011 16:08:20 +0000 Subject: [PATCH] Cosmetics --- lib/core/option.py | 20 +++++++++++--------- lib/core/optiondict.py | 2 +- lib/core/session.py | 2 +- lib/parse/configfile.py | 2 +- lib/request/connect.py | 4 ++-- lib/techniques/blind/inference.py | 4 ++-- 6 files changed, 18 insertions(+), 16 deletions(-) diff --git a/lib/core/option.py b/lib/core/option.py index c8d47a8de..6e1d222bf 100644 --- a/lib/core/option.py +++ b/lib/core/option.py @@ -433,6 +433,7 @@ def __setGoogleDorking(): while True: matches = search() + if kb.targetUrls: infoMsg = "sqlmap got %d results for your " % len(matches) infoMsg += "Google dork expression, " @@ -450,7 +451,7 @@ def __setGoogleDorking(): message = "sqlmap got %d results " % len(matches) message += "for your Google dork expression, but none of them " message += "have GET parameters to test for SQL injection. " - message += "do you want to skip to the next result page? [Y/n]" + message += "Do you want to skip to the next result page? [Y/n]" test = readInput(message, default="Y") if test[0] in ("n", "N"): @@ -473,9 +474,11 @@ def __setBulkMultipleTargets(): raise sqlmapFilePathException, errMsg f = open(conf.bulkFile, 'r') + for line in f.xreadlines(): if re.search(r"[^ ]+\?(.+)", line, re.I): kb.targetUrls.add((line, None, None, None)) + f.close() def __findPageForms(): @@ -1627,11 +1630,10 @@ def __setTorProxySettings(): conf.proxy = "http://%s:%d" % (LOCALHOST, found) else: errMsg = "can't establish connection with the Tor proxy. " - errMsg += "please make sure that you have " - errMsg += "some kind of Vidalia/Privoxy/Polipo " - errMsg += "Tor proxy bundle installed for " - errMsg += "you to be able to successfully use " - errMsg += "--tor switch " + errMsg += "Please make sure that you have Vidalia, Privoxy or " + errMsg += "Polipo bundle installed for you to be able to " + errMsg += "successfully use --tor switch " + if IS_WIN: errMsg += "(e.g. https://www.torproject.org/projects/vidalia.html.en)" else: @@ -1714,9 +1716,9 @@ def __basicOptionValidation(): try: codecs.lookup(conf.charset) except LookupError: - errMsg = "unknown charset '%s'. please visit page " % conf.charset - errMsg += "'%s' " % CODECS_LIST_PAGE - errMsg += "to get the full list of supported charsets" + errMsg = "unknown charset '%s'. Please visit " % conf.charset + errMsg += "'%s' to get the full list of " % CODECS_LIST_PAGE + errMsg += "supported charsets" raise sqlmapSyntaxException, errMsg def __resolveCrossReferences(): diff --git a/lib/core/optiondict.py b/lib/core/optiondict.py index 50333bbdc..ebf1a380b 100644 --- a/lib/core/optiondict.py +++ b/lib/core/optiondict.py @@ -16,7 +16,7 @@ optDict = { "direct": "string", "url": "string", "logFile": "string", - "bulkFile": "string", + "bulkFile": "string", "requestFile": "string", "googleDork": "string", "configFile": "string" diff --git a/lib/core/session.py b/lib/core/session.py index e13b92d5e..a2e82006f 100644 --- a/lib/core/session.py +++ b/lib/core/session.py @@ -53,7 +53,7 @@ def setInjection(inj): or ( kb.resumedQueries[conf.url].has_key("Injection data") and intersect(base64unpickle(kb.resumedQueries[conf.url]["Injection data"][:-1]).data.keys(),\ inj.data.keys()) != inj.data.keys() - ) ) + ) ) if condition: dataToSessionFile("[%s][%s][%s][Injection data][%s]\n" % (conf.url, inj.place, safeFormatString(conf.parameters[inj.place]), base64pickle(inj))) diff --git a/lib/parse/configfile.py b/lib/parse/configfile.py index df6c80c4b..1871d4033 100644 --- a/lib/parse/configfile.py +++ b/lib/parse/configfile.py @@ -66,7 +66,7 @@ def configFileParser(configFile): config = UnicodeRawConfigParser() config.readfp(configFP) except MissingSectionHeaderError: - errMsg = "you've provided a non-valid configuration file" + errMsg = "you have provided an invalid configuration file" raise sqlmapSyntaxException, errMsg if not config.has_section("Target"): diff --git a/lib/request/connect.py b/lib/request/connect.py index 1e4d13bd1..a4bb5fc22 100644 --- a/lib/request/connect.py +++ b/lib/request/connect.py @@ -254,7 +254,7 @@ class Connect: if kb.alwaysRedirect is None: msg = "sqlmap got a %d redirect to " % conn.redcode - msg += "'%s'. do you want to follow redirects " % conn.redurl + msg += "'%s'. Do you want to follow redirects " % conn.redurl msg += "from now on (or stay on the original page)? [Y/n]" choice = readInput(msg, default="Y") @@ -285,7 +285,7 @@ class Connect: if kb.alwaysRefresh is None: msg = "sqlmap got a refresh request " msg += "(redirect like response common to login pages). " - msg += "do you want to apply the refresh " + msg += "Do you want to apply the refresh " msg += "from now on (or stay on the original page)? [Y/n]" choice = readInput(msg, default="Y") diff --git a/lib/techniques/blind/inference.py b/lib/techniques/blind/inference.py index 1fc388a42..47734cb63 100644 --- a/lib/techniques/blind/inference.py +++ b/lib/techniques/blind/inference.py @@ -114,8 +114,8 @@ def bisection(payload, expression, length=None, charsetType=None, firstChar=None numThreads = 1 if conf.threads == 1 and not timeBasedCompare: - warnMsg = "running in a single-thread mode. please consider usage of " - warnMsg += "--threads option to declare higher number of threads" + warnMsg = "running in a single-thread mode. Please consider to " + warnMsg += "provide --threads switch to speedup data fetching" singleTimeWarnMessage(warnMsg) if conf.verbose in (1, 2) and not showEta: