def __init__(self, url=None, ip=None): """[ CRAWLER ] Just Crawling Around""" import argparse super(Arachnida, self).__init__() Nimbus.__init__(self) self.name = "Crawler Object" self.modus = "[ CRAWLER|MODE ]" self.colors = {"back": Back.RED, "fore": Fore.GREEN} self.session_id = id(self) self.session_name = "nimbus " + self.colors['back'] + self.colors['fore'] + "{}".format(self.modus) + Style.RESET_ALL + " \> " self.session_crawl = True self.queue = self._queue_crawler from Core.banners import Banners Banners.arachnida() self.sprint("ACTIVATED", mode=self.modus) self.parser = argparse.ArgumentParser(prog="Nimbus Framework {}".format(self.modus), description="Need it any description?", argument_default=None, epilog="Nimbus // Rain with Rage, Exploit with Love") self.parser.add_argument('command', help="Use command to begin") while self.session_crawl: self.command = input(self.session_name) if not self.command: self.sprint("No Command Given", mode=self.modus) continue else: import re if re.match("-", self.command.split()[0]): self.sprint("Wrong! Dont use OPTIONS but choose a COMMAND", mode=self.modus) print(self.usage()) continue elif self.command.split()[0] == "?": print(self.usage()) else: self.args = self.parser.parse_args(self.command.split()[0:1]) try: if hasattr(self, self.args.command): """ Maybe the Most Important Code of the Whole Framework """ getattr(self, self.args.command)() elif not hasattr(self, self.args.command): self.sprint("Unrecognized command", mode=self.modus) self.sprint("try again pall", mode=self.modus) self.sprint("*" * 40 + "\n") print(self.usage(), "\n") self.sprint("*" * 40 + "\n") continue else: print("%s\n%s\n%s" % ("*"*40, "* If you see this message, something went HORRIBLY wrong! Call for help!", "*"*40)) except Exception as e: print(str("[ {}_EXCEPTION ]".format(self.__class__.__name__)).upper(), str(e))
def usage(self): """Usage Coomment String""" import inspect from Core.banners import Banners from veryprettytable import VeryPrettyTable banner = Banners() commands = VeryPrettyTable(["Command", "Description"]) commands.align = "l" commands.padding_width = 2 banner.randomize() for attr in [attr for attr in dir(self) if inspect.ismethod(getattr(self, attr))]: if attr not in ["usage", "__init__", "__del__", "__str__", "save_state", "methods", "sprint"]: commands.add_row([attr, getattr(self, attr).__doc__]) return commands
def usage(self): """Usage Coomment String""" import inspect from Core.banners import Banners from veryprettytable import VeryPrettyTable banner = Banners() commands = VeryPrettyTable(["Command", "Description"]) commands.align = "l" commands.padding_width = 2 banner.randomize() for attr in [attr for attr in dir(self) if inspect.ismethod(getattr(self, attr))]: if attr not in ["usage", "__init__", "__del__", "__str__", "methods", "sprint"]: # print("%s\t\t\t%s" % (attr, getattr(self, attr).__doc__)) commands.add_row([attr, getattr(self, attr).__doc__]) return commands
def target(self): """[ TARGET ] Add, Del, Edit targets""" from Core.banners import Banners self.function_name = "target" parser = argparse.ArgumentParser(prog="{} function".format(self.function_name.upper()), conflict_handler="resolve", description=Banners.targets()) process = parser.add_argument_group(" ### Database".upper(), description="{}".format("-"*40)) shell = parser.add_argument_group(" ### Shell Interactive Mode".upper(), description="{}".format("-"*40)) while self.session_state: try: if not self.command.split()[1:]: from pymongo import MongoClient mongo = MongoClient("localhost", port=27017, connect=True) db = mongo["targets"]["targets"] check = db.find_one({"target_pinned": True}) print(check) break elif self.command.split()[1:]: # Shell Mode shell.add_argument("--shell", dest="shell", action="store_true", default=False, help="Interactive Mode On/Off") # Target Options parser.add_argument("--add", dest="add", action="store", default=None, help="Add a new target to our HitList") parser.add_argument("--edit", dest="edit", action="store_true", default=False, help="Edit the Target") parser.add_argument("--dell", dest="dell", action="store_true", default=False, help="Remove a target from the HitList") parser.add_argument("--pin", dest="pin", action="store", default=None, help="Pin a Target to make it a Victim") parser.add_argument("--pull", dest="pull", action="store_true", default=False, help="Pull the pin from the Victim") # GROUP: Current Targets process.add_argument("--current", action="store_true", default=False, help="Check All current target(s)") # GROUP: Current Running process.add_argument("--running", action="store_true", default=False, help="Check All running processes on target(s)") args = parser.parse_args(self.command.split()[1:]) # print(vars(args)) if vars(args)['shell']: # First check if SHELL MODE is Activated from Modules.Target.controller import TargetShell # shell_mode = Target() shell = TargetShell() break else: # If SHell Mode is not Activated, what do you want to do? print("Checking what is all TRUE or FALSE") print(vars(args)) """ here we import the method and call the object with our args """ # from Plugins.SQLmap.controller import SQLIController # SQLIController(vars(args)) print("I NEED A STATISTICS OBJECT TO CALL TO") except Exception as e: sprint(Exception("[ {} ]".format(self.function_name.upper()), str(e))) finally: break