def main(): console = Console("marvin", ">") notebook = NotebookSDK("notebook") dryrun = DryRunSDK("dryrun") console.addChild(notebook) console.addChild(dryrun) console.loop()
def main(): console = Console("root@dev:~", '#') ls = LS("ls") bash = Bash("bash") top = Top("top") console.addChild(ls) console.addChild(bash) console.addChild(top) console.addChild(Command('show')).addChild(Command('disk')).addChild(DiskIO('io')) console.loop()
def main(): console = Console("root@dev:~", '#') ls = LS("ls") bash = Bash("bash") top = Top("top") console.addChild(ls) console.addChild(bash) console.addChild(top) console.addChild(Command('show')).addChild(Command('disk')).addChild( DiskIO('io')) console.loop()
def main(): console = Console("RouterA") enable = Enable("enable", help="Enter enable mode") ping = PingCommand('ping', help="Ping destination ip. Ex: ping 8.8.8.8") traceroute = TraceRouteCommand('traceroute', help="Trace route to destination ip. Ex: traceroute 8.8.8.8") console.addChild(enable) console.addChild(ping) console.addChild(traceroute) console.loop()
def main(): console = Console("RouterA") enable = Enable("enable", help="Enter enable mode") ping = PingCommand('ping', help="Ping destination ip. Ex: ping 8.8.8.8") traceroute = TraceRouteCommand( 'traceroute', help="Trace route to destination ip. Ex: traceroute 8.8.8.8") console.addChild(enable) console.addChild(ping) console.addChild(traceroute) console.loop()
return False option = line_split[1] feathermodules.current_options[option] = feathermodules.selected_attack['options'][option] def args(self): return feathermodules.selected_attack['options'].keys() set_command = SetCommand('set', help='Set an option (i.e., "set num_answers=3"', dynamic_args=True) unset = UnsetCommand('unset', help='Revert an option to its default value', dynamic_args=True) options = OptionsCommand('options', help='Show the current option values', dynamic_args=True) # Build the console fd_console = Console(prompt='\nFeatherDuster', prompt_delim='>') fd_console.addChild(import_sample) fd_console.addChild(use) fd_console.addChild(analyze) fd_console.addChild(autopwn) fd_console.addChild(search) fd_console.addChild(samples) fd_console.addChild(modules) fd_console.addChild(run) fd_console.addChild(options) fd_console.addChild(set_command) fd_console.addChild(unset) #-------- # Main menu #
set_command = SetCommand('set', help='Set an option (i.e., "set num_answers=3"', dynamic_args=True) unset = UnsetCommand('unset', help='Revert an option to its default value', dynamic_args=True) options = OptionsCommand('options', help='Show the current option values', dynamic_args=True) results = ResultsCommand('results', help='Show the results from the last module run') # Build the console fd_console = Console(prompt='\nFeatherDuster', prompt_delim='>') fd_console.addChild(import_sample) fd_console.addChild(console) fd_console.addChild(export) fd_console.addChild(use) fd_console.addChild(analyze) fd_console.addChild(autopwn) fd_console.addChild(search) fd_console.addChild(samples) fd_console.addChild(modules) fd_console.addChild(run) fd_console.addChild(options) fd_console.addChild(set_command) fd_console.addChild(unset) fd_console.addChild(results) #--------
return parse_to_table(r.json()) except (ValueError, TypeError) as e: print 'Error', e class GetCommand(Command): def run(self, line): params = line.split() data = get(table=params[1], row=params[2]) if data: print_table(data) class ScanCommand(Command): def run(self, line): params = line.split() prefix = params[2] if len(params) >= 3 else '' limit = params[3] if len(params) >= 4 else 100 data = scan(table=params[1], row_prefix=prefix, limit=limit) if data: print_table(data) get_command = GetCommand("get", help="Get a row") scan_command = ScanCommand("scan", help="Scan rows") console = Console(prompt="", prompt_delim="hqlsh>") console.addChild(get_command) console.addChild(scan_command) console.loop()
class ShowMacAddressTableCommand(Command): def run(self, line): call("./show-mac-address-table.sh") class ShowCommand(Command): def args(self): return ["interface", "mac-address-table"] def run(self, line): print "Command is not complete" # MAIN CODE console = Console(prompt="VDSCLI ", prompt_delim="#") # show tree show_command = ShowCommand("show", help="show configurations", dynamic_args=True) showInterface_command = ShowInterfaceCommand("interface") showMacAddressTable_command = ShowMacAddressTableCommand("mac-address-table") console.addChild(show_command) show_command.addChild(showInterface_command) show_command.addChild(showMacAddressTable_command) console.loop()
# options class OptionsCommand(Command): # TODO: Eventually, migrate option selection out of feathermodules and into FD itself def run(self, line): print 'Currently selected module: %s' % feathermodules.selected_attack options = OptionsCommand('options', help='Show current configuration options', dynamic_args=True) # Build the console fd_console = Console(prompt='\nFeatherDuster', prompt_delim='>') fd_console.addChild(import_sample) fd_console.addChild(use) fd_console.addChild(analyze) fd_console.addChild(autopwn) fd_console.addChild(search) fd_console.addChild(samples) fd_console.addChild(modules) fd_console.addChild(run) fd_console.addChild(options) #-------- # Main menu # print """Welcome to FeatherDuster! To get started, use 'import' to load samples.