0

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)

Picture of error

perhaps
  • 11
  • 3

1 Answers1

1

There is another example, a bit earlier at the same page:

https://github.com/golismero/openvas_lib#launch-a-simple-scan

Basically, launch_scan method returns both scan id and task id, as a tuple.

Sergey V.
  • 611
  • 5
  • 7