Exemplo n.º 1
0
 def usemodule_letsencrypt(self, arg):
     """Opens the letsencrypt module for configuration"""
     a_records = False
     for c in self.campaign:
         if c["module"] == "dns_record" and c["type"]== "A":
             a_records = True
             break
     if a_records == False:
         print("No A records were set! [help usemodule dns_records]")
     else:
         letsencrypt.main(self.campaign,None) #self.variables["domains"]
         addModule(letsencrypt.module,self.campaign)
         self.update_choices(self.campaign)
         letsencrypt.module={}
Exemplo 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