如何使用CVE Binary Tool:快速发现软件漏洞的终极指南 ️

如何使用CVE Binary Tool:快速发现软件漏洞的终极指南 🛡️

【免费下载链接】cve-bin-tool The CVE Binary Tool helps you determine if your system includes known vulnerabilities. You can scan binaries for over 200 common, vulnerable components (openssl, libpng, libxml2, expat and others), or if you know the components used, you can get a list of known vulnerabilities associated with an SBOM or a list of components and versions. 【免费下载链接】cve-bin-tool 项目地址: https://gitcode.com/gh_mirrors/cv/cve-bin-tool

CVE Binary Tool是一款免费开源的漏洞扫描工具,能够帮助你检测软件中已知的安全漏洞。它通过扫描二进制文件或SBOM(软件物料清单),识别超过400种常见的易受攻击组件(如openssl、libpng、libxml2等),并提供详细的漏洞报告。无论是集成到CI流程还是手动扫描,它都能为你的供应链安全提供早期预警。

🚀 快速安装:3种简单方法

使用pip一键安装

最推荐的安装方式是通过Python包管理器pip:

pip install cve-bin-tool

如需PDF报告功能,可安装扩展版本:

pip install cve-bin-tool[PDF]

从源码仓库安装

如果你需要最新开发版本,可以直接从Git仓库安装:

git clone https://gitcode.com/gh_mirrors/cv/cve-bin-tool
cd cve-bin-tool
pip install --user -e .

验证安装

安装完成后,通过以下命令验证版本:

cve-bin-tool -V

🔍 核心功能:不止于漏洞扫描

二进制文件扫描(最常用)

对目录或文件进行深度扫描,自动识别其中包含的组件及版本:

cve-bin-tool /path/to/your/software

提示:扫描时会自动调用语言特定检查器(如Python的requirements.txt解析器),无需额外配置。

SBOM文件扫描与生成

扫描现有SBOM

支持SPDX、CycloneDX和SWID格式的SBOM文件:

cve-bin-tool --sbom SPDX --sbom-file your_sbom.spdx.json
生成SBOM报告

从扫描结果直接生成标准化SBOM:

cve-bin-tool /path/to/scan --sbom-type CycloneDX --sbom-format json --sbom-output my_sbom.json

详细指南:doc/how_to_guides/sbom_generation.md

VEX报告生成与使用

生成漏洞状态交换报告(VEX)记录已处理的漏洞:

cve-bin-tool /path/to/scan --vex-type OpenVEX --vex-output my_vex.json

下次扫描时可导入VEX文件跳过已处理漏洞:

cve-bin-tool /path/to/scan --vex-file my_vex.json

📊 实用操作指南

自定义输出格式与报告

支持多种输出格式,可同时生成多个报告:

cve-bin-tool /path/to/scan --format csv,html,pdf --output-file security_report

生成的报告类型包括:

  • CSV:适合电子表格分析
  • HTML:交互式网页报告(支持过滤和高亮)
  • JSON:便于自动化处理
  • PDF:适合离线分享

CVE Binary Tool HTML报告预览 CVE Binary Tool生成的HTML报告示例,包含漏洞详情和过滤功能

扫描Docker镜像的两种方法

方法1:在容器内直接扫描
  1. 创建并进入容器:
docker run -it -d --name cve_scan ubuntu --entrypoint bash
docker exec -it cve_scan bash
  1. 在容器内安装工具并扫描:
apt-get update && apt-get install python3-pip -y
pip3 install cve-bin-tool
cve-bin-tool /usr/bin -f csv -o usr_bin_cve.csv
  1. 导出报告到主机:
docker cp cve_scan:~/usr_bin_cve.csv ~/Documents/
方法2:导出容器目录到主机扫描
docker cp cve_scan:/usr/bin/ ~/scan_dir
cve-bin-tool ~/scan_dir --format html --output-file docker_scan_report

详细步骤:doc/how_to_guides/scan_docker_image.md

离线模式使用技巧

在无网络环境下使用需提前下载漏洞数据库:

  1. 联网时更新数据库:
cve-bin-tool --update-db
  1. 离线扫描时添加--offline参数:
cve-bin-tool /path/to/scan --offline

数据库默认存储路径:~/.cache/cve-bin-tool/

🛠️ 高级配置与优化

使用配置文件保存常用选项

创建JSON配置文件(如scan_config.json):

{
  "format": "html",
  "output_file": "report",
  "exclude": ["test/*", "docs/*"]
}

使用配置文件扫描:

cve-bin-tool /path/to/scan --config scan_config.json

配置文件示例:test/config/

集成到CI/CD流程

在GitHub Actions中添加扫描步骤:

- name: Run CVE Binary Tool
  uses: intel/cve-bin-tool-action@main
  with:
    path: ./build
    format: html
    output-file: cve_report.html

📚 技术细节与资源

支持的组件检查器

工具内置433种组件检查器,覆盖主流开源库:

  • 加密库:openssl、wolfssl、mbedtls
  • 压缩工具:zlib、bzip2、xz
  • 网络工具:curl、nginx、apache_http_server
  • 数据库:sqlite、mariadb、redis

完整列表:cve_bin_tool/checkers/

工作原理图解

CVE Binary Tool工作流程 工具工作流程:1. 下载漏洞数据 2. 识别组件 3. 匹配漏洞 4. 生成报告

官方文档与资源

❓ 常见问题解决

扫描速度慢?

  • 首次运行会下载完整漏洞数据库(约500MB),后续每天自动增量更新
  • 使用--quick参数跳过版本猜测,仅使用精确匹配

误报处理?

  1. 生成VEX文件记录误报:
cve-bin-tool /path/to/scan --vex-output triage.json
  1. 编辑triage.json标记误报漏洞状态
  2. 下次扫描导入该文件:
cve-bin-tool /path/to/scan --vex-file triage.json

支持的操作系统?

  • Linux:完全支持所有功能
  • Windows:需安装额外依赖(7z、MinGW等)
  • macOS:部分功能受限,建议使用Docker方式

通过CVE Binary Tool,你可以轻松将漏洞扫描融入开发流程,及时发现并修复潜在风险。无论是个人开发者还是企业团队,这款工具都能为你的软件供应链安全保驾护航!🔒

更多高级功能请参考官方文档:doc/

【免费下载链接】cve-bin-tool The CVE Binary Tool helps you determine if your system includes known vulnerabilities. You can scan binaries for over 200 common, vulnerable components (openssl, libpng, libxml2, expat and others), or if you know the components used, you can get a list of known vulnerabilities associated with an SBOM or a list of components and versions. 【免费下载链接】cve-bin-tool 项目地址: https://gitcode.com/gh_mirrors/cv/cve-bin-tool

创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值