将openvas xml转换为报表的工具。

OpenVAS-Reporting的Python项目详细描述


OpenVAS报告:

GitHub versionLicenseDocsKnown VulnerabilitiescodecovRequirements StatusPyPI - VersionPyPI - Format

OpenVASxml转换为报表的工具。

Report example screenshot

阅读https://openvas-reporting.stijncrevits.be

上的完整文档

我分叉OpenVAS2Report因为它无法转换我向它抛出的所有报告 因为我想学习如何使用python处理xml和创建excel文件。
另外,openvas将自己的威胁级别与CVSS评分混合在一起,后者我更喜欢在我的报告中使用。

寻找修复并通过拉取请求提供实际修复将是太多的工作, 所以我选择放弃回购,尝试我自己的东西。
我重新组织了一些文件,删除了一些功能,添加了一些额外的功能,并重写了一些功能。

此时,脚本只输出一种格式的.xlsx文档,这在将来可能(不会)改变。

要求

安装

# install requirements
apt(-get) install python3 python3-pip # Debian, Ubuntu
yum -y install python3 python3-pip    # CentOS
dnf install python3 python3-pip       # Fedora
pip3 install -r requirements.txt
# clone repo
git clone git@github.com:TheGroundZero/openvas_to_report.git

或者,您可以通过python包安装程序pip安装包。

# Install pip
apt(-get) install python3 python3-pip # Debian, Ubuntu
yum -y install python3 python3-pip    # CentOS
dnf install python3 python3-pip       # Fedora
# Install the package
pip install OpenVAS-Reporting

用法

# When working from the Git repo
python3 -m openvasreporting -i [OpenVAS xml file(s)] [-o [Output file]] [-f [Output format]] [-l [minimal threat level (n, l, m, h, c)]] [-f [docx template]]
# When using the pip package
OpenVAS-Reporting -i [OpenVAS xml file(s)] [-o [Output file]] [-f [Output format]] [-l [minimal threat level (n, l, m, h, c)]] [-f [docx template]]

参数

Short paramLong paramDescriptionRequiredDefault value
-i--inputInput file(s)YESn/a
-o--outputOutput filenameNoopenvas_report
-f--formatOutput formatNoxlsx
-l--levelMinimal levelNon
-t--templateDocx templateNoopenvasreporting/src/openvas-template.docx

示例

使用默认设置从1个openvas xml报表创建excel报表

python3 -m openvasreporting -i openvasreport.xml -f xlsx

使用默认设置从多个openvas报表创建excel报表

# wildcard select
python3 -m openvasreporting -i *.xml -f xlsx
# selective
python3 -m openvasreporting -i openvasreport1.xml -i openvasreport2.xml -f xlsx

从多个openvas报告创建word报告,仅报告高级别和更高级别的威胁,使用自定义模板

python3 -m openvasreporting -i *.xml -o docxreport -f docx -l h -t "/home/user/myOpenvasTemplate.docx"

结果

最终报告(excel格式)将如下所示:

Report example screenshot - SummaryReport example screenshot - ToCReport example screenshot - Vuln desc

工作表根据CVSS分数排序,并根据漏洞级别着色。

想法

对于未来的功能,我还有一些想法:

  • 列出每个主机的漏洞
  • 按主机筛选(作用域/排除),如openvas2report中所示
  • 单独选择威胁等级(例如无和低;但不选择中、高和暴击)
  • 导入其他格式(不仅仅是xml),例如csv,如this issue

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

推荐PyPI第三方库


热门话题
java通过Spring MVC web应用程序向客户端发送文本文件   java是否可以在运行时动态实例化DAO类?   调用VB。来自Java的net函数   java在Android中通过单击打开特定文件夹   java如何使用maven pom。xml标识非标准项目结构中的testng测试用例?   java为什么FOP在大文件上崩溃?   Architecture python+flask和spring boot+java   java Kafka工具根本没有启动Ubuntu 19.10   如何使用Eclipse运行Java USB API for Windows   java如何在Eclipse中查看J2EE预览服务器/容器的日志/控制台?   网页抓取是否可以使用Java crawler crawler4j暂停和恢复抓取?   java当我第二次按下按钮时,应用程序停止工作   带有偏移量和限制的java SQLite分页问题   java如何在OSX mavericks中将端口80转发到8080   java从泛型方法调用非泛型方法   java My代码未按预期工作。十进制输出不是它应该的样子   节点。java中的js加密(jasypt)和nodejs中的解密   java乘法表不工作数组索引超出范围   java将JDBC与Firebirdsql连接起来