本文整理汇总了Python中core.data.bloomfilter.pybloom.ScalableBloomFilter类的典型用法代码示例。如果您正苦于以下问题:Python ScalableBloomFilter类的具体用法?Python ScalableBloomFilter怎么用?Python ScalableBloomFilter使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ScalableBloomFilter类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: dotNetErrors
class dotNetErrors(baseDiscoveryPlugin):
'''
Request specially crafted URLs that generate ASP.NET errors in order to gather information.
@author: Andres Riancho ( [email protected] )
'''
def __init__(self):
baseDiscoveryPlugin.__init__(self)
# Internal variables
self._already_tested = ScalableBloomFilter()
def discover(self, fuzzableRequest ):
'''
Requests the special filenames.
@parameter fuzzableRequest: A fuzzableRequest instance that contains (among other things) the URL to test.
'''
if fuzzableRequest.getURL() not in self._already_tested:
self._already_tested.add( fuzzableRequest.getURL() )
# Generate the URLs to GET
to_test = self._generate_URLs( fuzzableRequest.getURL() )
for url in to_test:
try:
response = self._urlOpener.GET( url, useCache=True )
except KeyboardInterrupt,e:
raise e
except w3afException,w3:
om.out.error( str(w3) )
else:
self._analyze_response( response )
示例2: frontpage_version
class frontpage_version(baseDiscoveryPlugin):
'''
Search FrontPage Server Info file and if it finds it will determine its version.
@author: Viktor Gazdag ( [email protected] )
'''
def __init__(self):
baseDiscoveryPlugin.__init__(self)
# Internal variables
self._analyzed_dirs = ScalableBloomFilter()
self._exec = True
def discover(self, fuzzableRequest ):
'''
For every directory, fetch a list of files and analyze the response.
@parameter fuzzableRequest: A fuzzableRequest instance that contains (among other things) the URL to test.
'''
fuzzable_return_value = []
if not self._exec:
# This will remove the plugin from the discovery plugins to be runned.
raise w3afRunOnce()
else:
# Run the plugin.
self._exec = False
for domain_path in urlParser.getDirectories(fuzzableRequest.getURL() ):
if domain_path not in self._analyzed_dirs:
# Save the domain_path so I know I'm not working in vane
self._analyzed_dirs.add( domain_path )
# Request the file
frontpage_info_url = urlParser.urlJoin( domain_path , "_vti_inf.html" )
try:
response = self._urlOpener.GET( frontpage_info_url, useCache=True )
om.out.debug( '[frontpage_version] Testing "' + frontpage_info_url + '".' )
except w3afException, w3:
msg = 'Failed to GET Frontpage Server _vti_inf.html file: "'
msg += frontpage_info_url + '". Exception: "' + str(w3) + '".'
om.out.debug( msg )
else:
# Check if it's a Fronpage Info file
if not is_404( response ):
fuzzable_return_value.extend( self._createFuzzableRequests( response ) )
self._analyze_response( response )
return fuzzable_return_value
示例3: __init__
def __init__(self):
baseGrepPlugin.__init__(self)
self._rss_tag_attr = [('rss', 'version', 'RSS'),# <rss version="...">
('feed', 'version', 'OPML'),# <feed version="..."
('opml', 'version', 'OPML') # <opml version="...">
]
self._already_inspected = ScalableBloomFilter()
示例4: __init__
def __init__(self):
baseDiscoveryPlugin.__init__(self)
# Internal variables
self._exec = True
self._already_tested = ScalableBloomFilter()
self._bad_codes = [ httpConstants.UNAUTHORIZED, httpConstants.NOT_IMPLEMENTED,
httpConstants.METHOD_NOT_ALLOWED, httpConstants.FORBIDDEN]
# Methods
self._dav_methods = [ 'DELETE', 'PROPFIND', 'PROPPATCH', 'COPY', 'MOVE', 'LOCK',
'UNLOCK', 'MKCOL']
self._common_methods = [ 'OPTIONS', 'GET', 'HEAD', 'POST', 'TRACE', 'PUT']
self._uncommon_methods = ['*', 'SUBSCRIPTIONS', 'NOTIFY', 'DEBUG', 'TRACK', 'POLL', 'PIN',
'INVOKE', 'SUBSCRIBE', 'UNSUBSCRIBE']
# Methods taken from http://www.w3.org/Protocols/HTTP/Methods.html
self._proposed_methods = [ 'CHECKOUT', 'SHOWMETHOD', 'LINK', 'UNLINK', 'CHECKIN',
'TEXTSEARCH', 'SPACEJUMP', 'SEARCH', 'REPLY']
self._extra_methods = [ 'CONNECT', 'RMDIR', 'MKDIR', 'REPORT', 'ACL', 'DELETE', 'INDEX',
'LABEL', 'INVALID']
self._version_control = [ 'VERSION_CONTROL', 'CHECKIN', 'UNCHECKOUT', 'PATCH', 'MERGE',
'MKWORKSPACE', 'MKACTIVITY', 'BASELINE_CONTROL']
self._supported_methods = self._dav_methods + self._common_methods + self._uncommon_methods
self._supported_methods += self._proposed_methods + self._extra_methods
self._supported_methods += self._version_control
# User configured variables
self._exec_one_time = True
self._report_dav_only = True
示例5: __init__
def __init__(self):
baseDiscoveryPlugin.__init__(self)
# internal variables
self._exec = True
self._already_visited = ScalableBloomFilter()
self._first_time = True
self._show_remote_server = True
# User configured parameters
self._db_file = 'plugins' + os.path.sep + 'discovery' + os.path.sep + 'pykto'
self._db_file += os.path.sep + 'scan_database.db'
self._extra_db_file = 'plugins' + os.path.sep + 'discovery' + os.path.sep
self._extra_db_file += 'pykto' + os.path.sep + 'w3af_scan_database.db'
self._cgi_dirs = ['/cgi-bin/']
self._admin_dirs = ['/admin/', '/adm/']
self._users = ['adm', 'bin', 'daemon', 'ftp', 'guest', 'listen', 'lp',
'mysql', 'noaccess', 'nobody', 'nobody4', 'nuucp', 'operator',
'root', 'smmsp', 'smtp', 'sshd', 'sys', 'test', 'unknown']
self._nuke = ['/', '/postnuke/', '/postnuke/html/', '/modules/', '/phpBB/', '/forum/']
self._mutate_tests = False
self._generic_scan = False
self._update_scandb = False
self._source = ''
示例6: __init__
def __init__(self):
baseGrepPlugin.__init__(self)
self._already_reported = ScalableBloomFilter()
# regex to split between words
self._split_re = re.compile('[^\w]')
示例7: __init__
def __init__(self):
baseDiscoveryPlugin.__init__(self)
# Internal variables
self._already_visited = ScalableBloomFilter()
# User configured parameters
self._max_depth = 3
示例8: __init__
def __init__(self):
baseGrepPlugin.__init__(self)
self._tag_names = []
self._tag_names.append('object')
self._tag_names.append('applet')
self._already_analyzed = ScalableBloomFilter()
示例9: __init__
def __init__(self):
baseDiscoveryPlugin.__init__(self)
# Internal variables
self._first_exec = True
self._already_queried = ScalableBloomFilter()
self._can_resolve_domain_names = False
self._non_existant_response = None
示例10: __init__
def __init__(self):
baseGrepPlugin.__init__(self)
# Only generate the lists once.
# Adding 0,001% performance ;)
self._already_inspected = ScalableBloomFilter()
self._wsdl_strings = self._get_WSDL_strings()
self._disco_strings = ['disco:discovery ']
示例11: __init__
def __init__(self):
baseGrepPlugin.__init__(self)
self._already_visited = ScalableBloomFilter()
# Added performance by compiling all the regular expressions
# before using them. The setup time of the whole plugin raises,
# but the execution time is lowered *a lot*.
self._compiled_regex_list = [ re.compile(regex, re.IGNORECASE | re.DOTALL) for regex in self._get_indexing_regex() ]
示例12: __init__
def __init__(self):
baseGrepPlugin.__init__(self)
# Internal variables
self._already_inspected = ScalableBloomFilter()
# Create the regular expression to search for AJAX
ajax_regex_string = '(XMLHttpRequest|eval\(|ActiveXObject|Msxml2\.XMLHTTP|'
ajax_regex_string += 'ActiveXObject|Microsoft\.XMLHTTP)'
self._ajax_regex_re = re.compile( ajax_regex_string, re.IGNORECASE )
示例13: __init__
def __init__(self):
baseDiscoveryPlugin.__init__(self)
self._already_visited = ScalableBloomFilter()
self._first_time = True
# This is for the Referer
self._headers = {}
# User options
self._fuzz_images = False
self._max_digit_sections = 4
示例14: __init__
def __init__(self):
baseGrepPlugin.__init__(self)
self._already_inspected = ScalableBloomFilter()
# Add the regex to match something like this:
#
# $Id: lzio.c,v 1.24 2003/03/20 16:00:56 roberto Exp $
# $Id: file name, version, timestamp, creator Exp $
#
regex = '\$.{1,12}: .*? .*? \d{4}[-/]\d{1,2}[-/]\d{1,2}'
regex += ' \d{1,2}:\d{1,2}:\d{1,2}.*? (.*?) (Exp )?\$'
self._regex_list = [ re.compile(regex) ]
示例15: __init__
def __init__(self):
baseGrepPlugin.__init__(self)
self._comments = {}
self._search404 = False
self._interesting_words = {'user':None, 'pass':None, 'microsoft':None,
'visual':None, 'linux':None, 'source':None, 'author':None, 'release':None,
'version':None, 'verify-v1':'Google Sitemap' }
self._already_inspected = ScalableBloomFilter()
'''