Exemplo n.º 1
0
import sys



if __name__ == "__main__":


    if  len(sys.argv) == 3 and sys.argv[1].startswith('http'):


        url = sys.argv[1]
        password = sys.argv[2]

        try:
            Terminal ( ModHandler(url, password) ).loop()
        except ModuleException, e:
            print '[!] [%s] %s ' % (e.module, e.error)
        except (KeyboardInterrupt, EOFError):
            print '\n[!] Exiting. Bye ^^'

    elif len(sys.argv) >= 3 and sys.argv[1].startswith('session'):

        sessionfile = sys.argv[2]

        try:
           Terminal(ModHandler()).loop(sessionfile)
        except ModuleException, e:
           print '[!] [%s] %s ' % (e.module, e.error)
        except KeyboardInterrupt:
           print '\n[!] Exiting. Bye ^^'
Exemplo n.º 2
0
                               or sys.argv[1] == 'session'):

        url = None
        password = None
        sessionfile = None

        if sys.argv[1].startswith('http'):
            url = sys.argv[1]
            password = sys.argv[2]
        else:
            sessionfile = sys.argv[2]

        try:

            module_handler = ModHandler(url=url,
                                        password=password,
                                        sessionfile=sessionfile)

            if len(sys.argv) == 3:
                Terminal(module_handler).loop()
            else:
                Terminal(module_handler).run_cmd_line(sys.argv[3:])

        except ModuleException, e:
            print '[%s] [!] %s ' % (e.module, e.error)
        except (KeyboardInterrupt, EOFError):
            print '\n[!] Exiting. Bye ^^'

    elif len(sys.argv) >= 3 and sys.argv[1].startswith('generate'):

        genname = sys.argv[1]
Exemplo n.º 3
0
    def setUpClass(cls):

        cls.term = core.terminal.Terminal(ModHandler(conf['url'], conf['pwd']))
        cls._setenv()