openvas在centos中扫描单项的python实现
使用gvm_cli命令来实现
先创建一个空的配置
copy_id = '085569ce-73ed-11df-83c3-002264764cea'
new_config = '''
<create_config>
<copy>{}</copy>
<name>{}</name>
</create_config>
'''.format(copy_id,target_name)
gvm-cli socket --sockpath /var/run/gvmd.sock --gmp-username usr --gmp-password 'pass' -xml new_config
再往配置里面修改添加需要扫描的项的oid和所属的family
modify_config = <modify_config config_id="{}">
<nvt_selection>
<family>Web Servers</family>
<nvt oid="{}"/>
<family>Denial of Service</family>
<nvt oid="{}"/>
<family>General</family>
<nvt oid="{}"/>
</nvt_selection>
</modify_config>
gvm-cli socket --sockpath /var/run/gvmd.sock --gmp-username usr --gmp-password 'pass' -xml modify_config
最后添加两个必须得基础项 ping,nasl namp.nasl
oid1 = '1.3.6.1.4.1.25623.1.0.14259'
oid2 = '1.3.6.1.4.1.25623.1.0.100315'
modify_config = '''
<modify_config config_id="{}">
<nvt_selection>
<family>Port scanners</family>
<nvt oid="{}"/>
<nvt oid="{}"/>
</nvt_selection>
</modify_config>
'''.format(config_id, oid1, oid2)
gvm-cli socket --sockpath /var/run/gvmd.sock --gmp-username usr --gmp-password 'pass' -xml modify_config
官网链接 https://docs.greenbone.net/API/GMP/gmp-7.0.html#command_modify_config
还有两个博客也是这方面的知识
https://github.com/greenbone/gvm-tools/blob/master/scripts/start-nvt-scan.gmp.py
openvas在centos中扫描单项的python实现的更多相关文章
- centos中从源程序升级python方法
http://www.cnblogs.com/sky20081816/p/3441920.html 1 .wget http://python.org/ftp/python/2.7.3/Python- ...
- 记在centos中连接无线网络的一次过程
1. 首先, 你的系统要能驱动无限网卡, 要是人品好的话, 系统已经自带了你的网卡的驱动程序. 不然就要先搞定无线网卡的驱动再说. 不然后面的步骤也就没必要了. 2. 看一下你的无线网卡叫什么: iw ...
- CentOS中输入yum报错:sudo: unable to execute /bin/yum: No such file or directory
今天尝试更新了下虚拟机CentOS中的python版本后. 运行“yum”命令,就报错:“sudo: unable to execute /bin/yum: No such file or direc ...
- 在CentOS 6.X 上面安装 Python 2.7.X
在CentOS 6.X 上面安装 Python 2.7.X CentOS 6.X 自带的python版本是 2.6 , 由于工作需要,很多时候需要2.7版本.所以需要进行版本升级.由于一些系统工具和服 ...
- centos中忘记root密码问题
centos中root密码问题 几次在虚拟机中安装cenos,都没有提示输入root密码,具体操作如下: 1.在启动的时候,进入启动界面后,按除了Enter键之外的任意键,即可进入该界面.然后 按 ...
- 在新安装的Centos中安装python3.7 解决pip和yum问题
首先要先安装依赖包: yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-deve ...
- centos中yum命令删除还原的补救方法介绍
前言 yum,是Yellow dog Updater Modified的简称,起初是由yellow dog这一发行版的开发者Terra Soft研发,用python写成,那时还叫做yup(yellow ...
- [转]在Linux CentOS 6.6上安装Python 2.7.9
在Linux CentOS 6.6上安装Python 2.7.9 查看python安装版本 python -V yum中最新的也是Python 2.6.6,所以只能下载Python 2.7.9的源代码 ...
- CentOS 中卸载 RPM 包文件
CentOS 中卸载 RPM 包文件 一.原由 因为之前卸载 openvas 这个工具,使用了 find / -name "openvas"-exec rm -rf {} \ ; ...
- 案例3-ubuntu和centos中自动部署tomcat相关服务的脚本
涉及redis,mysql,xtrabackup, tomcat 1. ubuntu中 #!/bin/bash #first, change to root #出错立刻中断 set -e apt-ge ...
随机推荐
- 分治-1-归并排序(Divide and Conquer-1-merge sort)
#include <stdio.h> #define INFINITY 999999 #define LEN(A) ((sizeof (A)) / (sizeof A[0])) void ...
- office365启动突然提示注册表错误,无法打开“规则”配置的解决方案
感觉目前网上的资料,暂无清晰的解答,根据现象分析是outlook的原始邮件文件即psd文件中的规则相关字段存在问题,导致outlook无法打开. 因此网上的各种答疑如重装,调整注册表等等措施都是无效的 ...
- YieldReturn语法解析
/* * * 学习Yield Return 语法 * 使用两个方法,显示1 - 100之间的全部偶数 * * */ using System;using System.Collections.Gene ...
- shell转义字符
\n 回车 \b 单词边界 \w [a-Z0-9]中任意一个字符 \W [^a-Z0-9] \d [0-9]中任意一个数字 \D [^0-9 ...
- RPS网卡多队列
一体机上传1G文件导致服务器很卡,怀疑是网卡未开启多核多队列导致. 脚本如下 #!/bin/bash # Enable RPS (Receive Packet Steering) read -p &q ...
- Qt excel操作相关
#include <QDebug> #include <QAxObject> #include <QStandardPaths> #include <QFil ...
- div+css CSS基本
• css 高度(height) • css 宽度(width) · • css 边框(border) · • css 背景(background) · • css 浮动(floa ...
- Bug_Android error: duplicate attribute. (错误:重复属性。)
error: duplicate attribute. 错误:重复属性. 如报错信息提示,属性重复赋值了 场景:刚拿到项目源码,进行修改前,先设置它的背景色,区分是哪一块内容,但没看到组件已定义了背景 ...
- spring-boot 引入redis
1.引入redis <dependency> <groupId>org.springframework.boot</groupId> <artifactId& ...
- No.1.3
CSS层叠样式表 /* css注释 */ CSS引入方式 内嵌式:CSS写在style标签中 提示:style标签虽然可以写在页面任意位置,但是通常约定写在 head 标签中(作用范围:当前页面: ...