# Rate Limit Bypass

<figure><img src="/files/se5N2OCbiHd0PbneketN" alt=""><figcaption></figcaption></figure>

\
使用[**Trickest**](https://trickest.com/?utm_campaign=hacktrics\&utm_medium=banner\&utm_source=hacktricks)轻松构建并由全球**最先进**的社区工具驱动的**自动化工作流程**。\
立即获取访问权限：

{% embed url="<https://trickest.com/?utm_campaign=hacktrics&utm_medium=banner&utm_source=hacktricks>" %}

<details>

<summary><strong>从零开始学习AWS黑客技术，成为专家</strong> <a href="https://training.hacktricks.xyz/courses/arte"><strong>htARTE（HackTricks AWS Red Team Expert）</strong></a><strong>！</strong></summary>

支持HackTricks的其他方式：

* 如果您想在HackTricks中看到您的**公司广告**或**下载PDF格式的HackTricks**，请查看[**订阅计划**](https://github.com/sponsors/carlospolop)!
* 获取[**官方PEASS & HackTricks周边产品**](https://peass.creator-spring.com)
* 探索[**PEASS家族**](https://opensea.io/collection/the-peass-family)，我们的独家[**NFTs**](https://opensea.io/collection/the-peass-family)
* **加入** 💬 [**Discord群**](https://discord.gg/hRep4RUj7f) 或 [**电报群**](https://t.me/peass) 或在**Twitter**上关注我们 🐦 [**@carlospolopm**](https://twitter.com/hacktricks_live)**。**
* 通过向[**HackTricks**](https://github.com/carlospolop/hacktricks)和[**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github仓库提交PR来分享您的黑客技巧。

</details>

## 速率限制绕过技术

### 探索类似的端点

应尝试对目标端点的变体进行暴力攻击，例如`/api/v3/sign-up`，包括`/Sing-up`，`/SignUp`，`/singup`，`/api/v1/sign-up`，`/api/sign-up`等替代选项。

### 在代码或参数中插入空白字符

将空白字节如`%00`，`%0d%0a`，`%0d`，`%0a`，`%09`，`%0C`，`%20`插入代码或参数中可能是一种有用的策略。例如，将参数调整为`code=1234%0a`可以通过输入的变化来延长尝试次数，例如向电子邮件地址添加换行符以绕过尝试限制。

### 通过标头操纵IP来源

修改标头以更改感知的IP来源可以帮助规避基于IP的速率限制。诸如`X-Originating-IP`，`X-Forwarded-For`，`X-Remote-IP`，`X-Remote-Addr`，`X-Client-IP`，`X-Host`，`X-Forwared-Host`等标头，包括使用多个`X-Forwarded-For`实例，可以调整以模拟来自不同IP的请求。

```bash
X-Originating-IP: 127.0.0.1
X-Forwarded-For: 127.0.0.1
X-Remote-IP: 127.0.0.1
X-Remote-Addr: 127.0.0.1
X-Client-IP: 127.0.0.1
X-Host: 127.0.0.1
X-Forwared-Host: 127.0.0.1

# Double X-Forwarded-For header example
X-Forwarded-For:
X-Forwarded-For: 127.0.0.1
```

### 更改其他标头

建议更改其他请求标头，如用户代理和Cookie，因为这些也可以用于识别和跟踪请求模式。更改这些标头可以防止识别和跟踪请求者的活动。

### 利用 API 网关行为

一些 API 网关配置为基于端点和参数的组合应用速率限制。通过变化参数值或向请求添加非重要参数，可以绕过网关的速率限制逻辑，使每个请求看起来是独一无二的。例如 `/resetpwd?someparam=1`。

### 在每次尝试之前登录到您的帐户

在每次尝试之前登录到一个帐户，或每组尝试，可能会重置速率限制计数器。这在测试登录功能时特别有用。利用类似 Burp Suite 中的 Pitchfork 攻击工具，每隔几次尝试轮换凭据，并确保标记了跟随重定向，可以有效地重新启动速率限制计数器。

### 利用代理网络

部署代理网络以将请求分布到多个 IP 地址可以有效地绕过基于 IP 的速率限制。通过通过各种代理路由流量，每个请求看起来来自不同的源头，削弱速率限制的效果。

### 将攻击分散到不同帐户或会话中

如果目标系统根据每个帐户或每个会话应用速率限制，将攻击或测试分散到多个帐户或会话中可以帮助避免检测。这种方法需要管理多个身份或会话令牌，但可以有效地分发负载以保持在允许的限制范围内。


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://hacktricks.xsx.tw/pentesting-web/rate-limit-bypass.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
