Beispiel #1
1
    def console(self):
        # commands & functions
        self.switcher = {
            "load": self.load,
            "set": self.set,
            "unset": self.unset,
            "global": self.setglobal,
            "show": self.show,
            "run": self.run,
            "back": self.back,
            "warrior": self.warrior,
            "quit": self.quit,
            "help": self.help,
        }
        # Configuring the commpleter
        self.comp = Completer([
            'load', 'set', 'unset', 'global', 'show', 'run', 'back', 'warrior',
            'quit', 'help'
        ])
        readline.set_completer_delims(' \t\n;')
        readline.parse_and_bind("tab: complete")
        readline.set_completer(self.comp.complete)

        print(banners.get_banner())
        cprint(' [+]', 'yellow', end='')
        print(' Starting the console...')
        cprint(' [*]', 'green', end='')
        print(' Console ready!\n')

        self.session = None

        while True:
            try:
                if self.session is None:
                    # /* Definitions available for use by readline clients. */
                    # define RL_PROMPT_START_IGNORE  '\001'
                    # define RL_PROMPT_END_IGNORE    '\002'
                    user_input = input(
                        '\001\033[1;32m\002iBombShell> \001\033[0m\002').strip(
                        )
                else:
                    user_input = input('iBombShell[' + '\001\033[1;32m\002' +
                                       self.session.header() +
                                       '\001\033[0m\002' + ']> ').strip()

                if user_input == "":
                    continue
                else:
                    self.switch(user_input)
            except KeyboardInterrupt:
                signal.signal(signal.SIGINT, self.keyboard_interrupt_handler)
                print("")
                Warrior.get_instance().kill_warriors()
            except Exception as e:
                print_error(e)
Beispiel #2
0
def console():
    # Configuring the commpleter
    comp = Completer(['load', 'set', 'show', 'run', 'back', 'quit', 'help'])
    readline.set_completer_delims(' \t\n;')
    readline.parse_and_bind("tab: complete")
    readline.set_completer(comp.complete)
    brush = Brush()

    print(banners.get_banner())
    brush.color(' [+]', 'YELLOW')
    print ' Starting the console...'
    brush.color(' [*]', 'GREEN')
    print ' Console ready!\n\n'

    session = None

    while True:

        if session is None:
            user_input = raw_input(
                colored('uac-a-mola> ', 'yellow', attrs=['bold'])).split()
        else:
            user_input = raw_input(
                "uac-a-mola[" +
                colored(session.header(), 'yellow', attrs=['bold']) +
                "]> ").split()

        if user_input == []:
            continue

        elif user_input[0] in CLEAR_COMMANDS:
            os.system('cls')

        elif user_input[0] == 'back':
            session = None

        elif user_input[0] in END_COMMANDS:
            sys.exit(0)

        elif user_input[0] == 'load':
            if (len(user_input) == 1):
                brush.color('[!] Please, load a module\n', 'RED')
                continue
            session = Session(user_input[1])
            brush = Brush()

            # The module is incorrect
            if not (session.correct_module()):
                session = None

        elif user_input[0] == 'show':
            if session is None:
                brush.color('[!] Please, load a module\n', 'RED')
                continue
            session.show()

        elif user_input[0] == 'set':
            if session is None:
                brush.color('[!] Please, load a module\n', 'RED')
                continue
            elif len(user_input) != 3:
                brush.color('[!] Wrong number of arguments for set\n', 'RED')
                continue
            else:
                session.set(user_input[1], user_input[2])

        elif user_input[0] == 'run':
            if session is None:
                brush.color('[!] Please, load a module\n', 'RED')
                continue
            session.run()
Beispiel #3
0
def exit_greet():
    try:
        os.system('cls')
    except Exception as e:
        os.system('clear')
    print(
        GREEN +
        '''Thank You for using TechNowHorse, Think Great & Touch The Sky!  \n'''
        + END)
    quit()


if __name__ == '__main__':
    os.system('rm -Rf dist')
    try:
        print(banners.get_banner())
        print(
            f"\t\t{YELLOW}Author: {GREEN}Pushpender | {YELLOW}Website: {GREEN}technowlogy.tk\n"
        )

        arguments = get_options()

        if arguments.icon == None:
            arguments.icon = input(
                f'{RED}[!] Please Specify Icon Path {WHITE}[{GREEN}LEAVE BLANK to SET icon/exe.ico as icon{WHITE}] : '
            )
            if arguments.icon == "":
                arguments.icon = "icon/exe.ico"

        print(
            f'\n{GREEN}[ * * * * * * * * * * * * * * * * * * * * * * * * * ]{GREEN}'
Beispiel #4
0
if (args.value is not None):
    p.value = args.value

if (args.key is not None):
    p.key = args.key

if (args.newkey is not None):
    p.newkey = args.newkey

if args.verbosity is not None and args.verbosity == 1:
    p.verbosity = args.verbosity

if args.newkeypath is not None:
    p.newkeypath = args.newkeypath

if args.encrypted:
    p.encrypted = True

if args.break_connection:
    p.breakcon = True

print banners.get_banner()

print "[*] Setting iptables rules..."
set_iptables_rules()

p.poison()

print "[*] Cleaning iptables rules..."
clean_iptables()
Beispiel #5
0
def console():
    # Configuring the commpleter
    comp = Completer(['load', 'set', 'show', 'run', 'back', 'quit', 'help'])
    readline.set_completer_delims(' \t\n;')
    readline.parse_and_bind("tab: complete")
    readline.set_completer(comp.complete)
    brush = Brush()

    print(banners.get_banner())
    brush.color(' [+]', 'YELLOW')
    print ' Starting the console...'
    brush.color(' [*]', 'GREEN')
    print ' Console ready!\n\n'

    session = None

    while True:
        try:
            if session is None:
                user_input = raw_input(
                    colored('uac-a-mola> ', 'yellow', attrs=['bold'])).split()
            else:
                user_input = raw_input(
                    "uac-a-mola[" +
                    colored(session.header(), 'yellow', attrs=['bold']) +
                    "]> ").split()

            if user_input == []:
                continue

            elif user_input[0] in CLEAR_COMMANDS:
                os.system('cls')

            elif user_input[0] == 'back':
                session = None

            elif user_input[0] in END_COMMANDS:
                os._exit(-1)

            elif user_input[0] == 'load':
                if (len(user_input) == 1):
                    brush.color('[!] Please, load a module\n', 'RED')
                    continue
                session = Session(user_input[1])
                brush = Brush()

                # The module is incorrect
                if not (session.correct_module()):
                    session = None

            elif user_input[0] == 'show':
                if session is None:
                    brush.color('[!] Please, load a module\n', 'RED')
                    continue
                session.show()

            elif user_input[0] == 'set':
                if session is None:
                    brush.color('[!] Please, load a module\n', 'RED')
                    continue
                elif len(user_input) < 3:
                    brush.color('[!] Please, assigns a value\n', 'RED')
                    continue
                elif len(user_input) > 3:
                    data = " ".join(user_input[2:])
                else:
                    data = user_input[2]
                session.set(user_input[1], data)

            elif user_input[0] == 'run':
                if session is None:
                    brush.color('[!] Please, load a module\n', 'RED')
                    continue
                session.run()
        except KeyboardInterrupt:
            print("[-] Closing")
            break
        except Exception as e:
            print(e)
Beispiel #6
0
def console():
    # Configuring the commpleter
    comp = Completer([
        'load', 'set', 'unset', 'show', 'run', 'back', 'warrior', 'quit',
        'help'
    ])
    readline.set_completer_delims(' \t\n;')
    readline.parse_and_bind("tab: complete")
    readline.set_completer(comp.complete)

    print(banners.get_banner())
    cprint(' [+]', 'yellow', end='')
    print(' Starting the console...')
    cprint(' [*]', 'green', end='')
    print(' Console ready!\n')

    session = None

    while True:
        try:
            if session is None:
                # With termcolor not work colors
                # user_input = input(
                #     colored('iBombShell> ', 'green', attrs=['bold'])).split()

                # /* Definitions available for use by readline clients. */
                # define RL_PROMPT_START_IGNORE  '\001'
                # define RL_PROMPT_END_IGNORE    '\002'
                user_input = input(
                    '\001\033[1;32m\002iBombShell> \001\033[0m\002').split()
            else:
                # user_input = input(
                #     "iBombShell["
                #     + colored(session.header(), 'green', attrs=['bold'])
                #     + "]> ").split()

                user_input = input('iBombShell[' + '\001\033[1;32m\002' +
                                   session.header() + '\001\033[0m\002' +
                                   ']> ').split()

            if user_input == []:
                continue
            elif user_input[0] in CLEAR_COMMANDS:
                os.system('cls' if os.name == 'nt' else 'clear')
            elif user_input[0] == 'help':
                print_help()
            elif user_input[0] == 'back':
                session = None
            elif user_input[0] == 'warrior' and len(user_input) >= 2:
                if user_input[1] == 'list':
                    Warrior.get_instance().print_warriors()
                elif user_input[1] == "rename":
                    if len(user_input) > 2:
                        Warrior.get_instance().rename_warrior(user_input[2])
                    else:
                        raise Exception("Specify the warrior")
                elif user_input[1] == "kill":
                    if len(user_input) > 2:
                        Warrior.get_instance().kill_warrior(user_input[2])
                    else:
                        raise Exception("Specify the warrior")
            elif user_input[0] in END_COMMANDS:
                Warrior.get_instance().kill_warriors()

            elif user_input[0] == 'load':
                if (len(user_input) == 1):
                    print_load_module()
                    continue
                session = Session(user_input[1])

                # The module is incorrect
                if not (session.correct_module()):
                    cprint('[!] Invalid module', 'red')
                    session = None
                else:
                    comp.set_commands_to_set(session.get_options_name())

            elif user_input[0] == 'show':
                if session is None:
                    print_load_module()
                    continue
                session.show()

            elif user_input[0] == 'set':
                if session is None:
                    print_load_module()
                    continue
                else:
                    value = ' '.join([str(x) for x in user_input[2:]])
                    session.set(user_input[1], value)
            elif user_input[0] == 'unset':
                if session is None:
                    print_load_module()
                    continue
                else:
                    session.unset(user_input[1])

            elif user_input[0] == 'run':
                if session is None:
                    print_load_module()
                    continue
                session.run()
            else:
                cprint('[!] Command not found', 'red')
        except KeyboardInterrupt:
            print("")
            Warrior.get_instance().kill_warriors()
        except Exception as e:
            cprint(e, "red")
Beispiel #7
0
def console():
    # Configuring the commpleter
    comp = Completer(['load', 'set', 'show', 'run', 'back', 'warriors', 'quit', 'help'])
    gnureadline.set_completer_delims(' \t\n;')
    gnureadline.parse_and_bind("tab: complete")
    gnureadline.set_completer(comp.complete)

    print (banners.get_banner())
    cprint(' [+]', 'yellow', end='')
    print (' Starting the console...')
    cprint(' [*]', 'green', end='')
    print (' Console ready!\n')

    session = None

    while True:
        if session is None:
            # With termcolor not work colors
            # user_input = input(
            #     colored('iBombShell> ', 'green', attrs=['bold'])).split()

            # /* Definitions available for use by readline clients. */
            # define RL_PROMPT_START_IGNORE  '\001'
            # define RL_PROMPT_END_IGNORE    '\002'
            user_input = input('\001\033[1;32m\002iBombShell> \001\033[0m\002').split()
        else:
            # user_input = input(
            #     "iBombShell["
            #     + colored(session.header(), 'green', attrs=['bold'])
            #     + "]> ").split()

            user_input = input('iBombShell[' +
                               '\001\033[1;32m\002' +
                               session.header() +
                               '\001\033[0m\002' +
                               ']> ').split()

        if user_input == []:
            continue

        elif user_input[0] in CLEAR_COMMANDS:
            os.system('cls' if os.name=='nt' else 'clear')

        elif user_input[0] == 'back':
            session = None

        elif user_input[0] == 'warriors':
            i = 0
            for p in Path("/tmp/").glob("ibs-*"):
                i += 1
                cprint(str(p)[9:], 'yellow')
            
            if i == 0:
                cprint('[!] Warriors haven\'t been found...', 'red')

        elif user_input[0] in END_COMMANDS:
            cprint('[+] Killing warriors...', 'green')
            for p in Path("/tmp/").glob("ibs-*"):
                p.unlink()
            cprint('[+] Exit...', 'green')
            os._exit(-1)

        elif user_input[0] == 'load':
            if (len(user_input) == 1):
                cprint('[!] Please, load a module', 'red')
                continue
            session = Session(user_input[1])

            # The module is incorrect
            if not(session.correct_module()):
                cprint('[!] Invalid module', 'red')
                session = None

        elif user_input[0] == 'show':
            if session is None:
                cprint('[!] Please, load a module', 'red')
                continue
            session.show()

        elif user_input[0] == 'set':
            if session is None:
                cprint('[!] Please, load a module', 'red')
                continue
            else:
                value = ' '.join([str(x) for x in user_input[2:]])
                session.set(user_input[1], value)

        elif user_input[0] == 'run':
            if session is None:
                cprint('[!] Please, load a module', 'red')
                continue
            session.run()

        else:
            cprint('[!] Command not found', 'red')