I get connected to openvas, and successfully run the scan. However, I can't get the results to show without the task_id. How do I find the task_id?
from threading import Semaphore
from functools import partial
from openvas_lib import VulnscanManager, VulnscanException
def my_print_status(i):
print str(i)
def my_launch_scanner():
Sem = Semaphore(0)
# Configure
manager = VulnscanManager("localhost", "admin", "admin")
# Launch
manager.launch_scan(target,
profile = "empty",
callback_end = partial(lambda x: x.release(), sem),
callback_progress = my_print_status)
# Wait
Sem.acquire()
# Finished scan
print "finished"
Code is from: https://pypi.python.org/pypi/openvas_lib/1.0. The website suggests the following code; however, it says task not found when I use it. I believe it is supposed to use the task_id not scan_id. So how do I find the task_id?
from openvas_lib import VulnscanManager, VulnscanException
scanner = VulnscanManager(HOST, USER, PASSWORD, PORT, TIMEOUT)
openvas_results = scanner.get_results(SCAN_ID)