rfc-st/humble
GitHub: rfc-st/humble
一款快速、全面的 HTTP 安全响应头分析工具,支持缺失头检测、指纹识别、OWASP 合规审计和多格式报告导出。
Stars: 354 | Forks: 28
humble
一个谦逊且快速的、面向安全的 HTTP headers 分析器
"千里之行,始於足下 - 老子"
("A journey of a thousand miles begins with a single step. - Lao Tzu")
"And if you don't keep your feet, there's no knowing where you might be swept off to. - Bilbo Baggins"
### 目录
[功能特性](#features)
[截图](#screenshots)
[安装与更新(源代码)](#installation--update-source-code)
[安装与维护(Docker)](#installation--maintenance-docker)
[安装与更新(Kali Linux)](#installation--update-kali-linux)
[用法](#usage)
[进阶用法(Linux)](#advanced-usage-linux)
[单元测试](#unit-tests)
[质量、风格与安全工具](#quality-style-and-security-tools)
[检查:缺失的 Headers](#checks-missing-headers)
[检查:指纹 Headers](#checks-fingerprint-headers)
[检查:已弃用的 Headers 和不安全的值](#checks-deprecated-headersprotocols-and-insecure-values)
[检查:空值](#checks-empty-values)
[包含的指南](#guidelines-included-to-enable-security-http-headers)
[待办事项](#to-do)
[延伸阅读](#further-reading)
[贡献](#contribute)
[致谢](#acknowledgements)
[许可证](#license)
## 功能特性
:heavy_check_mark: 涵盖 62 个[已启用](#checks-enabled-headers)的安全相关 HTTP response headers。
:heavy_check_mark: 15 项针对缺失的安全相关 HTTP response headers 的[检查](#checks-missing-headers)(我认为是必不可少的)。
:heavy_check_mark: 1255 项通过 HTTP response headers 进行指纹识别的[检查](#checks-fingerprint-headers)。
:heavy_check_mark: 158 项针对已弃用的 HTTP response headers/协议或具有不安全/错误值的[检查](#checks-deprecated-headersprotocols-and-insecure-values)。
:heavy_check_mark: 28 项与 Content Security Policy [Level 3](https://www.w3.org/TR/CSP3/) 相关的[检查](https://github.com/rfc-st/humble/blob/master/additional/insecure.txt#L46-L73)。
:heavy_check_mark: 可以检查是否符合 OWASP Secure Headers Project 最佳实践。
:heavy_check_mark: 可以从分析中排除特定的 HTTP response headers。
:heavy_check_mark: 可以分析 _原始响应文件_:包含 HTTP response headers 和值的文本文件。例如:curl 选项 '--dump-header'。
:heavy_check_mark: 可以将每次分析导出为 CSV、CSS3 & HTML5、JSON、PDF、TXT、XLSX (Excel 2007 及更高版本) 和 XML;并支持您选择的文件名和路径。
:heavy_check_mark: 可以检查过时的 SSL/TLS 协议和漏洞:需要 **强大** 的 testssl.sh。
:heavy_check_mark: 可以提供简要和详细的分析以及 HTTP response headers。
:heavy_check_mark: 可以在分析中使用代理。
:heavy_check_mark: 允许指定自定义 HTTP request headers。
:heavy_check_mark: 可以仅输出分析摘要、总计和评级为 JSON;适用于 CI/CD。
:heavy_check_mark: 打印已启用的 HTTP 安全 headers 的浏览器支持情况,数据来自 Can I use。
:heavy_check_mark: 在每次分析中高亮显示实验性 headers。
:heavy_check_mark: 根据每次分析提供数百个指向安全资源、标准和技术博客的相关链接。
:heavy_check_mark: 支持以英语或西班牙语显示分析、消息和大多数错误。
:heavy_check_mark: 保存每次分析,并高亮显示与上一次相比的改进或不足。
:heavy_check_mark: 可以显示特定 URL 或所有 URL 的分析统计数据。
:heavy_check_mark: 可以显示特定术语或前 20 名的指纹统计数据。
:heavy_check_mark: 可以显示在流行框架、服务器和服务上启用安全 HTTP response headers 的指南。
:heavy_check_mark: 提供数十个[单元测试](#unit-tests)以验证与您环境的兼容性;需要 pytest 和 pytest-cov。
:heavy_check_mark: 类和函数文档位于 Read the Docs。
:heavy_check_mark: 代码定期接受多种质量、风格和安全[工具](#quality-style-and-security-tools)的审计。
:heavy_check_mark: 在数千个 URL 上逐一测试。
:heavy_check_mark: 在 Docker 26.1、Kali Linux 2021.1、macOS 14.2.1 和 Windows 10 20H2 上测试。
:heavy_check_mark: 几乎所有代码都在最宽松的许可证之一下发布:MIT。
:heavy_check_mark: 定期更新。
:heavy_check_mark: 所需依赖极少。
:heavy_check_mark: 完全在我的业余时间开发,无任何附加条件:请随意尝试并将其集成到您的项目中!。
:heavy_check_mark: 并且获得 了 几个 AI 的 认可 :smile:!。
## 截图
.: (Windows) - 简要分析。
.: (Linux) - Brief analysis along with HTTP response headers.
.: (Linux) - Detailed analysis, in Spanish.
.: (Linux) - Analysis of a raw response file. Example.
.: (Linux) - SSL/TLS 检查。
.: (Linux) - Custom HTTP request header.
.: (Linux) - Compliance with OWASP 'Secure Headers Project' best practices.
.: (Windows) - JSON summary of the analysis, suitable for CI/CD.
.: (Linux) - List of HTTP fingerprint headers based on a specific term.
.: (Windows) - Guidelines for enabling security HTTP response headers.
.: (Linux) - Brief analysis saved as CSV. Example.
.: (Windows) - Detailed analysis saved as PDF. Example.
.: (Linux) - Detailed analysis saved as HTML. Example.
.: (Linux) - Detailed analysis saved as JSON. Example.
.: (Linux) - Detailed analysis saved as XLSX. Example.
.: (Linux) - Brief analysis saved as XML. Example.
.: (Linux) - Analysis history file: Date, URL, Enabled, Missing, Fingerprint, Deprecated/Insecure, Empty headers & Total warnings (the four previous totals).
.: (Linux) - Statistics of the analysis performed against a specific URL.
.: (Linux) - Statistics of the analysis performed against all URLs, in Spanish.
.: (Windows) - Checking for updates
## 安装与更新(源代码) ``` # 安装 python3 和 python3-pip # (Windows) https://www.python.org/downloads/windows/ # (Linux) 如果不可用,请安装它们:例如 Synaptic、apt、dnf、yum ... # (macOS) https://www.python.org/downloads/macos/ # 安装 Git # (Windows) https://git-scm.com/download/win # (Linux) https://git-scm.com/download/linux # (macOS) https://git-scm.com/download/mac # 设置虚拟环境(Windows 下的操作方法待定),下载 'humble' 及其依赖项 # '/home/bluesman/humble_venv' 是虚拟环境的示例路径 $ python3 -m venv /home/bluesman/humble_venv $ source /home/bluesman/humble_venv/bin/activate $ cd /home/bluesman/humble_venv/ $ git clone https://github.com/rfc-st/humble.git $ cd humble $ pip3 install -r requirements.txt # 开始分析!:)。Linux 和 Windows 示例 $ python3 humble.py -u https://google.com $ py humble.py -u https://google.com # 良好习惯:使用完 'humble' 后停用虚拟环境 $ deactivate # 激活虚拟环境以再次使用 'humble' 进行分析 $ cd /home/bluesman/humble_venv/ $ source /home/bluesman/humble_venv/bin/activate $ cd humble # 更新 'humble'(每周):激活虚拟环境并进入 'humble' 文件夹 $ git pull # 更新 'humble'(Release 版):激活虚拟环境,下载最新的源代码文件 # 并将其解压到 'humble' 文件夹中,覆盖文件 https://github.com/rfc-st/humble/releases ``` ## 安装与维护(Docker) ``` # 安装 Docker 并确保其正在运行 # 例如:(Linux) https://www.kali.org/docs/containers/installing-docker-on-kali/ # 例如:(macOs) https://docs.docker.com/desktop/install/mac-install/ # 例如:(Windows) https://docs.docker.com/desktop/install/windows-install/ # 克隆仓库或下载最新的 Release 版本 $ git clone https://github.com/rfc-st/humble.git https://github.com/rfc-st/humble/releases # 在 'humble' 文件夹内构建 Docker 镜像:将 TAG 指定为 'humble' 的最新 Release(例如 1.58) # https://github.com/rfc-st/humble/releases (在 Windows 上,这可能需要以管理员权限运行终端) $ docker build -t humble:1.58 . # 运行分析并指定上述 TAG,以及 'humble' 的特定选项 # '-it',必填:分配一个 pseudo-TTY 并保持输入交互。 # '-rm',必填:退出后自动移除容器。 # (Linux/macOS) # 例如 分析 https://google.com(简要分析) $ docker run -it --rm --name humble humble:1.58 /bin/bash -c "python3 humble.py -u https://google.com -b" # (Windows) # 例如 分析 https://google.com(详细分析) $ docker run -it --rm --name humble humble:1.58 python3 humble.py -u https://google.coms # (可选)升级后移除并取消标记之前的 'humble' 镜像 $ docker rmi humble:1.58 ``` ## 安装与更新(Kali Linux) ``` # 验证输出是否包含 'Homepage: https://github.com/rfc-st/humble' $ apt show humble # 安装 'humble' $ sudo apt install humble # 开始分析!:) $ humble -u https://google.com # 更新 'humble'(每月) $ sudo apt update $ sudo apt install --only-upgrade humble ``` ## 用法 ``` (Windows) $ py humble.py (Linux) $ python3 humble.py (macOS) $ python3 humble.py usage: humble.py [-h] [-a] [-b] [-c] [-cicd] [-df] [-e [TESTSSL_PATH]] [-f [FINGERPRINT_TERM]] [-g] [-grd] [-H REQUEST_HEADER] [-if INPUT_FILE] [-l {es}] [-lic] [-o {all,csv,html,json,pdf,txt,xlsx,xml}] [-of OUTPUT_FILE] [-op OUTPUT_PATH] [-p PROXY] [-r] [-s [SKIP_HEADERS ...]] [-u URL] [-ua USER_AGENT] [-v] 'humble' (HTTP Headers Analyzer) | https://github.com/rfc-st/humble | v.2026-03-06 options: -h, --help show this help message and exit -a Print statistics of the performed analysis; if the '-u' parameter is omitted they will be global -b Print overall findings; if omitted detailed ones will be printed -c Checks URL response HTTP headers for compliance with OWASP 'Secure Headers Project' best practices -cicd Print only analysis summary, totals and grade in JSON; suitable for CI/CD -df Do not follow redirects; if omitted the last redirection will be the one analyzed -e [TESTSSL_PATH] Print only TLS/SSL checks; requires the PATH of testssl (https://testssl.sh/) -f [FINGERPRINT_TERM] Print fingerprint statistics; if 'FINGERPRINT_TERM' (E.g., 'Google') is omitted the top 20 results will be printed -g Print guidelines for enabling security HTTP response headers on popular frameworks, servers and services -grd Print the checks to grade an analysis, along with advice for improvement -H REQUEST_HEADER Adds REQUEST_HEADER to the request; must be in double quotes and can be used multiple times, e.g. -H "Host: example.com" -if INPUT_FILE Analyzes 'INPUT_FILE': must contain HTTP response headers and values separated by ': '; E.g., 'server: nginx' -l {es} Defines the language for displaying analysis, errors and messages; if omitted, will be printed in English -lic Print the license for 'humble', along with permissions, limitations and conditions -o {all,csv,html,json,pdf,txt,xlsx,xml} Export the analysis to the specified format; 'all' will export to all formats -of OUTPUT_FILE Exports analysis to 'OUTPUT_FILE'; if omitted the default filename of the parameter '-o' will be used -op OUTPUT_PATH Exports analysis to 'OUTPUT_PATH'; must be absolute. If omitted the PATH of 'humble.py' will be used -p PROXY Use a proxy for the analysis. E.g., 'http://127.0.0.1:8080'. If no port is specified '8080' will be used -r Print HTTP response headers and a detailed analysis; '-b' parameter will take priority -s [SKIP_HEADERS ...] Skips 'deprecated/insecure' and 'missing' checks for the indicated 'SKIP_HEADERS' (separated by spaces) -u URL Scheme, host and port to analyze. E.g., https://google.com or https://google.com:443 -ua USER_AGENT User-Agent ID from 'additional/user_agents.txt' file to use. '0' will print all and '1' is the default -v, --version Checks for updates at https://github.com/rfc-st/humble examples: -u URL -a Print statistics of the analysis performed against the URL -u URL -b Analyzes the URL and prints overall findings -u URL -b -o csv Analyzes the URL and exports overall findings to CSV format -u URL -l es Analyzes the URL and prints (in Spanish) detailed findings -u URL -o pdf Analyzes the URL and exports detailed findings to PDF format -u URL -o html -of test Analyzes the URL and exports detailed findings to HTML format and 'test' filename -u URL -o pdf -op D:/Tests Analyzes the URL and exports detailed findings to PDF format and 'D:/Tests' path -u URL -p http://127.0.0.1:8080 Analyzes the URL using 'http://127.0.0.1:8080' as the proxy -u URL -r Analyzes the URL and prints detailed findings along with HTTP response headers -u URL -s ETag NEL Analyzes the URL and skips 'deprecated/insecure' and 'missing' checks for 'ETag' and 'NEL' headers -u URL -ua 4 Analyzes the URL using the fourth User-Agent of 'additional/user_agents.txt' file -a -l es Print statistics (in Spanish) of the analysis performed against all URLs -f Google Print HTTP fingerprint headers related to the term 'Google' want to contribute?: How to https://github.com/rfc-st/humble/blob/master/CONTRIBUTING.md References (classes and functions) https://humble.readthedocs.io/en/latest/references.html Acknowledgements https://github.com/rfc-st/humble/#acknowledgements ``` ## 进阶用法(Linux) .: 仅显示已弃用的 headers/协议和不安全的值。
``` $ python3 humble.py -u https://en.wikipedia.org/ | sed -n '/\[4/,/^\[5/ { /^\[5/!p }' | sed '$d' | sed $'1i \n' ```
.: 检查 HTTP 客户端错误 (4XX)。``` $ python3 humble.py -u https://my.prelude.software/demo/index.pl | grep -A1 -B5 'Note : \|Nota : ' --color=never ```
.: 分析多个 URL 并将结果保存为 PDF;感谢 Eduardo 提供此示例!。``` $ datasets=('https://facebook.com' 'https://github.com' 'https://www.spacex.com'); for dataset in "${datasets[@]}"; do python3 humble.py -u "$dataset" -o pdf; done ```
## 单元测试
.: (Linux) - 所有测试均成功通过(以英文显示所有消息)。``` $ cd
``` $ cd
Google Chrome
Microsoft Edge
Mozilla Firefox
Opera
Safari
* GitHub 上的类似工具:
'HTTP Headers Analyze'
'HTTP Headers Secure'
'HTTP Headers Security'
OWASP Secure Headers Project
* 参考与标准:
Can I use?
Mozilla Developer Network
World Wide Web Consortium
* 更多信息:
Common response headers
Security Headers (HTTP response header analyzer)
Scott Helme (Security Researcher)
## 致谢 * 所有这些质量、风格和安全[工具](#quality-style-and-security-tools)的作者/团队:你们太棒了 :metal:!。 * 1nabillion 提供此建议。 * Aniket Navlur 提供这个精辟的见解。 * Azathothas 报告此 bug。 * bulaktm 提出此建议。 * confuciussayuhm 提出此建议。 * cr4zyfish 提出这些部分建议。 * danterolle 提供此贡献。 * David 相信这个工具的用处。 * Eduardo 提供了第一个演示和示例 "(Linux) - 分析多个 URL 并将结果保存为 PDF"。 * gl4nce 提出此建议。 * İDRİS BUDAK 报告了需要进行此检查的需求。 * ilLuSion-007 提供此贡献。 * javelinsoft 提供此贡献。 * Julio 在 macOS 上进行测试并提出此建议。 * kazet 提出此建议。 * manuel-sommer 提出此、此和此建议!。 * mfabbri 提出此建议。 * mgrottenthaler 提出此、此和此建议!。 * MikeAnast 提出若干建议。 * multipartninja 提出此和此建议。 * n3bojs4、ehlewis和dkadev提出此和此建议。 * Sophie Brun 在 Kali Linux 中保持 'humble' 更新并提供此贡献。 * stanley101music 提出此、此和此建议!。 * vincentcox 提出此和此建议。 ## 许可证 MIT © 2020-2026 Rafa 'Bluesman' Faura (rafael.fcucalon@gmail.com)
原作者 - Rafa 'Bluesman' Faura (rafael.fcucalon@gmail.com)