HTTPX-测试工具-鸡毙你

admin 2023年11月24日13:58:48评论113 views字数 5811阅读19分22秒阅读模式



💢 简介

httpx 是一个快速且多用途的HTTP工具包,允许使用retryablehttp库运行多个探测器。它旨在通过增加线程数量来保持结果的可靠性,对于安全领域,定制特殊请求进行渗透测试,漏洞扫描,POC编写,批量利用。

功能 🤪

  • • 发送 GET、POST、PUT、DELETE 等 HTTP 请求

  • • 支持流式传输

  • • 支持重定向

  • • 支持身份验证

  • • 支持代理

  • • 支持 cookie

  • • 支持 TLS

安全领域 🧐

  • • 漏洞扫描与利用

  • • 渗透测试

  • • 安全研究

  • • 网络安全监控

  • • Web 应用防火墙

安装方式 😤

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

😖 参数详解

目标指定 🤐

  • -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(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 192.168.0.1/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 -jarmsubfinder -d hackerone.com -silent | httpx -asn
文件/路径暴力破解httpx -l urls.txt -path /v1/api -sc
docker 运行cat sub_domains.txt | docker run -i projectdiscovery/httpx
批量截图subfinder -d example.com | httpx -screenshot

😬 参考文章

  • • https://github.com/projectdiscovery/httpx

🥹 over.  。。 。  。

🥹 over.  。。 。  。

🥹 over.  。。 。  。



原文始发于微信公众号(人遁安全):HTTPX-测试工具-鸡毙你

  • 左青龙
  • 微信扫一扫
  • weinxin
  • 右白虎
  • 微信扫一扫
  • weinxin
admin
  • 本文由 发表于 2023年11月24日13:58:48
  • 转载请保留本文链接(CN-SEC中文网:感谢原作者辛苦付出):
                   HTTPX-测试工具-鸡毙你http://cn-sec.com/archives/2230622.html

发表评论

匿名网友 填写信息