Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit dcf8a27

Browse files
committed
Implementation for an Issue #67
1 parent 4fc462c commit dcf8a27

4 files changed

Lines changed: 14 additions & 907686 deletions

File tree

lib/core/common.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -935,7 +935,7 @@ def setPaths():
935935
paths.SQL_KEYWORDS = os.path.join(paths.SQLMAP_TXT_PATH, "keywords.txt")
936936
paths.SMALL_DICT = os.path.join(paths.SQLMAP_TXT_PATH, "smalldict.txt")
937937
paths.USER_AGENTS = os.path.join(paths.SQLMAP_TXT_PATH, "user-agents.txt")
938-
paths.WORDLIST = os.path.join(paths.SQLMAP_TXT_PATH, "wordlist.txt")
938+
paths.WORDLIST = os.path.join(paths.SQLMAP_TXT_PATH, "wordlist.zip")
939939
paths.PHPIDS_RULES_XML = os.path.join(paths.SQLMAP_XML_PATH, "phpids_rules.xml")
940940
paths.ERRORS_XML = os.path.join(paths.SQLMAP_XML_PATH, "errors.xml")
941941
paths.PAYLOADS_XML = os.path.join(paths.SQLMAP_XML_PATH, "payloads.xml")

lib/core/wordlist.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@
55
See the file 'doc/COPYING' for copying permission
66
"""
77

8+
import os
9+
import zipfile
10+
11+
from lib.core.exception import sqlmapDataException
12+
813
class Wordlist:
914
"""
1015
Iterator for looping over a large dictionaries
@@ -32,7 +37,14 @@ def adjust(self):
3237
self.iter = iter(self.custom)
3338
else:
3439
current = self.filenames[self.index]
35-
self.fp = open(current, "r")
40+
if os.path.splitext(current)[1].lower() == ".zip":
41+
_ = zipfile.ZipFile(current, 'r')
42+
if len(_.namelist()) == 0:
43+
errMsg = "no file(s) inside '%s'" % current
44+
raise sqlmapDataException, errMsg
45+
self.fp = _.open(_.namelist()[0])
46+
else:
47+
self.fp = open(current, 'r')
3648
self.iter = iter(self.fp)
3749

3850
self.index += 1

0 commit comments

Comments
 (0)