mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2026-10-21 19:22:48 +00:00
Minor update
This commit is contained in:
parent
568e9f0d37
commit
57047ba8cf
3 changed files with 11 additions and 6 deletions
|
|
@ -19,7 +19,7 @@ from lib.core.enums import OS
|
|||
from thirdparty import six
|
||||
|
||||
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
|
||||
VERSION = "1.10.1.49"
|
||||
VERSION = "1.10.1.50"
|
||||
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)
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ class Wordlist(six.Iterator):
|
|||
def __init__(self, filenames, proc_id=None, proc_count=None, custom=None):
|
||||
self.filenames = [filenames] if isinstance(filenames, six.string_types) else filenames
|
||||
self.fp = None
|
||||
self.zip_file = None
|
||||
self.index = 0
|
||||
self.counter = -1
|
||||
self.current = None
|
||||
|
|
@ -49,16 +50,16 @@ class Wordlist(six.Iterator):
|
|||
self.current = self.filenames[self.index]
|
||||
if isZipFile(self.current):
|
||||
try:
|
||||
_ = zipfile.ZipFile(self.current, 'r')
|
||||
self.zip_file = zipfile.ZipFile(self.current, 'r')
|
||||
except zipfile.error as ex:
|
||||
errMsg = "something appears to be wrong with "
|
||||
errMsg += "the file '%s' ('%s'). Please make " % (self.current, getSafeExString(ex))
|
||||
errMsg += "sure that you haven't made any changes to it"
|
||||
raise SqlmapInstallationException(errMsg)
|
||||
if len(_.namelist()) == 0:
|
||||
if len(self.zip_file.namelist()) == 0:
|
||||
errMsg = "no file(s) inside '%s'" % self.current
|
||||
raise SqlmapDataException(errMsg)
|
||||
self.fp = _.open(_.namelist()[0])
|
||||
self.fp = self.zip_file.open(self.zip_file.namelist()[0])
|
||||
else:
|
||||
self.fp = open(self.current, "rb")
|
||||
self.iter = iter(self.fp)
|
||||
|
|
@ -70,6 +71,10 @@ class Wordlist(six.Iterator):
|
|||
self.fp.close()
|
||||
self.fp = None
|
||||
|
||||
if self.zip_file:
|
||||
self.zip_file.close()
|
||||
self.zip_file = None
|
||||
|
||||
def __next__(self):
|
||||
retVal = None
|
||||
while True:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue