Exploit databaseDownload repository ZIP
GH-6b6057e48941ec7e0988d1ab08178590
2402221619/tool
Sources for CVE-2013-0422
8 sourcesPreferred order: Exploit-DB, Metasploit, then GitHub repositories by stars. Open preferred source
Repository files68
2402221619/toolRevision e1de8defa93c
- ↑..Parent directory
- __init__.py
- __init__.pyc
- agent.py
- agent.pyc
- bigarray.py
- bigarray.pyc
- common.py
- common.pyc
- convert.py
- convert.pyc
- data.py
- data.pyc
- datatype.py
- datatype.pyc
- decorators.py
- decorators.pyc
- defaults.py
- defaults.pyc
- dicts.py
- dicts.pyc
- dump.py
- dump.pyc
- enums.py
- enums.pyc
- exception.py
- exception.pyc
- htmlentities.py
- htmlentities.pyc
- log.py
- log.pyc
- option.py
- option.pyc
- optiondict.py
- optiondict.pyc
- profiling.py
- profiling.pyc
- progress.py
- progress.pyc
- purge.py
- purge.pyc
- readlineng.py
- readlineng.pyc
- replication.py
- replication.pyc
- revision.py
- revision.pyc
- session.py
- session.pyc
- settings.py
- settings.pyc
Files from this repository share one source choice. Supporting files may cover other vulnerabilities.
渗透工具/sqlmap GUI/lib/core/wordlist.py
Python · 2,180 bytes#!/usr/bin/env python
"""
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
from lib.core.settings import UNICODE_ENCODING
class Wordlist(object):
"""
Iterator for looping over a large dictionaries
"""
def __init__(self, filenames, proc_id=None, proc_count=None, custom=None):
self.filenames = filenames
self.fp = None
self.index = 0
self.counter = -1
self.iter = None
self.custom = custom or []
self.proc_id = proc_id
self.proc_count = proc_count
self.adjust()
def __iter__(self):
return self
def adjust(self):
self.closeFP()
if self.index > len(self.filenames):
raise StopIteration
elif self.index == len(self.filenames):
self.iter = iter(self.custom)
else:
current = self.filenames[self.index]
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
def closeFP(self):
if self.fp:
self.fp.close()
self.fp = None
def next(self):
retVal = None
while True:
self.counter += 1
try:
retVal = self.iter.next().rstrip()
except StopIteration:
self.adjust()
retVal = self.iter.next().rstrip()
try:
retVal = retVal.decode(UNICODE_ENCODING)
except UnicodeDecodeError:
continue
if not self.proc_count or self.counter % self.proc_count == self.proc_id:
break
return retVal
def rewind(self):
self.index = 0
self.adjust()