def main(): console = Console(prompt="firewall", prompt_delim=">") show = Command("show", help="Show command helper") setup = Command("setup", help="Setup options") console.loop()
def main(): console = Console("marvin", ">") notebook = NotebookSDK("notebook") dryrun = DryRunSDK("dryrun") console.addChild(notebook) console.addChild(dryrun) 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("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("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()
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 # print """Welcome to FeatherDuster! To get started, use 'import' to load samples. Then, use 'analyze' to analyze/decode samples and get attack recommendations. Next, run the 'use' command to select an attack module. Finally, use 'run' to run the attack and see its output. For a command reference, press Enter on a blank line. """ for filename in sys.argv[1:]: sample_file = filename sample_fh = open(sample_file,'r') feathermodules.samples.append(sample_fh.read()) sample_fh.close() fd_console.loop() print '\nThank you for using FeatherDuster!'
if filename in ['-h', '--help']: print 'Usage: python featherduster.py [ciphertext file 1] ... [ciphertext file n]' exit() elif filename in ['-d', '--debug']: debug = True try: sample_fh = open(filename, 'r') feathermodules.samples.append(sample_fh.read()) sample_fh.close() except: continue print """Welcome to FeatherDuster! To get started, use 'import' to load samples. Then, use 'analyze' to analyze/decode samples and get attack recommendations. Next, run the 'use' command to select an attack module. Finally, use 'run' to run the attack and see its output. For a command reference, press Enter on a blank line. """ fd_console.loop() print '\nThank you for using FeatherDuster!' def main(): # blank function so I don't have to restructure this whole file to address an annoying error return 0
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()
def main(): console = Console(prompt="firewall", prompt_delim=">") show = Command("show", help="Show command helper") setup = Command("setup", help="Setup options") console.loop()