Implementation for an Issue #67

This commit is contained in:
Miroslav Stampar 2012-07-18 14:24:10 +02:00
parent 4fc462c4d9
commit dcf8a27f12
4 changed files with 14 additions and 907686 deletions

View File

@ -935,7 +935,7 @@ def setPaths():
paths.SQL_KEYWORDS = os.path.join(paths.SQLMAP_TXT_PATH, "keywords.txt")
paths.SMALL_DICT = os.path.join(paths.SQLMAP_TXT_PATH, "smalldict.txt")
paths.USER_AGENTS = os.path.join(paths.SQLMAP_TXT_PATH, "user-agents.txt")
paths.WORDLIST = os.path.join(paths.SQLMAP_TXT_PATH, "wordlist.txt")
paths.WORDLIST = os.path.join(paths.SQLMAP_TXT_PATH, "wordlist.zip")
paths.PHPIDS_RULES_XML = os.path.join(paths.SQLMAP_XML_PATH, "phpids_rules.xml")
paths.ERRORS_XML = os.path.join(paths.SQLMAP_XML_PATH, "errors.xml")
paths.PAYLOADS_XML = os.path.join(paths.SQLMAP_XML_PATH, "payloads.xml")

View File

@ -5,6 +5,11 @@ Copyright (c) 2006-2012 sqlmap developers (http://sqlmap.org/)
See the file 'doc/COPYING' for copying permission
"""
import os
import zipfile
from lib.core.exception import sqlmapDataException
class Wordlist:
"""
Iterator for looping over a large dictionaries
@ -32,7 +37,14 @@ class Wordlist:
self.iter = iter(self.custom)
else:
current = self.filenames[self.index]
self.fp = open(current, "r")
if os.path.splitext(current)[1].lower() == ".zip":
_ = zipfile.ZipFile(current, 'r')
if len(_.namelist()) == 0:
errMsg = "no file(s) inside '%s'" % current
raise sqlmapDataException, errMsg
self.fp = _.open(_.namelist()[0])
else:
self.fp = open(current, 'r')
self.iter = iter(self.fp)
self.index += 1

File diff suppressed because it is too large Load Diff

BIN
txt/wordlist.zip Normal file

Binary file not shown.