golismero / openvas_lib

OpenVAS connector for versions 6, 7, 8 and 9
BSD 3-Clause "New" or "Revised" License
80 stars 100 forks source link

Example code issue #14

Open lshahar opened 7 years ago

lshahar commented 7 years ago

while trying to run example code got exception

from openvas_lib import VulnscanManager, VulnscanException

try:
    scanner = VulnscanManager(HOST, USER, PASSWORD, PORT, TIMEOUT)
except VulnscanException as e:
    print("Error:")
    print(e)

Traceback (most recent call last): File "vas_poc.py", line 35, in my_launch_scanner() File "vas_poc.py", line 19, in my_launch_scanner manager = VulnscanManager("localhost", "admin", "admin",4433) File "/usr/lib/python2.7/site-packages/openvas_lib/init.py", line 497, in init self.manager = get_connector(host, user, password, port, m_time_out, ssl_verify) File "/usr/lib/python2.7/site-packages/openvas_lib/common.py", line 73, in get_connector manager = ConnectionManager(host, username, password, port, timeout, ssl_verify) File "/usr/lib/python2.7/site-packages/openvas_lib/common.py", line 149, in init self._connect() File "/usr/lib/python2.7/site-packages/openvas_lib/common.py", line 200, in _connect self._authenticate(self.username, self.__password) File "/usr/lib/python2.7/site-packages/openvas_lib/common.py", line 228, in _authenticate self.make_xml_request(m_request) File "/usr/lib/python2.7/site-packages/openvas_lib/common.py", line 378, in make_xml_request raise ValueError('Missing status property in response') ValueError: Missing status property in response

x7peeps commented 6 years ago

i have the same question. did u fixed this?

ksakthii001 commented 6 years ago

Hi,

I am able to recreate the problem. If we reference a port number that is already in use, we hit this problem. Please check below for errors.

$ sudo python openvas.py Traceback (most recent call last): File "openvas.py", line 35, in my_launch_scanner() File "openvas.py", line 19, in my_launch_scanner manager = VulnscanManager("localhost", "admin", "admin", 443) File "/home/ksakthii001/github/openvas_lib/openvas_lib/init.py", line 497, in init self.manager = get_connector(host, user, password, port, m_time_out, ssl_verify) File "/home/ksakthii001/github/openvas_lib/openvas_lib/common.py", line 73, in get_connector manager = ConnectionManager(host, username, password, port, timeout, ssl_verify) File "/home/ksakthii001/github/openvas_lib/openvas_lib/common.py", line 152, in init__ self._connect() File "/home/ksakthii001/github/openvas_lib/openvas_lib/common.py", line 203, in _connect self._authenticate(self.username, self.password) File "/home/ksakthii001/github/openvas_lib/openvas_lib/common.py", line 231, in _authenticate self.make_xml_request(m_request) File "/home/ksakthii001/github/openvas_lib/openvas_lib/common.py", line 381, in make_xml_request raise ValueError('Missing status property in response') ValueError: Missing status property in response

$ netstat -anp | grep LISTEN
tcp6 0 0 :::443 ::: LISTEN -
tcp6 0 0 :::9390 :::
LISTEN