我正在探索 OpenVas 工具来满足项目需求,openVas 目前由 Greenbone 管理。当我尝试使用 python api 使用远程扫描仪时出现错误。
我完成了所有初始配置,设置了所需的 gui 帐户等,并且能够手动扫描所需的系统,但是当我尝试使用 Python Api 执行相同操作时,它不起作用。互联网上和手册中都没有任何示例来验证我的代码。我使用了 [ https://pypi.org/project/python-gvm/] api。
我写了简单的代码,但它不起作用..
from gvm.connections import SSHConnection
from gvm.protocols.latest import Gmp
from gvm.transforms import EtreeTransform
from gvm.xml import pretty_print
connection = SSHConnection(hostname='192.168.1.84',username='alex',password='alex@123')
gmp = Gmp(connection)
gmp.authenticate('admin', 'admin')
# Retrieve current GMP version
version = gmp.get_version()
# Prints the XML in beautiful form
pretty_print(version)
Run Code Online (Sandbox Code Playgroud)
我收到错误-
/usr/bin/python3.7 /home/punshi/PycharmProjects/nessus_api/openvas-greenbone.py
/usr/local/lib/python3.7/dist-packages/paramiko/kex_ecdh_nist.py:39: CryptographyDeprecationWarning: encode_point has been deprecated on EllipticCurvePublicNumbers and will be removed in a future version. Please use …Run Code Online (Sandbox Code Playgroud)