我跟着https://pypi.python.org/pypi/openvas.omplib#installing-openvas-omplib没有运气。以下是他们建议的代码(我使用过):
from openvas.omplib import *
manager = openvas.omplib.OMPClient(host = sensor)
manager.open(USER,PASSWORD)
我收到以下错误:
Traceback (most recent call last):
File "test.py", line 5, in <module>
manager = openvas.omplib.OMPClient(host=sensor)
NameError: name = 'openvas' is not defined
似乎该库未正确安装或安装不全。要安装,我运行:
easy_install openvas.omplib
有任何想法吗?
我也尝试过 Openvas_lib 1.0(另一种形式)。这也遇到了错误。(是的,我将变量设置为某些东西)
from openvas_lib import VulnscanManager, VulnscanException
scan = VulnscanManager("localhost",USER,PASSWORD,9392)
scan.launch_scan(target,profile="empty")