💢 簡介
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. 。 。 。 。