Ejemplo n.º 1
0
 def initialize(self):
     """ Load router exploits; store {router:[vuln]}
     """
     self.load()
     while True:
         choice = util.print_menu([x for x in self.routers.keys()])
         if choice is 0:
             del(self.routers)
             break
         elif choice is -1 or choice > len(self.routers.keys()):
             pass
         else:
             router = self.routers[self.routers.keys()[choice - 1]]
             while True:
                 choice = util.print_menu([x().which for x in router])
                 if choice is 0:
                     break
                 elif choice is -1 or choice > len(router):
                     pass
                 else:
                     stream.initialize(router[choice - 1])
Ejemplo n.º 2
0
 def initialize(self):
     """ Load router exploits; store {router:[vuln]}
     """
     self.load()
     while True:
         choice = util.print_menu([x for x in self.routers.keys()])
         if choice is 0:
             del (self.routers)
             break
         elif choice is -1 or choice > len(self.routers.keys()):
             pass
         else:
             router = self.routers[self.routers.keys()[choice - 1]]
             while True:
                 choice = util.print_menu([x().which for x in router])
                 if choice is 0:
                     break
                 elif choice is -1 or choice > len(router):
                     pass
                 else:
                     stream.initialize(router[choice - 1])
Ejemplo n.º 3
0
Archivo: zarp.py Proyecto: zyan03/zarp
def main():
    """ Zarp entry point
    """

    # set up configuration
    config.initialize()

    # set up database
    database.initialize()

    # load modules
    loader = LoadedModules()
    loader.load()
    Msg('Loaded %d modules.' % loader.total)

    # handle command line options first
    if len(argv) > 1:
        parse_cmd.parse(argv, loader)

    # menus
    main_menu = ['Poisoners', 'DoS Attacks', 'Sniffers', 'Scanners',
                     'Parameter', 'Services', 'Attacks', 'Sessions']

    running = True
    choice = -1
    while running:
        header()
        choice = print_menu(main_menu)
        if choice == 0:
            # check if they've got running sessions!
            cnt = stream.get_session_count()
            if cnt > 0:
                choice = raw_input(color.YELLOW +
                'You have %d sessions running.  Are you sure? [Y/n] ' % cnt
                 + color.END)
                if 'y' in choice.lower() or choice == '':
                    Msg('Shutting all sessions down...')
                    stream.stop_session('all', -1)
                    running = False
            else:
                debug("Exiting with session count: %d" % (cnt))
                Msg("Exiting...")
                running = False
        elif choice == 1:
            while True:
                choice = print_menu([x().which for x in loader.poison])
                if choice == 0:
                    break
                elif choice == -1:
                    pass
                elif choice > len(loader.poison):
                    continue
                else:
                    stream.initialize(loader.poison[choice - 1])
        elif choice == 2:
            while True:
                choice = print_menu([x().which for x in loader.dos])
                if choice == 0:
                    break
                elif choice == -1:
                    pass
                elif choice > len(loader.dos):
                    continue
                else:
                    stream.initialize(loader.dos[choice - 1])
        elif choice == 3:
            while True:
                choice = print_menu([x().which for x in loader.sniffers])
                if choice == 0:
                    break
                elif choice == -1:
                    pass
                elif choice > len(loader.sniffers):
                    continue
                else:
                    stream.initialize(loader.sniffers[choice - 1])
        elif choice == 4:
            while True:
                choice = print_menu([x().which for x in loader.scanner])
                if choice == 0:
                    break
                elif choice == -1:
                    pass
                elif choice > len(loader.scanner):
                    continue
                else:
                    stream.initialize(loader.scanner[choice - 1])
        elif choice == 5:
            while True:
                choice = print_menu([x().which for x in loader.parameter])
                if choice == 0:
                    break
                elif choice == -1:
                    pass
                elif choice > len(loader.parameter):
                    continue
                else:
                    stream.initialize(loader.parameter[choice - 1])
        elif choice == 6:
            while True:
                choice = print_menu([x().which for x in loader.services])
                if choice == 0:
                    break
                elif choice == -1:
                    pass
                elif choice > len(loader.services):
                    continue
                else:
                    stream.initialize(loader.services[choice - 1])
        elif choice == 7:
            while True:
                choice = print_menu([x().which for x in loader.attacks])
                if choice == 0:
                    break
                elif choice == -1:
                    pass
                elif choice > len(loader.attacks):
                    continue
                else:
                    stream.initialize(loader.attacks[choice - 1])
        elif choice == 8:
            session_manager.menu()
        elif choice == -1:
            pass
Ejemplo n.º 4
0
def main():
    """ Zarp entry point
	"""

    # handle command line options first
    if len(sys.argv) > 1:
        parse_cmd.parse(sys.argv)

    # set up configuration
    config.initialize()

    # menus
    main_menu = [
        'Poisoners', 'DoS Attacks', 'Sniffers', 'Scanners', 'Parameter',
        'Services', 'Sessions'
    ]

    # load modules
    loader = LoadedModules()
    loader.load()
    Msg('Loaded %d modules.' % loader.total)

    running = True
    choice = -1
    while running:
        header()
        choice = print_menu(main_menu)
        if choice == 0:
            # check if they've got running sessions!
            cnt = stream.get_session_count()
            if cnt > 0:
                Msg('You have %d sessions running.  Are you sure?' % cnt)
                choice = raw_input('> ')
                if 'y' in choice.lower():
                    Msg('Shutting all sessions down...')
                    stream.stop_session('all', -1)
                    running = False
            else:
                debug("Exiting with session count: %d" % (cnt))
                Msg("Exiting...")
                running = False
        elif choice == 1:
            while True:
                choice = print_menu([x().which for x in loader.poison])
                if choice == 0:
                    break
                elif choice == -1:
                    pass
                elif choice > len(loader.poison):
                    continue
                else:
                    stream.initialize(loader.poison[choice - 1], 'POISON')
        elif choice == 2:
            while True:
                choice = print_menu([x().which for x in loader.dos])
                if choice == 0:
                    break
                elif choice == -1:
                    pass
                elif choice > len(loader.dos):
                    continue
                else:
                    stream.initialize(loader.dos[choice - 1], 'DOS')
        elif choice == 3:
            while True:
                choice = print_menu([x().which for x in loader.sniffers])
                if choice == 0:
                    break
                elif choice == -1:
                    pass
                elif choice > len(loader.sniffers):
                    continue
                else:
                    stream.initialize(loader.sniffers[choice - 1], 'SNIFFER')
        elif choice == 4:
            while True:
                choice = print_menu([x().which for x in loader.scanner])
                if choice == 0:
                    break
                elif choice == -1:
                    pass
                elif choice > len(loader.scanner):
                    continue
                else:
                    stream.initialize(loader.scanner[choice - 1], 'SCANNER')
        elif choice == 5:
            while True:
                choice = print_menu([x().which for x in loader.parameter])
                if choice == 0:
                    break
                elif choice == -1:
                    pass
                elif choice > len(loader.parameter):
                    continue
                else:
                    stream.initialize(loader.parameter[choice - 1],
                                      'PARAMETER')
        elif choice == 6:
            while True:
                choice = print_menu([x().which for x in loader.services])
                if choice == 0:
                    break
                elif choice == -1:
                    pass
                elif choice > len(loader.services):
                    continue
                else:
                    stream.initialize(loader.services[choice - 1], 'SERVICE')
        elif choice == 7:
            session_manager.menu()
        elif choice == -1:
            pass
Ejemplo n.º 5
0
def main():
    """ Zarp entry point
    """

    # set up configuration
    config.initialize()

    # set up database
    database.initialize()

    # load modules
    loader = LoadedModules()
    loader.load()
    Msg("Loaded %d modules." % loader.total)

    # handle command line options first
    if len(argv) > 1:
        parse_cmd.parse(argv, loader)

    # menus
    main_menu = ["Poisoners", "DoS Attacks", "Sniffers", "Scanners", "Parameter", "Services", "Attacks", "Sessions"]

    running = True
    choice = -1
    while running:
        header()
        choice = print_menu(main_menu)
        if choice == 0:
            # check if they've got running sessions!
            cnt = stream.get_session_count()
            if cnt > 0:
                choice = raw_input(
                    color.YELLOW + "You have %d sessions running.  Are you sure? [Y/n] " % cnt + color.END
                )
                if "y" in choice.lower() or choice == "":
                    Msg("Shutting all sessions down...")
                    stream.stop_session("all", -1)
                    running = False

                    # recheck that all sessions are down
                    cnt = stream.get_session_count()
                    if cnt <= 0:
                        # some libs dont clean up their own threads, so
                        # we need to hard quit those to avoid hanging; FIXME
                        _exit(1)
            else:
                debug("Exiting with session count: %d" % (cnt))
                Msg("Exiting...")
                running = False
        elif choice == 1:
            while True:
                choice = print_menu([x().which for x in loader.poison])
                if choice == 0:
                    break
                elif choice == -1:
                    pass
                elif choice > len(loader.poison):
                    continue
                else:
                    stream.initialize(loader.poison[choice - 1])
        elif choice == 2:
            while True:
                choice = print_menu([x().which for x in loader.dos])
                if choice == 0:
                    break
                elif choice == -1:
                    pass
                elif choice > len(loader.dos):
                    continue
                else:
                    stream.initialize(loader.dos[choice - 1])
        elif choice == 3:
            while True:
                choice = print_menu([x().which for x in loader.sniffers])
                if choice == 0:
                    break
                elif choice == -1:
                    pass
                elif choice > len(loader.sniffers):
                    continue
                else:
                    stream.initialize(loader.sniffers[choice - 1])
        elif choice == 4:
            while True:
                choice = print_menu([x().which for x in loader.scanner])
                if choice == 0:
                    break
                elif choice == -1:
                    pass
                elif choice > len(loader.scanner):
                    continue
                else:
                    stream.initialize(loader.scanner[choice - 1])
        elif choice == 5:
            while True:
                choice = print_menu([x().which for x in loader.parameter])
                if choice == 0:
                    break
                elif choice == -1:
                    pass
                elif choice > len(loader.parameter):
                    continue
                else:
                    stream.initialize(loader.parameter[choice - 1])
        elif choice == 6:
            while True:
                choice = print_menu([x().which for x in loader.services])
                if choice == 0:
                    break
                elif choice == -1:
                    pass
                elif choice > len(loader.services):
                    continue
                else:
                    stream.initialize(loader.services[choice - 1])
        elif choice == 7:
            while True:
                choice = print_menu([x().which for x in loader.attacks])
                if choice == 0:
                    break
                elif choice == -1:
                    pass
                elif choice > len(loader.attacks):
                    continue
                else:
                    stream.initialize(loader.attacks[choice - 1])
        elif choice == 8:
            session_manager.menu()
        elif choice == -1:
            pass
Ejemplo n.º 6
0
def main():
    """ Zarp entry point
    """

    # set up configuration
    config.initialize()

    # set up database
    database.initialize()

    # load modules
    loader = LoadedModules()
    loader.load()
    util.Msg('Loaded %d modules.' % loader.total)

    # handle command line options first
    if len(argv) > 1:
        parse_cmd.parse(argv, loader)

    # menus
    main_menu = [
        'Poisoners', 'DoS Attacks', 'Sniffers', 'Scanners', 'Parameter',
        'Services', 'Attacks', 'Sessions'
    ]

    running = True
    choice = -1
    while running:
        util.header()
        choice = util.print_menu(main_menu)
        if choice == 0:
            # check if they've got running sessions!
            cnt = stream.get_session_count()
            if cnt > 0:
                display = color.B_YELLOW + 'You have %d sessions running. ' + \
                          'Are you sure? ' + color.B_GREEN + '[' + color.B_YELLOW + \
                          'Y' + color.B_GREEN + '/' + color.B_YELLOW + 'n' + \
                          color.B_GREEN + '] ' + color.END
                choice = raw_input(display % cnt)
                if 'y' in choice.lower() or choice == '':
                    util.Msg('Shutting all sessions down...')
                    stream.stop_session('all', -1)
                    running = False

            else:
                util.debug("Exiting with session count: %d" % (cnt))
                util.Msg("Exiting...")
                running = False

            # remove zarp temporary directory
            util.init_app('rm -fr /tmp/.zarp/')

            # recheck that all sessions are down
            cnt = stream.get_session_count()
            if cnt <= 0:
                # some libs dont clean up their own threads, so
                # we need to hard quit those to avoid hanging; FIXME
                _exit(1)
        elif choice == 1:
            while True:
                choice = util.print_menu([x().which for x in loader.poison])
                if choice == 0:
                    break
                elif choice == -1:
                    pass
                elif choice > len(loader.poison):
                    continue
                else:
                    stream.initialize(loader.poison[choice - 1])
        elif choice == 2:
            while True:
                choice = util.print_menu([x().which for x in loader.dos])
                if choice == 0:
                    break
                elif choice == -1:
                    pass
                elif choice > len(loader.dos):
                    continue
                else:
                    stream.initialize(loader.dos[choice - 1])
        elif choice == 3:
            while True:
                choice = util.print_menu([x().which for x in loader.sniffers])
                if choice == 0:
                    break
                elif choice == -1:
                    pass
                elif choice > len(loader.sniffers):
                    continue
                else:
                    stream.initialize(loader.sniffers[choice - 1])
        elif choice == 4:
            while True:
                choice = util.print_menu([x().which for x in loader.scanner])
                if choice == 0:
                    break
                elif choice == -1:
                    pass
                elif choice > len(loader.scanner):
                    continue
                else:
                    stream.initialize(loader.scanner[choice - 1])
        elif choice == 5:
            while True:
                choice = util.print_menu([x().which for x in loader.parameter])
                if choice == 0:
                    break
                elif choice == -1:
                    pass
                elif choice > len(loader.parameter):
                    continue
                else:
                    stream.initialize(loader.parameter[choice - 1])
        elif choice == 6:
            while True:
                choice = util.print_menu([x().which for x in loader.services])
                if choice == 0:
                    break
                elif choice == -1:
                    pass
                elif choice > len(loader.services):
                    continue
                else:
                    stream.initialize(loader.services[choice - 1])
        elif choice == 7:
            while True:
                choice = util.print_menu([x().which for x in loader.attacks])
                if choice == 0:
                    break
                elif choice == -1:
                    pass
                elif choice > len(loader.attacks):
                    continue
                else:
                    stream.initialize(loader.attacks[choice - 1])
        elif choice == 8:
            session_manager.menu()
        elif choice == -1:
            pass
Ejemplo n.º 7
0
Archivo: zarp.py Proyecto: fabaff/zarp
def main():
	# handle command line options first
	if len(sys.argv) > 1:
		parse_cmd.parse(sys.argv)
	
	# set up configuration 
	config.initialize()

	# menus
	main_menu =    [ 'Poisoners', 'DoS Attacks', 'Sniffers', 'Scanners',
				     'Parameter','Services','Sessions']
	poison_menu =  [ 'ARP Poison', 'DNS Poison', 'DHCP Poison', 'NBNS Spoof']
	dos_menu =     [ 'NDP', 'Nestea', 'LAND', 'TCP SYN', 'SMB2',
					'DHCP Starve'
				   ]
	sniffer_menu = [ 'HTTP Sniffer', 'Password Sniffer', 'Traffic Sniffer']
	service_menu = [ 'HTTP Server', 'SSH Server', 'FTP Server', 'SMB Listener', 'Access Point' ]
	scanner_menu = [ 'NetMap', 'Service Scan', 'AP Scan']
	parameter_menu = [ 'WEP Crack', 'WPA2 Crack', 'WPS Crack', 'Router Pwn', 'Pass-The-Hash' ]
	
	running = True
	choice = -1
	while running:
		header()
		choice = print_menu(main_menu)		
		if choice == 0:
			# check if they've got running sessions! 
			cnt = stream.get_session_count()
			if cnt > 0:
				Msg('You have %d sessions running.  Are you sure?'%cnt)
				choice = raw_input('> ')
				if 'y' in choice.lower(): 
					stream.stop_session('all', -1)
					running = False	
			else:
				debug("Exiting with session count: %d"%(cnt))
				Msg("Exiting...")
				running = False
		elif choice == 1:
			while True:
				choice = print_menu(poison_menu)
				if choice == 0:
					break
				elif choice == 1:
					stream.initialize('arp')
				elif choice == 2:
					stream.initialize('dns')
				elif choice == 3:
					stream.initialize('dhcp')
				elif choice == 4:
					stream.initialize('nbns')
				elif choice == -1:
					pass
		elif choice == 2:
			while True:
				choice = print_menu(dos_menu)
				if choice == 1:
					stream.initialize('ndp')
				elif choice == 2:
					stream.initialize('nestea')
				elif choice == 3:
					stream.initialize('land')
				elif choice == 4:
					stream.initialize('tcp_syn')
				elif choice == 5:
					stream.initialize('smb2')
				elif choice == 6:
					stream.initialize('dhcp_starv')
				elif choice == 0:
					break
				elif choice == -1:
					pass
				else:
					os.system('clear')
		elif choice == 3:
			while True:
				choice = print_menu(sniffer_menu)
				if choice == 0:
					break
				elif choice == 1:
					stream.initialize('http_sniffer')
				elif choice == 2:
					stream.initialize('password_sniffer')
				elif choice == 3:
					stream.initialize('traffic_sniffer')
				elif choice == -1:
					pass
		elif choice == 4:
			while True:
				choice = print_menu(scanner_menu)
				if choice == 0:
					break
				elif choice == 1:
					stream.initialize('net_map')
				elif choice == 2:
					stream.initialize('service_scan')
				elif choice == 3:
					stream.initialize('ap_scan')
				elif choice == -1:
					pass
		elif choice == 5:
			while True:
				choice = print_menu(parameter_menu)
				if choice == 0:
					break
				elif choice == 1:
					stream.initialize('wep_crack')	
				elif choice == 2:
					stream.initialize('wpa_crack')	
				elif choice == 3:
					stream.initialize('wps_crack')
				elif choice == 4:
					stream.initialize('router_pwn')	
				elif choice == 5:
					util.Error('Module not yet implemented')
					#stream.initialize('pass_the_hash')
				elif choice == -1:
					pass
		elif choice == 6:
			while True:
				choice = print_menu(service_menu)
				if choice == 0:
					break
				elif choice == 1:
					stream.initialize('http_server')
				elif choice == 2:
					stream.initialize('ssh_server')
				elif choice == 3:
					stream.initialize('ftp_server')
				elif choice == 4:
					stream.initialize('smb')
				elif choice == 5:
					stream.initialize('access_point')
				elif choice == -1:
					pass
		elif choice == 7:
			session_manager.menu()
		elif choice == -1:
			pass
Ejemplo n.º 8
0
Archivo: zarp.py Proyecto: 0x0mar/zarp
def main():
    """ Zarp entry point
    """

    # set up configuration
    config.initialize()

    # set up database
    database.initialize()

    # load modules
    loader = LoadedModules()
    loader.load()
    util.Msg('Loaded %d modules.' % loader.total)

    # handle command line options first
    if len(argv) > 1:
        parse_cmd.parse(argv, loader)

    # menus
    main_menu = ['Poisoners', 'DoS Attacks', 'Sniffers', 'Scanners',
                     'Parameter', 'Services', 'Attacks', 'Sessions']

    running = True
    choice = -1
    while running:
        util.header()
        choice = util.print_menu(main_menu)
        if choice == 0:
            # check if they've got running sessions!
            cnt = stream.get_session_count()
            if cnt > 0:
                display = color.B_YELLOW + 'You have %d sessions running. ' + \
                          'Are you sure? ' + color.B_GREEN + '[' + color.B_YELLOW + \
                          'Y' + color.B_GREEN + '/' + color.B_YELLOW + 'n' + \
                          color.B_GREEN + '] ' + color.END
                choice = raw_input(display % cnt)
                if 'y' in choice.lower() or choice == '':
                    util.Msg('Shutting all sessions down...')
                    stream.stop_session('all', -1)
                    running = False

            else:
                util.debug("Exiting with session count: %d" % (cnt))
                util.Msg("Exiting...")
                running = False

            # remove zarp temporary directory
            util.init_app('rm -fr /tmp/.zarp/')
             
            # recheck that all sessions are down
            cnt = stream.get_session_count()
            if cnt <= 0:
               # some libs dont clean up their own threads, so
               # we need to hard quit those to avoid hanging; FIXME
               _exit(1)
        elif choice == 1:
            while True:
                choice = util.print_menu([x().which for x in loader.poison])
                if choice == 0:
                    break
                elif choice == -1:
                    pass
                elif choice > len(loader.poison):
                    continue
                else:
                    stream.initialize(loader.poison[choice - 1])
        elif choice == 2:
            while True:
                choice = util.print_menu([x().which for x in loader.dos])
                if choice == 0:
                    break
                elif choice == -1:
                    pass
                elif choice > len(loader.dos):
                    continue
                else:
                    stream.initialize(loader.dos[choice - 1])
        elif choice == 3:
            while True:
                choice = util.print_menu([x().which for x in loader.sniffers])
                if choice == 0:
                    break
                elif choice == -1:
                    pass
                elif choice > len(loader.sniffers):
                    continue
                else:
                    stream.initialize(loader.sniffers[choice - 1])
        elif choice == 4:
            while True:
                choice = util.print_menu([x().which for x in loader.scanner])
                if choice == 0:
                    break
                elif choice == -1:
                    pass
                elif choice > len(loader.scanner):
                    continue
                else:
                    stream.initialize(loader.scanner[choice - 1])
        elif choice == 5:
            while True:
                choice = util.print_menu([x().which for x in loader.parameter])
                if choice == 0:
                    break
                elif choice == -1:
                    pass
                elif choice > len(loader.parameter):
                    continue
                else:
                    stream.initialize(loader.parameter[choice - 1])
        elif choice == 6:
            while True:
                choice = util.print_menu([x().which for x in loader.services])
                if choice == 0:
                    break
                elif choice == -1:
                    pass
                elif choice > len(loader.services):
                    continue
                else:
                    stream.initialize(loader.services[choice - 1])
        elif choice == 7:
            while True:
                choice = util.print_menu([x().which for x in loader.attacks])
                if choice == 0:
                    break
                elif choice == -1:
                    pass
                elif choice > len(loader.attacks):
                    continue
                else:
                    stream.initialize(loader.attacks[choice - 1])
        elif choice == 8:
            session_manager.menu()
        elif choice == -1:
            pass