返回更新列表
新发布Jul 22, 2026

httpx v1.10.0

快速、多探针HTTP工具包,用于侦察和信息收集。探测TLS、CSP、标头、技术栈和CDN。支持匹配器、过滤器和JSON输出,用于自动化安全测试。

分享

httpx

功能特性安装使用方法文档说明加入 Discord

httpx 是一个快速且多用途的 HTTP 工具包,允许使用 retryablehttp 库运行多个探测。它旨在在增加线程数的同时保持结果可靠性。

功能特性

httpx

  • 简洁模块化的代码库,易于贡献。
  • 快速且完全可配置的标志,用于探测多种元素。
  • 支持多种基于 HTTP 的探测。
  • 默认智能回退:从 https 到 http。
  • 支持主机、URL 和 CIDR 作为输入。
  • 处理边界情况,如重试、退避等,以应对 WAF。

支持的探测

探测项默认检查探测项默认检查
URLtrueIPtrue
标题trueCNAMEtrue
状态码trueRaw HTTPfalse
内容长度trueHTTP2false
TLS 证书trueHTTP Pipelinefalse
CSP 头true虚拟主机false
行数true字数true
Location 头trueCDNfalse
Web 服务器true路径false
Web Sockettrue端口false
响应时间true请求方法true
Favicon 哈希false探测状态false
Body 哈希true头哈希true
重定向链falseURL 方案true
JARM 哈希falseASNfalse

安装说明

httpx 需要 go >=1.25.0 才能成功安装。运行以下命令获取仓库:

go install -v github.com/projectdiscovery/httpx/cmd/httpx@latest

如需了解更多关于安装 httpx 的信息,请参阅 https://docs.projectdiscovery.io/tools/httpx/install。

免责声明
该项目正处于活跃开发阶段。更新时可能会发生破坏性变更。更新前请查看更新日志。
该项目主要作为独立 CLI 工具构建。将其作为服务运行可能存在安全风险。 建议谨慎使用并采取额外的安全措施。

使用方法

httpx -h

这将显示工具的帮助信息。以下是所有支持的开关。

httpx 是一个快速且多用途的 HTTP 工具包,允许使用 retryablehttp 库运行多个探测。

用法:
  ./httpx [flags]

标志:
输入:
   -l, -list string              包含要处理的主机列表的输入文件
   -rr, -request string          包含原始请求的文件
   -u, -target string[]          要探测的输入目标主机
   -im, -input-mode string       输入文件模式 (burp)

探测:
   -sc, -status-code                      显示响应状态码
   -cl, -content-length                   显示响应内容长度
   -ct, -content-type                     显示响应内容类型
   -location                              显示响应重定向位置
   -favicon                               显示 '/favicon.ico' 文件的 mmh3 哈希
   -hash string                           显示响应体哈希(支持:md5,mmh3,simhash,sha1,sha256,sha512)
   -jarm                                  显示 jarm 指纹哈希
   -rt, -response-time                    显示响应时间
   -lc, -line-count                       显示响应体行数
   -wc, -word-count                       显示响应体字数
   -title                                 显示页面标题
   -bp, -body-preview                     显示响应体的前 N 个字符(默认 100)
   -server, -web-server                   显示服务器名称
   -td, -tech-detect                      基于 wappalyzer 数据集显示使用的技术
   -cff, -custom-fingerprint-file string  用于技术检测的自定义指纹文件路径
   -method                                显示 HTTP 请求方法
   -ws, -websocket                        显示使用 WebSocket 的服务器
   -ip                                    显示主机 IP
   -cname                                 显示主机 CNAME
   -extract-fqdn, -efqdn                  在 jsonl/csv 输出中从响应体和头部提取域名和子域名
   -asn                                   显示主机 ASN 信息
   -cdn                                   显示使用的 CDN/WAF(默认 true)
   -probe                                 显示探测状态

无头浏览器:
   -ss, -screenshot                 启用使用无头浏览器保存页面截图
   -system-chrome                   启用使用本地安装的 Chrome 进行截图
   -ho, -headless-options string[]  启动无头 Chrome 并附加选项
   -esb, -exclude-screenshot-bytes  从 JSON 输出中排除截图字节
   -ehb, -exclude-headless-body     从 JSON 输出中排除无头浏览器头部
   -no-screenshot-full-page         禁用保存全页截图
   -st, -screenshot-timeout value   设置截图超时时间(秒)(默认 10s)
   -sid, -screenshot-idle value     设置截图前的空闲时间(秒)(默认 1s)
   -jsc, -javascript-code string[]  导航后执行 JavaScript 代码

匹配器:
   -mc, -match-code string            匹配指定状态码的响应(-mc 200,302)
   -ml, -match-length string          匹配指定内容长度的响应(-ml 100,102)
   -mlc, -match-line-count string     匹配指定行数的响应体(-mlc 423,532)
   -mwc, -match-word-count string     匹配指定字数的响应体(-mwc 43,55)
   -mfc, -match-favicon string[]      匹配指定 favicon 哈希的响应(-mfc 1494302000)
   -ms, -match-string string[]        匹配包含指定字符串的响应(-ms admin)
   -mr, -match-regex string[]         匹配指定正则表达式的响应(-mr admin)
   -mcdn, -match-cdn string[]         匹配指定 CDN 提供商的主机(cloudfront、fastly、google 等)
   -mrt, -match-response-time string  匹配指定响应时间(秒)的响应(-mrt '< 1')
   -mdc, -match-condition string      使用 DSL 表达式条件匹配响应

提取器:
   -er, -extract-regex string[]   显示匹配正则表达式的响应内容
   -ep, -extract-preset string[]  显示匹配预定义正则表达式的响应内容(url,ipv4,mail)

过滤器:
   -fc, -filter-code string               过滤指定状态码的响应(-fc 403,401)
   -fpt, -filter-page-type string[]       过滤指定页面类型的响应(例如 -fpt login,captcha,parked)
   -fep, -filter-error-page               [已弃用:改用 -fpt] 基于 ML 的错误页面检测过滤响应
   -fd, -filter-duplicates                过滤掉近似重复的响应(仅保留第一个响应)
   -fl, -filter-length string             过滤指定内容长度的响应(-fl 23,33)
   -flc, -filter-line-count string        过滤指定行数的响应体(-flc 423,532)
   -fwc, -filter-word-count string        过滤指定字数的响应体(-fwc 423,532)
   -ffc, -filter-favicon string[]         过滤指定 favicon 哈希的响应(-ffc 1494302000)
   -fs, -filter-string string[]           过滤包含指定字符串的响应(-fs admin)
   -fe, -filter-regex string[]            过滤匹配指定正则表达式的响应(-fe admin)
   -fcdn, -filter-cdn string[]            过滤指定 CDN 提供商的主机(cloudfront、fastly、google 等)
   -frt, -filter-response-time string     过滤指定响应时间(秒)的响应(-frt '> 1')
   -fdc, -filter-condition string         使用 DSL 表达式条件过滤响应
   -strip                                  剥离响应中的所有标签。支持格式:html,xml(默认 html)
   -lof, -list-output-fields              要输出的字段列表(逗号分隔)
   -eof, -exclude-output-fields string[]  基于条件排除输出字段

速率限制:
   -t, -threads int             使用的线程数(默认 50)
   -rl, -rate-limit int         每秒发送的最大请求数(默认 150)
   -rlm, -rate-limit-minute int 每分钟发送的最大请求数

其他:
   -pa, -probe-all-ips        探测同一主机关联的所有 IP
   -p, -ports string[]        要探测的端口(nmap 语法:例如 http:1,2-10,11,https:80)
   -path string               要探测的路径或路径列表(逗号分隔、文件)
   -tls-probe                 在提取的 TLS 域名(dns_name)上发送 HTTP 探测
   -csp-probe                 在提取的 CSP 域名上发送 HTTP 探测
   -tls-grab                  执行 TLS(SSL) 数据抓取
   -pipeline                  探测并显示支持 HTTP1.1 pipeline 的服务器
   -http2                     探测并显示支持 HTTP2 的服务器
   -vhost                     探测并显示支持 VHOST 的服务器
   -ldv, -list-dsl-variables  列出支持 DSL 匹配器/过滤器的 JSON 输出字段键名

更新:
   -up, -update                 将 httpx 更新到最新版本
   -duc, -disable-update-check  禁用自动 httpx 更新检查

输出:
   -o, -output string                     写入输出结果的文件
   -oa, -output-all                       以所有格式写入输出结果的文件名
   -sr, -store-response                   将 HTTP 响应存储到输出目录
   -srd, -store-response-dir string       将 HTTP 响应存储到自定义目录
   -ob, -omit-body                        在输出中省略响应体
   -csv                                   以 CSV 格式存储输出
   -csvo, -csv-output-encoding string     定义输出编码
   -j, -json                              以 JSONL(ines) 格式存储输出
   -irh, -include-response-header         在 JSON 输出中包含 HTTP 响应头(仅 -json)
   -irr, -include-response                在 JSON 输出中包含 HTTP 请求/响应(头 + 体)(仅 -json)
   -irrb, -include-response-base64        在 JSON 输出中包含 base64 编码的 HTTP 请求/响应(仅 -json)
   -include-chain                         在 JSON 输出中包含重定向 HTTP 链(仅 -json)
   -store-chain                           在响应中包含 HTTP 重定向链(仅 -sr)
   -svrc, -store-vision-recon-cluster     包含视觉侦察集群(仅 -ss 和 -sr)
   -pr, -protocol string                  要使用的协议(unknown, http11, http2, http3)
   -fepp, -filter-error-page-path string  存储过滤错误页面的路径(默认 "filtered_error_page.json")
   -rdb, -result-db                       将结果存储在数据库中
   -rdbc, -result-db-config string        数据库配置文件路径
   -rdbt, -result-db-type string          数据库类型(mongodb, postgres, mysql)
   -rdbcs, -result-db-conn string         数据库连接字符串(环境变量:HTTPX_DB_CONNECTION_STRING)
   -rdbn, -result-db-name string          数据库名称(默认 "httpx")
   -rdbtb, -result-db-table string        表/集合名称(默认 "results")
   -rdbbs, -result-db-batch-size int      数据库插入的批量大小(默认 100)
   -rdbor, -result-db-omit-raw            从数据库中省略原始请求/响应数据

配置:
   -config string                    httpx 配置文件路径(默认 $HOME/.config/httpx/config.yaml)
   -r, -resolvers string[]           自定义解析器列表(文件或逗号分隔)
   -allow string[]                   允许处理的 IP/CIDR 列表(文件或逗号分隔)
   -deny string[]                    拒绝处理的 IP/CIDR 列表(文件或逗号分隔)
   -sni, -sni-name string            自定义 TLS SNI 名称
   -random-agent                     启用随机 User-Agent(默认 true)
   -auto-referer                     将 Referer 头设置为当前 URL
   -H, -header string[]              发送自定义 HTTP 头
   -http-proxy, -proxy string        使用的代理(http|socks)(例如 http://127.0.0.1:8080)
   -unsafe                           发送原始请求,跳过 golang 规范化
   -resume                           使用 resume.cfg 恢复扫描
   -fr, -follow-redirects            跟随 HTTP 重定向
   -maxr, -max-redirects int         每个主机最大跟随重定向次数(默认 10)
   -fhr, -follow-host-redirects      在同一主机上跟随重定向
   -rhsts, -respect-hsts             对重定向请求尊重 HSTS 响应头
   -vhost-input                      将 vhost 列表作为输入
   -x string                         要探测的请求方法,使用 'all' 探测所有 HTTP 方法
   -body string                      包含在 HTTP 请求中的 POST 体
   -s, -stream                       流模式 - 无需排序直接处理输入目标
   -sd, -skip-dedupe                 禁用输入项去重(仅与流模式一起使用)
   -ldp, -leave-default-ports        在主机头中保留默认 http/https 端口(例如 http://host:80 - https://host:443)
   -ztls                             使用 ztls 库并自动回退到标准库用于 tls13
   -no-decode                        避免解码响应体
   -tlsi, -tls-impersonate           启用实验性客户端 hello (ja3) TLS 随机化
   -no-stdin                         禁用 Stdin 处理
   -hae, -http-api-endpoint string   实验性 HTTP API 端点
   -sf, -secret-file string          用于身份验证的密钥文件路径

调试:
   -health-check, -hc        运行诊断检查
   -debug                    在 CLI 中显示请求/响应内容
   -debug-req                在 CLI 中显示请求内容
   -debug-resp               在 CLI 中显示响应内容
   -version                  显示 httpx 版本
   -stats                    显示扫描统计信息
   -profile-mem string       可选的 httpx 内存性能分析转储文件
   -silent                   静默模式
   -v, -verbose              详细模式
   -si, -stats-interval int  两次统计更新之间的等待秒数(默认:5)
   -nc, -no-color            禁用 CLI 输出中的颜色
   -tr, -trace               跟踪

优化:
   -nf, -no-fallback                  显示两种探测协议(HTTPS 和 HTTP)
   -nfs, -no-fallback-scheme          仅探测输入中指定的协议方案
   -maxhr, -max-host-error int        每个主机在跳过剩余路径/之前的最大错误数(默认 30)
   -e, -exclude string[]              排除匹配指定过滤器的主机('cdn', 'private-ips', cidr, ip, regex)
   -retries int                       重试次数
   -timeout int                       超时时间(秒)(默认 10)
   -delay value                       每个 HTTP 请求之间的持续时间(例如:200ms, 1s)(默认 -1ns)
   -rsts, -response-size-to-save int  要保存的最大响应大小(字节)(默认 50000000)
   -rstr, -response-size-to-read int  要读取的最大响应大小(字节)(默认 50000000)

云:
   -auth                           配置 projectdiscovery 云(pdcp)API 密钥(默认 true)
   -ac, -auth-config string        配置 projectdiscovery 云(pdcp)API 密钥凭证文件
   -pd, -dashboard                 将输出上传/查看至 projectdiscovery 云(pdcp)UI 仪表板
   -tid, -team-id string           将资产结果上传到指定团队 ID(可选)
   -aid, -asset-id string          将新资产上传到现有资产 ID(可选)
   -aname, -asset-name string      要设置的资产组名称(可选)
   -pdu, -dashboard-upload string  将 httpx 输出文件(jsonl)上传至 projectdiscovery 云(pdcp)UI 仪表板

运行 httpx

有关运行 httpx 的详细信息,请参阅 https://docs.projectdiscovery.io/tools/httpx/running。

httpx 作为库使用

httpx 可以作为库使用:创建 Option 结构体实例,并用与 CLI 相同的选项填充。验证后,将该结构体传递给 runner 实例(程序结束时关闭),并调用 RunEnumeration 方法。最小示例位于 examples 文件夹中。

说明

  • 默认情况下,httpx 使用 HTTPS 方案进行探测,仅当 HTTPS 不可达时才回退到 HTTP
  • Burp Suite 的 XML 导出文件可作为输入使用,使用 -l burp-export.xml -im burp
  • 使用 -no-fallback 标志可同时探测并显示 HTTPHTTPS 结果。
  • 可以为端口定义自定义方案,例如 -ports http:443,http:80,https:8443
  • 自定义解析器支持多种协议 (doh|tcp|udp),格式为 protocol:resolver:port(例如 udp:127.0.0.1:53)。
  • 可以使用密钥文件进行基于域的身份验证,通过 -sf secrets.yaml。支持的身份验证类型:BasicAuthBearerTokenHeaderCookieQuery。示例:
    id: example-auth
    info:
      name: Example Auth Config
    static:
      - type: Header
        domains:
          - api.example.com
        headers:
          - key: X-API-Key
            value: secret-key-here
      - type: BasicAuth
        domains-regex:
          - ".*\\.internal\\.com$"
        username: admin
        password: secret
    
  • 以下标志应用于特定用例,而非与其他探测一起默认运行:
    • -ports
    • -path
    • -vhost
    • -screenshot
    • -csp-probe
    • -tls-probe
    • -favicon
    • -http2
    • -pipeline
    • -tls-impersonate

致谢

探测功能灵感来源于 @tomnomnom/httprobe 的工作 ❤️


httpxprojectdiscovery 团队用心打造,并在 MIT 许可证 下分发。

Join Discord

分类