def test_launch_scan(): print "Testing launching an OpenVAS scan..." sem = Semaphore(0) manager = VulnscanManager(host, user, password) scan_id, target_id = manager.launch_scan( target, profile=profile, callback_end=partial(lambda x: x.release(), sem), callback_progress=callback_step ) sem.acquire() print manager.get_results(scan_id)
def test_get_info(): print "Testing OpenVAS manager properties..." manager = VulnscanManager(host, user, password) print "All scans" print manager.get_all_scans print "Finished scans" print manager.get_finished_scans print "Running scans" print manager.get_running_scans print "Available profiles" print manager.get_profiles
def test_callback(): print "Testing openvas lib callbacks..." sem = Semaphore(0) manager = VulnscanManager(host, user, password) # Launch manager.launch_scan(target, profile="empty", callback_end=partial(lambda x: x.release(), sem), callback_progress=callback_step) # Wait sem.acquire() print "Finished callback test!"
def test_status(): manager = VulnscanManager(host, user, password) print "Testing OpenVAS status..." print manager.get_progress("4aa8df2f-3b35-4c1e-8c26-74202f02dd12")