From 10fd004dece3a9ce37d09497deec5ba1b4cc042a Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Wed, 31 Jan 2018 11:24:28 +0100 Subject: [PATCH] Reverting set() brace form because of Python 2.6 compatibility issues --- lib/core/common.py | 2 +- lib/core/settings.py | 2 +- lib/takeover/web.py | 2 +- lib/utils/crawler.py | 2 +- lib/utils/har.py | 2 +- plugins/generic/enumeration.py | 6 +++--- sqlmap.py | 3 +++ txt/checksum.md5 | 14 +++++++------- 8 files changed, 18 insertions(+), 15 deletions(-) diff --git a/lib/core/common.py b/lib/core/common.py index a18daef06..63d5f36cd 100644 --- a/lib/core/common.py +++ b/lib/core/common.py @@ -770,7 +770,7 @@ def getManualDirectories(): checkFile(listPath) directories = getFileItems(listPath) elif choice == '4': - targets = {conf.hostname} + targets = set([conf.hostname]) _ = conf.hostname.split('.') if _[0] == "www": diff --git a/lib/core/settings.py b/lib/core/settings.py index e7c146c20..6600deb9c 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.2.1.22" +VERSION = "1.2.1.23" 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/takeover/web.py b/lib/takeover/web.py index 88df01687..2952a127f 100644 --- a/lib/takeover/web.py +++ b/lib/takeover/web.py @@ -205,7 +205,7 @@ class Web: if readInput(message, default='Y', boolean=True): headers = {} - been = {conf.url} + been = set([conf.url]) for match in re.finditer(r"=['\"]((https?):)?(//[^/'\"]+)?(/[\w/.-]*)\bwp-", kb.originalPage or "", re.I): url = "%s%s" % (conf.url.replace(conf.path, match.group(4)), "wp-content/wp-db.php") diff --git a/lib/utils/crawler.py b/lib/utils/crawler.py index 10ba77a4b..6c8448594 100644 --- a/lib/utils/crawler.py +++ b/lib/utils/crawler.py @@ -126,7 +126,7 @@ def crawl(target): dataToStdout("\r[%s] [INFO] %s" % (time.strftime("%X"), status), True) threadData.shared.deeper = set() - threadData.shared.unprocessed = {target} + threadData.shared.unprocessed = set([target]) if not conf.sitemapUrl: message = "do you want to check for the existence of " diff --git a/lib/utils/har.py b/lib/utils/har.py index 19fc7b678..4def9b3db 100644 --- a/lib/utils/har.py +++ b/lib/utils/har.py @@ -180,7 +180,7 @@ class Response: "size": len(self.content or "") } - binary = {'\0', '\1'} + binary = set(['\0', '\1']) if any(c in binary for c in self.content): content["encoding"] = "base64" content["text"] = base64.b64encode(self.content) diff --git a/plugins/generic/enumeration.py b/plugins/generic/enumeration.py index 3983b6b30..0b6190ae4 100644 --- a/plugins/generic/enumeration.py +++ b/plugins/generic/enumeration.py @@ -60,13 +60,13 @@ class Enumeration(Custom, Databases, Entries, Search, Users): bannerParser(kb.data.banner) if conf.os and conf.os == "windows": - kb.bannerFp["type"] = {"Windows"} + kb.bannerFp["type"] = set(["Windows"]) elif conf.os and conf.os == "linux": - kb.bannerFp["type"] = {"Linux"} + kb.bannerFp["type"] = set(["Linux"]) elif conf.os: - kb.bannerFp["type"] = {"%s%s" % (conf.os[0].upper(), conf.os[1:])} + kb.bannerFp["type"] = set(["%s%s" % (conf.os[0].upper(), conf.os[1:])]) if conf.os: setOs() diff --git a/sqlmap.py b/sqlmap.py index a0dcdb832..0c1e160f8 100755 --- a/sqlmap.py +++ b/sqlmap.py @@ -381,3 +381,6 @@ def main(): if __name__ == "__main__": main() +else: + # cancelling postponed imports (because of Travis CI checks) + from lib.controller.controller import start \ No newline at end of file diff --git a/txt/checksum.md5 b/txt/checksum.md5 index 1eb37c21c..c114b5544 100644 --- a/txt/checksum.md5 +++ b/txt/checksum.md5 @@ -27,7 +27,7 @@ a7b0c8e5a18a3abe8803999dcfc4664f lib/controller/handler.py 1e5532ede194ac9c083891c2f02bca93 lib/controller/__init__.py e3a3f5218b2e52dd0afafdfc9fed2002 lib/core/agent.py 86a4703d5474badd8462146510b2c460 lib/core/bigarray.py -e4fa4177b9d3c24555fb275335496e29 lib/core/common.py +27d1b0a4609eece643141408d1f18716 lib/core/common.py 2a40d5b5997265daa890545d4a4a59b9 lib/core/convert.py 9f87391b6a3395f7f50830b391264f27 lib/core/data.py 72016ea5c994a711a262fd64572a0fcd lib/core/datatype.py @@ -46,7 +46,7 @@ ffa5f01f39b17c8d73423acca6cfe86a lib/core/readlineng.py 0c3eef46bdbf87e29a3f95f90240d192 lib/core/replication.py a7db43859b61569b601b97f187dd31c5 lib/core/revision.py fcb74fcc9577523524659ec49e2e964b lib/core/session.py -7fc35bef60750c8ba2475c154d7d481c lib/core/settings.py +ee202f91d95b559f4cd9355f55203946 lib/core/settings.py d0adc28a38e43a787df4471f7f027413 lib/core/shell.py 63491be462c515a1a3880c27c2acc4a2 lib/core/subprocessng.py 505aaa61e1bba3c3d4567c3e667699e3 lib/core/target.py @@ -85,7 +85,7 @@ acc1db3667bf910b809eb279b60595eb lib/takeover/icmpsh.py 703e15714316a8cc4bbe54cdd0a8cb87 lib/takeover/metasploit.py 0fc9b00596df21c8878ef92f513ecad7 lib/takeover/registry.py 48575dde7bb867b7937769f569a98309 lib/takeover/udf.py -3972e3e00115c6e4e03336e23e35b1de lib/takeover/web.py +1398cb4ee55becf628367854b5310f33 lib/takeover/web.py d8c10f278e5943b137a222f4cedca59d lib/takeover/xp_cmdshell.py f6844893afa7569052529e1c8d89bc35 lib/techniques/blind/inference.py 1e5532ede194ac9c083891c2f02bca93 lib/techniques/blind/__init__.py @@ -100,10 +100,10 @@ c497003ecf231d03a311a816a6b3b753 lib/techniques/union/test.py 6c3c4c7d43ad75e61a73184323a81eac lib/techniques/union/use.py e4146464cf968d4015a52cb8c10e3da5 lib/utils/api.py 37dfb641358669f62c2acedff241348b lib/utils/brute.py -8f2f246d17f5891a2e584533bd18e65c lib/utils/crawler.py +a34c4fd2e7d78c5dfdd9eeccb079fb1c lib/utils/crawler.py 985c737cd8a6a722160c55cf5ee224f4 lib/utils/deps.py a6d6888e14a7c11f0884c8cc18489caa lib/utils/getch.py -2384f77330583b53018a7dab5fc1c90f lib/utils/har.py +7af29f61302c8693cd6436d4b69e22d3 lib/utils/har.py 9bd8fbfb9c25ee685c97b260331e7165 lib/utils/hashdb.py 29dee8f54cfb39feb0545d237542f866 lib/utils/hash.py 145120b21fcfca843d5e2c8b0562e4db lib/utils/htmlentities.py @@ -205,7 +205,7 @@ a3db8618eed5bb2807b6f77605cba9cc plugins/dbms/sybase/__init__.py e6cd1c5a5244d83396b401f7db43d323 plugins/generic/custom.py 315a3ced9667065b24de040af296037a plugins/generic/databases.py b1bd764e8f417222ebb1890232290679 plugins/generic/entries.py -00e0b1b5713784c8131660bfc40bbaac plugins/generic/enumeration.py +d82f2c78c1d4d7c6487e94fd3a68a908 plugins/generic/enumeration.py ea0f3b9085061b272bfd98c13ad2d977 plugins/generic/filesystem.py f5d5419efddfe04648ea5e953c650793 plugins/generic/fingerprint.py 1e5532ede194ac9c083891c2f02bca93 plugins/generic/__init__.py @@ -224,7 +224,7 @@ c3cc8b7727161e64ab59f312c33b541a shell/stagers/stager.aspx_ 1f7f125f30e0e800beb21e2ebbab18e1 shell/stagers/stager.jsp_ 01e3505e796edf19aad6a996101c81c9 shell/stagers/stager.php_ 4eaeef94314956e4517e5310a28d579a sqlmapapi.py -1bef42b51e59db28d04181955c405931 sqlmap.py +3e2e790c370442c3d98eaa88a3523b15 sqlmap.py 4c3b8a7daa4bff52e01d4168be0eedbe tamper/apostrophemask.py 4115a55b8aba464723d645b7d3156b6e tamper/apostrophenullencode.py 4b1024cecb00f13a4e1be78391e9cedb tamper/appendnullbyte.py