endpoints/plugins/NmapDiscovery.py
def load_instance_config(self, config):
        """
        Attempt to load the results from the cache. If no cache exists, run a new scan and cache those results
        :param data: configuration data from the settings.py file
        :return: None
        """
        global results

        # remove "/" from network name so we can use it for our cache
        cache_network_name = self.get_config_value("network").replace("/", "-")
        cache_key_name = "NmapDiscovery_%s" % cache_network_name

        # query the cache
        results = cache.get(cache_key_name)

        if results is None:
            print "No results found - performing new scan"
            ps = PortScanner()
            results = ps.scan(hosts=self.get_config_value("network"), arguments="-sP")
            cache.set(cache_key_name, results, int(self.get_config_value("cache_timeout")))

        self.iterator = iter(results["scan"].iteritems())
        return

        Attempt to load the results from the cache. If no cache exists, run a new scan and cache those results
        :param data: configuration data from the settings.py file
        :return: None
        
Attempt to load the results from the cache. If no cache exists, run a new scan and cache those results
Attempt to load the results from the cache . If no cache exists run a new scan and cache those results
def load_instance_config(self, config):
        global results
        cache_network_name = self.get_config_value("network").replace("/", "-")
        cache_key_name = "NmapDiscovery_%s" % cache_network_name
        results = cache.get(cache_key_name)
        if results is None:
            print "No results found - performing new scan"
            ps = PortScanner()
            results = ps.scan(hosts=self.get_config_value("network"), arguments="-sP")
            cache.set(cache_key_name, results, int(self.get_config_value("cache_timeout")))
        self.iterator = iter(results["scan"].iteritems())
        return
def load_instance_config ( self , config ) : global results cache_network_name = self . get_config_value ( "network" ) . replace ( "/" , "-" ) cache_key_name = "NmapDiscovery_%s" % cache_network_name results = cache . get ( cache_key_name ) if results is None : print "No results found - performing new scan" ps = PortScanner ( ) results = ps . scan ( hosts = self . get_config_value ( "network" ) , arguments = "-sP" ) cache . set ( cache_key_name , results , int ( self . get_config_value ( "cache_timeout" ) ) ) self . iterator = iter ( results [ "scan" ] . iteritems ( ) ) return
Attempt to load the results from the cache.
Attempt to load the results from the cache .
"""
        Attempt to load the results from the cache. If no cache exists, run a new scan and cache those results
        :param data: configuration data from the settings.py file
        :return: None
        """ # remove "/" from network name so we can use it for our cache # query the cache
None
self
config
data
configuration data from the settings.py file
configuration data from the settings . py file