Example #1
0
 def __load_variables(self):
     """
     Load extra variables, specified in the .andsploit_config file.
     """
     
     for key in Configuration.get_all_keys("vars"):
         self.variables[key] = Configuration.get("vars", key)
Example #2
0
    def ca_path(self, skip_default=False):
        """
        Get the path to the CA Key Material, as defined by the configuration file.
        """

        ca_path = Configuration.get("ssl", "ca_path")

        if ca_path == None and skip_default == False:
            ca_path = os.path.join(os.path.dirname(__file__), "embedded_ca")

        return ca_path
Example #3
0
 def get(cls, url):
     """
     Get an instance of Remote, initialised with the remote settings.
     """
     
     url = Configuration.get('remotes', url)
     
     if url != None:
         return cls(url)
     else:
         return None
Example #4
0
    def trusted_certificate_for(self, peer):
        """
        Fetches the trusted certificate for a peer.
        """

        return Configuration.get("ssl-known-hosts", "%s|%d" % peer)