面向python的omp(openvas管理协议)客户端接口
openvas.omplib的Python项目详细描述
Author: | Hartmut Goebel <h.goebel@goebel-consult.de> |
---|---|
Version: | Version 0.1.0 |
Copyright: | GNU Public Licence v3 (GPLv3) |
Homepage: | http://www.openvas.org/ |
OpenVAS(开放式漏洞评估系统)是一种网络安全 带有相关工具的扫描仪。OpenVAS版本3引入了一个新的核心 组件:openvas管理器,在openvas扫描仪和 各种客户端应用程序,如openvas客户端或greenbone 保安助理。在其他特性中,它添加了服务器端存储 它使得扫描客户端不必保存 连接打开,直到扫描完成。
openvas管理协议(omp)是一种基于xml的会话协议。 致openvas管理器。openvas.omplib是一个纯python OMP的实现,它允许轻松访问OpenVAS管理器。
这个包还包括一个命令行工具 与openvas管理器交互。为便于使用,此工具使用 子命令非常类似于svn或openssl。
示例:
manager = openvas.omplib.OMPClient(host=sensor) manager.open(username, password) manager.create_target(job_name, targets, comment) task_id = manager.create_task(job_name, comment, config=config_name, target=job_name) report_id = manager.start_task(task_id) # ... later ... report = manager.get_report(report_id) print etree.tostring(report)
openvas.opmlib还支持一个低级接口,您可以在其中发送 OMP XML直接:
help_text = manager.xml('<help/>')
omp cli用法示例:
omp-cli --help # get help omp-cli get-report --help # get help on subcommand get-report omp-cli get-status # list tasks with stati and report-ids # Retreive a report in PDF format omp-cli get-report -fPDF 343435d6-91b0-11de-9478-ffd71f4c6f30 \ -o some-report.pdf
要求和安装
openvas.omplib需要
- Python 2.5或更高版本,支持ssl(应该是
- 大多数平台上的默认值(注意:python 3.x不支持)
- setuptools用于安装(见下文)。
- argparse(已经包含在从python 2.7开始的python中)
Hints for installing on Windows: | |
---|---|
Following the links above you will find .msi and .exe-installers. Simply install them and continue with installing openvas.omplib. | |
Hints for installing on GNU/Linux: | |
Most current GNU/Linux distributions provide packages for the requirements. Look for packages names like python-setuptools and python-argparse. Simply install them and continue with installing openvas.omplib. | |
Hint for installing on other platforms: | |
Many vendors provide Python. Please check your vendors software repository. Otherwise please download Python 2.6 (or any higer version from the 2.x series) from http://www.python.org/download/ and follow the installation instructions there. After installing Python, install setuptools. You may want to read More Hints on Installing setuptools first. |
Using setuptools, compiling and installing the remaining requirements is a piece of cake:
# if the system has network access easy_install argparse # without network access download argparse # from http://pypi.python.org/pypi/argparse and run easy_install argparse-*.zip
安装openvas.omplib
当你阅读这篇文章时,你很可能已经下载了 打开openvas.omplib。因此安装和运行一样简单:
python ./setup.py install
否则,您可以使用setuptools/easy_install直接安装。如果 您的系统有网络访问安装openvas.omplib 微风:
easy_install openvas.omplib
无网络访问下载 http://pypi.python.org/pypi/openvas.omplib然后运行:
easy_install openvas.omplib-*.tar.gz
安装setuptools的更多提示
openvas.omplib使用setuptools进行安装。所以你需要 或者
- network access, so the install script will automatically download and install setuptools if they are not already installed
或
- the correct version of setuptools preinstalled using the EasyInstall installation instructions. Those instructions also have tips for dealing with firewalls as well as how to manually download and install setuptools.
自定义安装位置
openvas.omplib只是一个脚本(也称为python程序)。所以你可以 把它复制到你想要的地方(也许固定第一行)。但是 易于使用:
# install to /usr/local/bin python ./setup.py install --prefix /usr/local # install to your Home directory (~/bin) python ./setup.py install --home ~
请注意:这也会影响argparse(和 如果尚未安装。
有关自定义安装位置的详细信息,请参阅 到前面的Custom Installation Locations Instructions 正在安装openvas.omplib。