當前位置: 首頁>>代碼示例>>Python>>正文


Python pybloom.ScalableBloomFilter類代碼示例

本文整理匯總了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 )
開發者ID:DavisHevin,項目名稱:sqli_benchmark,代碼行數:32,代碼來源:dotNetErrors.py

示例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
開發者ID:DavisHevin,項目名稱:sqli_benchmark,代碼行數:51,代碼來源:frontpage_version.py

示例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()
開發者ID:DavisHevin,項目名稱:sqli_benchmark,代碼行數:7,代碼來源:feeds.py

示例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
開發者ID:DavisHevin,項目名稱:sqli_benchmark,代碼行數:32,代碼來源:allowedMethods.py

示例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 = ''
開發者ID:DavisHevin,項目名稱:sqli_benchmark,代碼行數:27,代碼來源:pykto.py

示例6: __init__

 def __init__(self):
     baseGrepPlugin.__init__(self)
     
     self._already_reported = ScalableBloomFilter()
     
     # regex to split between words
     self._split_re = re.compile('[^\w]')
開發者ID:DavisHevin,項目名稱:sqli_benchmark,代碼行數:7,代碼來源:hashFind.py

示例7: __init__

 def __init__(self):
     baseDiscoveryPlugin.__init__(self)
     
     # Internal variables
     self._already_visited = ScalableBloomFilter()
     
     # User configured parameters
     self._max_depth = 3
開發者ID:DavisHevin,項目名稱:sqli_benchmark,代碼行數:8,代碼來源:archiveDotOrg.py

示例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()
開發者ID:DavisHevin,項目名稱:sqli_benchmark,代碼行數:8,代碼來源:objects.py

示例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
開發者ID:DavisHevin,項目名稱:sqli_benchmark,代碼行數:8,代碼來源:findvhost.py

示例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 ']
開發者ID:DavisHevin,項目名稱:sqli_benchmark,代碼行數:8,代碼來源:wsdlGreper.py

示例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() ]
開發者ID:DavisHevin,項目名稱:sqli_benchmark,代碼行數:9,代碼來源:directoryIndexing.py

示例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 )
開發者ID:DavisHevin,項目名稱:sqli_benchmark,代碼行數:10,代碼來源:ajax.py

示例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
開發者ID:DavisHevin,項目名稱:sqli_benchmark,代碼行數:11,代碼來源:digitSum.py

示例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) ]
開發者ID:DavisHevin,項目名稱:sqli_benchmark,代碼行數:11,代碼來源:svnUsers.py

示例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()
     
     '''
開發者ID:DavisHevin,項目名稱:sqli_benchmark,代碼行數:12,代碼來源:metaTags.py


注:本文中的core.data.bloomfilter.pybloom.ScalableBloomFilter類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。