Sentinel-Atlas/amihit

GitHub: Sentinel-Atlas/amihit

一款 CVE 影响分析器,通过可达性分析、污点追踪和暴露面映射来判断漏洞是否真正可被利用,帮助团队从海量告警中筛选出需要优先处理的真实威胁。

Stars: 0 | Forks: 0

# amihit **我被命中了吗? -- CVE 影响分析器** [![Go](https://img.shields.io/badge/Go-1.26+-00ADD8?logo=go&logoColor=white)](https://go.dev) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE) [![Release](https://img.shields.io/github/v/release/amihit/amihit?include_prereleases)](https://github.com/Sentinel-Atlas/amihit/releases) 其他扫描器告诉你什么是存在漏洞的。amihit 告诉你什么才是**可利用的**。 唯一能够运行完整链路的开源工具:CVE 检测、函数可达性分析、污点分析、暴露面映射,以及可利用性裁定——全面覆盖代码库、网站、网络和容器。 ## 问题所在 CVE 扫描器会产生大量噪音。一次典型的扫描会返回数百个警报,但其中 **90% 以上在你的环境中实际上是不可利用的**。存在漏洞的函数从未被调用,用户输入永远无法到达该函数,或者该端点并未暴露在网络中。 团队浪费数小时去处理无关紧要的警报,而真正的风险却隐藏在这些信息堆中。 ## amihit 的不同之处 amihit 针对其发现的每一个 CVE 运行裁定引擎。它不会停留在“你存在易受攻击的依赖项”,而是回答那个真正重要的问题:**攻击者能够利用这个漏洞吗?** ``` CVE Detected | v Reachability Analysis ---- Is the vulnerable function called by your code? | v Taint Analysis ----------- Does user-controlled input reach it? | v Exposure Mapping --------- Is it reachable from the network/internet? | v Exploitability Verdict | +---> EXPLOITABLE -- Fix immediately +---> REACHABLE ---- Investigate +---> NOISE -------- Ignore safely ``` 每一项发现都会得到一个裁定结论。告别盲目猜测。 ## 快速开始 ### 安装 **Go install:** ``` go install github.com/Sentinel-Atlas/amihit@latest ``` **二进制文件下载:** 从 [GitHub Releases](https://github.com/Sentinel-Atlas/amihit/releases) 下载最新版本。提供适用于 Linux、macOS 和 Windows (amd64 和 arm64) 的二进制文件。 ``` # Linux / macOS tar xzf amihit_*_linux_amd64.tar.gz sudo mv amihit /usr/local/bin/ # Windows — 解压 zip 并添加到 PATH ``` **从源码构建:** ``` git clone https://github.com/Sentinel-Atlas/amihit.git cd amihit make build ``` ### 基本用法 ``` amihit scan . amihit cve CVE-2026-31337 ``` ## 扫描类型 ### 代码库 跨 7 个生态系统检测依赖项,将其与 CVE 数据库进行匹配,然后运行可达性、污点和暴露面分析以生成裁定结果。 ``` amihit scan . amihit scan /path/to/project amihit scan . --severity critical,high ``` ### 网站 识别服务器技术、JavaScript 库、CMS 平台、安全响应头和 TLS 配置的指纹。将检测到的版本与 CVE 数据库进行匹配。 ``` amihit scan https://example.com ``` ### 网络 端口扫描、通过 banner 抓取进行服务指纹识别,以及对发现的服务进行 CVE 匹配。可选检查常见服务的默认凭据。 ``` amihit scan 192.168.1.0/24 amihit scan 10.0.0.5 amihit scan 192.168.1.0/24 --creds ``` ### 容器 当在目标目录中找到 Dockerfile 时自动运行。解析 Dockerfile,识别基础镜像,检测配置错误,并检查镜像级别的 CVE。 ``` amihit scan . --full ``` ### 全面扫描 在一次执行中结合代码库、容器、网站和网络扫描。 ``` amihit scan . --full ``` ## 输出格式 通过 `--output` 标志可以使用五种输出格式。 **终端**(默认)—— 带有调用点、输入流、暴露路径和修复版本的彩色裁定结果: ``` amihit scan . ``` **JSON** —— 用于脚本和仪表盘的结构化输出: ``` amihit scan . --output json ``` **SARIF** —— 用于 GitHub Code Scanning、VS Code SARIF Viewer 和其他安全工具的标准格式: ``` amihit scan . --output sarif > results.sarif ``` **CycloneDX** —— 嵌入了漏洞数据的 SBOM: ``` amihit scan . --output cyclonedx > sbom.cdx.json ``` **SPDX** —— 软件物料清单: ``` amihit scan . --output spdx > sbom.spdx.json ``` ## CI/CD 集成 ### 基于严重性失败 当发现结果达到严重性阈值时,使用 `--fail-on` 来中断构建。退出码 2 表示违反了安全策略。 ``` amihit scan . --fail-on critical,high ``` ### 退出码 | 代码 | 含义 | |------|---------| | 0 | 扫描完成,未违反策略 | | 1 | 扫描错误 | | 2 | 违反策略(触发了 `--fail-on`) | | 130 | 被中断 (Ctrl+C) | ### GitHub Actions ``` - name: Install amihit run: go install github.com/Sentinel-Atlas/amihit@latest - name: CVE Scan run: amihit scan . --output sarif --fail-on critical,high > results.sarif - name: Upload SARIF if: always() uses: github/codeql-action/upload-sarif@v3 with: sarif_file: results.sarif ``` ### GitLab CI ``` security_scan: script: - go install github.com/Sentinel-Atlas/amihit@latest - amihit scan . --fail-on critical,high --output json > amihit-report.json artifacts: reports: security: amihit-report.json ``` ## CVE 查询 查询特定的 CVE,根据你的代码库进行检查,或查询最近的漏洞披露。 ``` # 查询 CVE amihit cve CVE-2026-31337 # 检查特定项目 amihit cve CVE-2026-31337 --target /path/to/project # 验证修复是否已应用 amihit cve CVE-2026-31337 --verify --target . # 检查多个 CVE amihit cve CVE-2026-1111 CVE-2026-2222 # 特定日期以来的最新 CVE amihit cve --since 2026-03-25 # 按严重程度过滤 amihit cve --since 2026-03-25 --severity critical,high # JSON 输出 amihit cve CVE-2026-31337 --output json ``` ## CVE 数据源 amihit 汇总了来自五个漏洞数据库的数据,以实现最大范围的覆盖。 | 来源 | 提供的内容 | |--------|-----------------| | **[OSV](https://osv.dev/)** | 跨所有生态系统的开源包精确受影响版本范围。通过批量 API 进行依赖项 CVE 匹配的主要来源。 | | **[NVD](https://nvd.nist.gov/)** | 来自 NIST 的 CVSS 评分、严重性评级、CPE 匹配和权威的 CVE 元数据。 | | **[GHSA](https://github.com/advisories)** | 带有修复版本的精选安全公告。对 npm、pip、Go、Maven 和 RubyGems 具有出色的覆盖率。 | | **[CISA KEV](https://www.cisa.gov/known-exploited-vulnerabilities-catalog)** | 已知被利用的漏洞目录。已被确认在野外被积极利用的 CVE。 | | **[ExploitDB](https://exploit-db.com/)** | 公开漏洞利用数据库。指示是否存在概念验证或可用的漏洞利用程序。 | ## 架构 ``` amihit/ ├── cmd/ CLI layer (cobra) │ ├── root.go Global flags, banner, help template │ ├── scan.go Scan command, target type routing │ ├── cve.go CVE lookup, --verify, --since │ └── version.go Version (injected by goreleaser) │ ├── internal/ │ ├── cache/ Local CVE data cache (disk-backed) │ ├── config/ Config loading (.amihit.yaml, env vars) │ ├── cve/ CVE aggregator, source clients, data types │ ├── intel/ Cross-layer correlation engine │ ├── matcher/ Version range matching and comparison │ ├── output/ Formatters: terminal, JSON, SARIF, CycloneDX, SPDX │ ├── scanner/ │ │ ├── codebase.go Dependency extraction orchestrator │ │ ├── deps/ Lock file parsers (npm, pip, go.sum, pom.xml, etc.) │ │ ├── reachability/ Call graph analysis, function reachability │ │ ├── taint/ Taint analysis, user input tracking │ │ ├── exposure/ Network exposure mapping │ │ ├── container/ Dockerfile parsing, base image CVE checks │ │ ├── network/ Port scanning, service fingerprinting │ │ └── website/ Tech fingerprinting, headers, TLS │ └── verdict/ Exploitability verdict engine │ ├── main.go Entry point, signal handling, exit codes ├── Makefile build, test, test-cover, lint, install └── .goreleaser.yml Cross-platform release builds ``` ## 配置 ### 配置文件 在你的项目根目录或主目录中创建 `.amihit.yaml`。 ``` nvd_api_key: "" github_token: "" cache_dir: ~/.amihit cache_ttl_hrs: 24 ``` ### 环境变量 | 变量 | 描述 | |----------|-------------| | `NVD_API_KEY` | 用于提高速率限制的 NVD API 密钥(30 秒内从 5 次请求提升至 50 次)。可在 [nvd.nist.gov](https://nvd.nist.gov/developers/request-an-api-key) 免费获取。 | | `GITHUB_TOKEN` | 用于经身份验证的 GHSA 访问的 GitHub 个人访问令牌(每小时从 60 次请求提升至 5000 次)。 | ### 命令行标志参考 ``` Global Flags: -o, --output string Output format: terminal, json, sarif, cyclonedx, spdx (default "terminal") --severity strings Filter by severity: critical, high, medium, low --fail-on strings Exit code 2 if findings match severity (CI gate) -q, --quiet Suppress banner and progress output --no-color Disable colored output -v, --verbose Verbose output for debugging Scan Flags: --full Run all scan types (codebase + containers + servers) --creds Check for default/no-auth credentials on discovered services CVE Flags: --target string Target to check against (default ".") --verify Verify that a CVE is patched after applying a fix --since string Check all CVEs published since date (YYYY-MM-DD) ``` ## 支持的生态系统 | 生态系统 | Lock 文件 | |-----------|-----------| | npm | package-lock.json, yarn.lock, package.json | | PyPI | requirements.txt, Pipfile.lock, poetry.lock | | Go | go.mod, go.sum | | Maven | pom.xml | | Cargo | Cargo.lock | | RubyGems | Gemfile.lock | | Composer | composer.lock | ## 许可证 [MIT](LICENSE)
标签:CVE影响分析, EVTX分析, Go语言, GPT, Web截图, 代码安全审计, 加密, 可达性分析, 安全警报分诊, 容器安全, 密码管理, 开源安全工具, 攻击面评估, 无线安全, 日志审计, 暴露面映射, 漏洞可利用性分析, 漏洞扫描器, 漏洞管理, 程序破解, 网络安全, 网络资产扫描, 请求拦截, 逆向工程平台, 隐私保护