将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如何使用从PreparedStatement返回的RowId。getGeneratedKeys()?   selenium chrome驱动程序中下一个网站url的java空白页   java如何将参数化匿名类转换为lambda?   java JUnit在AfterClass上获取测试结果   java将动态XML/JSON内容与静态标记化负载进行比较,并检索标记值   java共享一个需要数据持久性的项目[数据库]   java在调用方法时获取意外的参数类型。getParameterTypes()   java如何用jdbc在swing中用另一个字段替换外键?   需要java Jersey Tomcat CDI依赖项解释   java如何生成UML图   java如何编写Jersey rest服务可以通过给定的spring代码访问   SpringMaven存储库管理器Nexus与Java依赖项的Artifactory   java将包从另一个项目导入eclipse中的当前项目   加密Java使用密码加密文件