def main():
    readline.parse_and_bind("tab: complete")
    readline.set_completer(listener_completer)
    while True:
        try:
            prompt = input('\x1b[1m\x1b[37mPyIris (\x1b[0m' +
                           '\x1b[1m\x1b[34mListeners\x1b[0m' +
                           '\x1b[1m\x1b[37m) > \x1b[0m').strip()
            command = prompt.split(' ', 1)[0].lower()
            if command == 'back':
                print(config.inf + 'Returning...')
                return
            elif command == 'bind':
                print(config.inf + 'Binding...')
                socket_connector.main(prompt)
            elif command == 'clear':
                clear.main()
            elif command in ('?', 'help'):
                help.main('listener', prompt)
            elif command == 'kill':
                kill.main(prompt)
            elif command in ('!', 'local'):
                local.main(prompt)
            elif command == 'more':
                more.main(prompt)
            elif command == 'python':
                python.main()
            elif command == 'quit':
                quit.main()
            elif command == 'rename':
                rename.main(prompt)
            elif command == 'reset':
                reset.main(prompt)
            elif command == 'run':
                run.main()
            elif command == 'show':
                show.main(prompt)
            elif command == 'set':
                set.main(prompt)
            elif not command:
                pass
            else:
                print(config.neg + 'Invalid command, run "help" for help menu')
        except EOFError:
            try:
                time.sleep(2)
            except KeyboardInterrupt:
                quit.main()
        except KeyboardInterrupt:
            quit.main()
Esempio n. 2
0
def main():
    while True:
        try:
            prompt = raw_input('PyIris (Listeners) > ').strip()
            command = prompt.split(' ',1)[0]
            if command == 'back':
                print '[*]Returning...'
                return
            elif command == 'clear':
                clear.main()
            elif command in ('?','help'):
                help.main('listener',prompt)
            elif command == 'kill':
                kill.main(prompt)
            elif command in ('!','local'):
                local.main(prompt)
            elif command == 'more':
                more.main(prompt)
            elif command == 'python':
                python.main()
            elif command == 'quit':
                quit.main()
            elif command == 'rename':
                rename.main(prompt)
            elif command == 'reset':
                reset.main(prompt)
            elif command == 'run':
                run.main()
            elif command == 'show':
                show.main(prompt)
            elif command == 'set':
                set.main(prompt)
            elif not command:
                pass
            else:
                print '[-]Invalid command, run "help" for help menu'
        except EOFError:
            try:
                time.sleep(2)
            except KeyboardInterrupt:
                quit.main()
        except KeyboardInterrupt:
            quit.main()