面向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 ^{} and ^{}. Simply install them and continue with installing openvas.oaplib.

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.oaplibhttp://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

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java调用Python函数作为TEID中的UDF   java Android。支持v4导入不工作   java如何影响具有静态属性的类   java如何在从glTexImage2D()分配后编辑纹理的像素颜色   javaspringboot+rediscache+@Cacheable适用于某些方法,而不适用于其他方法   java无法将动态Web模块方面从3.0更改为2.5   java如何在新选项卡中显示打印的文档?   java Google Cloud Endpoints API方法仅在删除用户参数时成功调用   java为什么我可以使用Stack<Double>但不能使用Stack<Double>?   java JDBC PreparedStatement似乎忽略了占位符   java如何设置JInternalFrame的标准图标化位置?   Java文件。copy()不复制文件   基于另一个类的java显示arraylist?   java Android Studio:错误:非法字符:'\u2028'   对象(Java)无法实例化类型映像?   javascript错误:飞行前响应的HTTP状态代码401无效   java确保泛型vararg参数具有相同的类型