💢 简介
httpx
是一个快速且多用途的HTTP工具包,允许使用retryablehttp库运行多个探测器。它旨在通过增加线程数量来保持结果的可靠性。
功能 🤪
发送 GET、POST、PUT、DELETE 等 HTTP 请求 支持流式传输 支持重定向 支持身份验证 支持代理 支持 cookie 支持 TLS
安全领域 🧐
漏洞扫描 渗透测试 安全研究 网络安全监控 Web 应用防火墙
安装方式 😤
go install -v github.com/projectdiscovery/httpx/cmd/httpx@latest
😖 参数详解
httpx 是一个快速且多功能的 HTTP 工具包,允许使用 retryablehttp 库运行多个探测。用法:httpx [标志]标志:
输入:-l, -list string 输入文件,包含要处理的主机列表-rr, -request string 包含原始请求的文件-u, -target string[] 输入目标主机以进行探测探测:-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 数据集显示使用的技术-method 显示 HTTP 请求方法-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 输出中排除无头头信息-st, -screenshot-timeout int 设置截图超时时间(单位:秒,默认 10)匹配器:-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, leaseweb, stackpath)-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)-fep, -filter-error-page 基于机器学习的错误页面检测过滤响应-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, leaseweb, stackpath)-frt, -filter-response-time string 用指定响应时间过滤响应(-frt '> 1')-fdc, -filter-condition string 用 DSL 表达式条件过滤响应-strip 去除响应中的所有标签。支持格式:html, xml(默认值为 html)速率限制:-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 管道的服务器-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(行)格式存储输出-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 使用的协议(未知,http11)配置:-config string httpx 配置文件的路径(默认 $HOME/.config/httpx/config.yaml)-auth 配置 projectdiscovery cloud (pdcp) API 密钥(默认 true)-r, -resolvers string[] 自定义解析器列表(文件或以逗号分隔)-allow string[] 允许处理的 IP/CIDR 列表(文件或以逗号分隔)-deny string[] 拒绝处理的 IP/CIDR 列表(文件或以逗号分隔)-sni, -sni-name string 自定义 TLS SNI 名称-random-agent 启用随机用户代理(默认 true)-H, -header string[] 发送请求时的自定义 HTTP 头-http-proxy, -proxy string 要使用的 HTTP 代理(例如 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 获取 vhosts 列表作为输入-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 禁用标准输入处理-hae, -http-api-endpoint string 实验性 HTTP API 端点调试:-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 输出中的颜色优化:-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 要保存的最大响应大小(字节,默认 2147483647)-rstr, -response-size-to-read int 要读取的最大响应大小(字节,默认 2147483647)
目标指定 🤐
-l, -list string
主机列表的文件-rr,
-request
字符串文件包含原始请求-u,
要探测的主机ip,域名,逗号分割多个目标
探测功能 🤩
-sc
, 显示响应状态代码-cl
, 显示响应内容长度-ct
, 显示响应内容类型-location
, 显示响应重定向位置-favicon
, 显示/favicon.ico文件的mmh3散列-hash md5
, 显示响应体哈希值(支持:md5,mmh3,simhash,sha1,sha256,sha512
)-jarm
, 显示jarm指纹散列-rt
, 显示响应时间-lc,
显示响应体行数-wc
, 显示响应正文字数-title
, 显示页面标题-bp=1, -body-preview
显示响应体的前N个字符(默认为100)-server, -web-server
显示服务器名-td、-tech-detect
, 显示wappalyzer数据集上的服务应用-method
, 显示HTTP请求方法-websocket
, 显示服务器使用websocket-ip
显示目标主机IP-cname
,显示主机的cname-asn
, 显示主机的asn信息-cdn
, 显示使用的cdn ,waf-probe
, 显示探针状态
无头测试 👏
-ss, -screen
启用使用无头浏览器保存页面截图-system-chrome
启用使用本地安装的chrome屏幕截图-esb, -exclude-screen - shots -bytes
启用从json输出中排除截图字节-ehb, -exclude-headless-body
启用从json输出中排除headless header
参数匹配 😮💨
-mc, -match-code string
匹配响应与指定的状态码(-mc 200,302)-ml, -match-length
字符串匹配指定内容长度的响应(-ml 100,102,0)-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)-mcdn, -match-cdn string
匹配是否为指定CDN提供商(cloudfront, fastly, google, leaseweb, stackpath)-mrt, -match-response-time string
以秒为单位匹配具有指定响应时间的响应(-mrt ‘< 1s’)-mdc, -match-condition string
使用DSL表达式条件匹配响应
响应提取 🫠
-er, -extract-regex string[]
显示匹配正则的响应内容(-er "(.*?) ”)-ep, -extract-preset string[]
显示与预定义正则表达式(ipv4,mail,url)匹配的响应内容
过滤参数 🤗
-fc, -filter-code string
排除目标,指定状态码过滤掉响应,排除掉403,401响应 (-fc 403,401)-fep, -filter-error-page
过滤响应,基于ML的错误页面检测-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
指定字符串过滤响应(-fs admin)-fe, -filter-regex string
, 使用指定的正则表达式过滤响应(-fe admin 302 200 )-fcdn, -filter-cdn string
过滤指定CDN提供商的主机(cloudfront, fastly,google,leaseweb, stackpath)-frt, -filter-response-time string
, 过滤响应,指定响应时间为秒(- first ‘> 1’)-fdc, -filter-condition string
过滤带有DSL表达式条件的响应-strip html
, 删除响应中的所有标签。支持的格式:html,xml(默认html)-strip=html
速率控制 🤣
-t, -threads int
要使用的线程数(默认50)-rl, -rate-limit int
每秒发送的最大请求数(默认为150)-rlm, -rate-limit-minute
int每分钟发送的最大请求数
杂项 ☹️
-pa, -probe-all-ips
探测与同一主机关联的所有ip ,一个主机名(域名)可能绑定多个 ip 地址-p, -ports string[]
要探测的端口(nmap语法:例如http:1,2-10,11,https:80以及 -ports http:443,http:80,https:8443)-path string
要探测的路径或路径列表(逗号分隔,file) 可指定字符,也可文件,可用于模糊测试-tls-probe
, 在提取的 TLS 域(传输层安全协议中使用的域名)上发送 http 探测(dns _ name)-csp-probe
, 在提取的csp域上发送http探测-tls-grab
, 执行 TLS (SSL)数据抓取-pipeline
,支持HTTP1.1管道的探测和显示服务器-http2
, 支持HTTP2的探测和显示服务器-vhost
, 支持虚拟主机探测-ldv
, 显示内置的匹配表达式
更新 😢
-up
,更新 httpx程序-duc
, 禁用更新检测
输出 🧰
-o
指定输出文件-oa
以所有格式写入输出结果(默认,csv,json),需要先指定 -o-sr
, -store-response , 将http响应存储到输出目录-srd
, -store-response-dir string 将 http 响应存储到自定义目录-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)-svrc
,包括视觉侦察集群(仅限-ss和-sr)
配置 🤨
-config string
, 配置文件的config字符串路径(默认为$HOME/.config/httpx/config.yaml)-r, -resolvers string[]
, 自定义 dns 解析器列表(文件或逗号分隔)( doh|tcp|udp ),形式为 protocol:resolver:port
(例如 udp:127.0.0.1:53
)-allow string[]
, 允许处理的IP/CIDR列表(以文件或逗号分隔,ip地址,不能域名)-deny string[]
, 拒绝处理的IP/CIDR列表(以文件或逗号分隔,ip地址,不能域名)-sni, -sni-name string
, 自定义TLS SNI名称(TLS握手过程中指定要连接的主机名或域名)-random-agent
,启用随机 user-agent 使用(默认为true)-H, -header string[]
,自定义的HTTP标头发送请求-http-proxy, -proxy string
, 使用 http 代理服务器(例如 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
请求方法探测(get,post等等),使用’all’探测所有HTTP方法-body string
在HTTP请求中包含的参数消息体 “ value=value&value=value”-s, -stream stream mode
, 流模式,开始详细说明输入目标而不进行排序-sd, -skip-dedupe
禁用重复数据删除输入项(仅用于流模式)-ldp, -leave-default-ports
在主机头保留默认的 http/https 端口(例如 http://host: 80- https://host:443)-ztls
, 使用ztls库并自动回调到tls13的标准库-no-decode
,避免解码body-tlsi, -tls-impersonate
,启用实验客户端hello(ja3)tls随机化-no-stdin
, 禁用 Stdin 处理
DEBUG 🤪
-health-check, -hc
进行诊断检查-debug
在cli中显示请求/响应内容-debug-req
在 cli 中显示请求内容-debug-resp
在 cli 中显示返回内容-version
显示 httpx 版本-stats
, 显示扫描统计-profile-mem string
,可选的HTTPX内存配置文件转储文件-silent
,静默模式(不显示httpx程序banner信息)-v, -verbose
, 详细模式-si, -stats-interval int
,显示统计数据更新之间等待的秒数(默认值: 5)-nc, -no-color
,禁用cli输出中的颜色
优化 🙄
-nf, -no-fallback
显示 http 与 https 两种协议探测-nfs, -no-fallback-scheme
,使用输入目标中指定的协议方案进行探测-maxhr, -max-host-error int
,跳过剩余路径之前,每个主机的最大错误计数(默认30)-ec, -exclude-cdn
, 针对waf/cdn 跳过全端口扫描,只检查80和443-eph, -exclude-private-hosts
,跳过任何具有私有IP地址的主机(如 localhost)-retries int
, 重试次数-timeout int
,以秒为单位的超时(默认值为10)-delay value
,每个http请求之间的持续时间(例如:200ms,1s)(默认值为-1ns)-rsts, -response-size-to-save int
,要保存的最大响应大小(以字节为单位)(默认值为2147483647)-rstr, -response-size-to-read int
,要读取的最大响应大小(以字节为单位)(默认值为2147483647)
😰 使用技巧
cat 一个文件进行测试
cat hosts.txt | httpx指定文件进行测试
httpx -list hosts.txt CIDR输入测试
echo 173.0.84.0/24 | httpx AS编号测试
echo AS14421 | httpx -silent管道工具链测试
subfinder -d hackerone.com | httpx工具链查找网站图标
subfinder -d hackerone.com -silent | httpx -favicon指纹识别
subfinder -d hackerone.com -silent | httpx -jarm
subfinder -d hackerone.com -silent | httpx -asn文件/路径暴力破解
httpx -l urls.txt -path /v1/api -scdocker 运行
cat sub_domains.txt | docker run -i projectdiscovery/httpx批量截图
subfinder -d example.com | httpx -screenshot
😬 参考文章
https://github.com/projectdiscovery/httpx
🥹 over. 。 。 。 。
🥹 over. 。 。 。 。
🥹 over. 。 。 。 。