面向python的oap(openvas管理协议)客户端接口
openvas.oaplib的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管理协议(oap)是基于xml的
与openvas管理员交谈。openvas.oaplib
是纯python
OAP的实现,它允许轻松访问
OpenVAS管理员。
这个包还包括一个命令行工具oap-cli
与openvas管理员交互。为了使用方便,这个工具
像svn或openssl那样使用子命令。
示例:
admin = openvas.oaplib.OAPClient(host=sensor) admin.open(username, password) admin.create_user(name, password, role, hosts) admin.modify_user(name, role="Admin") admin.sync_feed() # ... later ... settings = admin.get_settings() pprint.pprint(settings)
openvas.opmlib
还支持一个低级接口,您可以在其中发送
OAP XML直接:
help_text = admin.xml('<help/>')
用法示例:
oap-cli –help # get help oap-cli get-users –help # get help on subcommand get-users oap-cli create-user –new-pass xxx john oap-cli get-users john
要求和安装
openvas.oaplib
需要
- 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.oaplib. | |
Hints for installing on GNU/Linux: | |
Most current GNU/Linux distributions
provide packages for the requirements. Look for packages names like
^{ | |
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.oaplib
当你阅读这篇文章时,你很可能已经下载了
未打包openvas.oaplib
。因此安装和运行一样简单:
python ./setup.py install
否则,您可以使用setuptools/easy_install直接安装。如果
您的系统具有网络访问安装openvas.oaplib
是
微风:
easy_install openvas.oaplib
无网络访问下载openvas.oaplib
http://pypi.python.org/pypi/openvas.oaplib然后运行:
easy_install openvas.oaplib-*.tar.gz
安装setuptools的更多提示
openvas.oaplib
使用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.oaplib
只是一个脚本(也称为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.oaplib
。