Esempio n. 1
0
 def usemodule_godaddy(self, arg):
     """Opens the Godaddy module for configuration"""
     if  not  self.variables["godaddy_access_key"]:
         print("The access key of  Godaddy is not set! [help set godaddy_access_key]")
     elif not self.variables["godaddy_secret_key"]:
         print("The secret key of  Godaddy is not set! [help set godaddy_secret_key]")
     elif not self.variables["domains"]:
         print("No domains are set! [help set domains]")
     else:
         godaddy.main(self.campaign,self.variables["domains"],None)
         addModule(godaddy.module,self.campaign)
         self.update_choices(self.campaign)
         godaddy.module={}
Esempio n. 2
0
    def do_editmodule(self, arg):
        """Edits a module"""
        #Checks the module type and pass it to the correct module for processing
        for idx, c in enumerate(self.campaign):
            if arg.id == c["id"]:
                mod = self.campaign.pop(idx)

                if c["module"] == "c2":
                    c2.main(self.campaign, mod, self.project_id)
                    addModule(c2.module, self.campaign)
                    self.update_choices(self.campaign)
                    c2.module = {}
                    break

                if c["module"] == "dns_record":
                    dns_records.main(self.variables["domains"], self.campaign,
                                     mod, self.project_id)
                    addModule(dns_records.module, self.campaign)
                    self.update_choices(self.campaign)
                    dns_records.module = {}
                    break

                if c["module"] == "redirector":
                    redirector.main(mod, self.campaign, self.project_id)
                    addModule(redirector.module, self.campaign)
                    self.update_choices(self.campaign)
                    redirector.module = {}
                    break

                if c["module"] == "gophish":
                    gophish.main(self.campaign, mod, self.project_id)
                    addModule(gophish.module, self.campaign)
                    self.update_choices(self.campaign)
                    gophish.module = {}
                    break

                if c["module"] == "letsencrypt":
                    letsencrypt.main(
                        self.campaign, mod,
                        self.project_id)  #self.variables["domains"]
                    addModule(letsencrypt.module, self.campaign)
                    self.update_choices(self.campaign)
                    letsencrypt.module = {}
                    break

                if c["module"] == "mail":
                    mail_server.main(self.variables["domains"], self.campaign,
                                     mod, self.project_id)
                    addModule(mail_server.module, self.campaign)
                    self.update_choices(self.campaign)
                    mail_server.module = {}
                    break

                if c["module"] == "webserver":
                    webserver.main(self.campaign, mod, self.project_id)
                    addModule(webserver.module, self.campaign)
                    self.update_choices(self.campaign)
                    webserver.module = {}
                    break

                if c["module"] == "godaddy":
                    godaddy.main(self.campaign, self.variables["domains"], mod,
                                 self.project_id)
                    addModule(godaddy.module, self.campaign)
                    self.update_choices(self.campaign)
                    godaddy.module = {}
                    break

                if c["module"] == "ansible":
                    ansible.main(self.campaign, mod, self.project_id)
                    addModule(ansible.module, self.campaign)
                    self.update_choices(self.campaign)
                    ansible.module = {}
                    break