Windows 权限提升的总体目标是进一步将系统的访问权限提升到 Local Administrators
组或 NT AUTHORITY\SYSTEM
LocalSystem 账户。
Privilege Escalation Ways
Privilege |
Escalation |
Abusing Windows group privileges |
滥用 Windows 组权限 |
Abusing Windows user privileges |
滥用 Windows 用户权限 |
Bypassing User Account Control |
绕过用户账户控制 |
Abusing weak service/file permissions |
滥用弱服务/文件权限 |
Leveraging unpatched kernel exploits |
利用未修补的内核漏洞 |
Credential theft |
凭证盗窃 |
Traffic Capture |
流量捕获 |
and more. |
… |
Tools
Tools |
Description |
Seatbelt |
用于执行各种本地特权升级检查的 C# 项目 |
winPEAS |
WinPEAS 是一个脚本,用于搜索在 Windows 主机上提升权限的可能路径。所有检查均在此处说明 |
PowerUp.ps1 |
PowerShell 脚本用于查找依赖于错误配置的常见 Windows 特权提升向量。它还可用于利用发现的一些问题 |
SharpUp |
C# 版本的 PowerUp |
JAWS |
使用 PowerShell 2.0 编写的用于枚举特权升级向量的 PowerShell 脚本 |
SessionGopher |
SessionGopher 是一个 PowerShell 工具,用于查找和解密远程访问工具的已保存会话信息。它提取 PuTTY、WinSCP、SuperPuTTY、FileZilla 和 RDP 已保存的会话信息 |
Watson |
Watson 是一个 .NET 工具,旨在枚举缺失的 KB 并建议利用权限提升漏洞。 |
LaZagne |
用于从 Web 浏览器、聊天工具、数据库、Git、电子邮件、内存转储、PHP、系统管理工具、无线网络配置、内部 Windows 密码存储机制等检索存储在本地机器上的密码的工具 |
Windows Exploit Suggester - Next Generation |
WES-NG 是一款基于 Windowssysteminfo 实用程序输出的工具,它提供了操作系统易受攻击的漏洞列表,包括针对这些漏洞的任何攻击。Windows XP 和 Windows 10 之间的所有 Windows 操作系统(包括其 Windows Server 对应版本)均受支持 |
sysinternals-suite |
将在枚举中使用 Sysinternals 的几种工具,包括AccessChk、PipeList和PsService |
已编译好的项目 https://github.com/r3motecontrol/Ghostpack-CompiledBinaries
Situational Awareness
ifconfig
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
| C:\> ipconfig /all
...SNPI...
Ethernet adapter Ethernet1:
Connection-specific DNS Suffix . : Description . . . . . . . . . . . : vmxnet3 Ethernet Adapter Physical Address. . . . . . . . . : 00-50-56-B9-C5-4B DHCP Enabled. . . . . . . . . . . : No Autoconfiguration Enabled . . . . : Yes Link-local IPv6 Address . . . . . : fe80::f055:fefd:b1b:9919%9(Preferred) IPv4 Address. . . . . . . . . . . : 192.168.20.56(Preferred) Subnet Mask . . . . . . . . . . . : 255.255.255.0 Default Gateway . . . . . . . . . : 192.168.20.1 DHCPv6 IAID . . . . . . . . . . . : 151015510 DHCPv6 Client DUID. . . . . . . . : 00-01-00-01-27-ED-DB-68-00-50-56-B9-90-94 DNS Servers . . . . . . . . . . . : 8.8.8.8 NetBIOS over Tcpip. . . . . . . . : Enabled
Ethernet adapter Ethernet0:
Connection-specific DNS Suffix . : .\ Description . . . . . . . . . . . : Intel(R) 82574L Gigabit Network Connection Physical Address. . . . . . . . . : 00-50-56-B9-90-94 DHCP Enabled. . . . . . . . . . . : Yes Autoconfiguration Enabled . . . . : Yes IPv6 Address. . . . . . . . . . . : dead:beef::e4db:5ea3:2775:8d4d(Preferred) Link-local IPv6 Address . . . . . : fe80::e4db:5ea3:2775:8d4d%4(Preferred) IPv4 Address. . . . . . . . . . . : 10.129.43.8(Preferred) Subnet Mask . . . . . . . . . . . : 255.255.0.0 Lease Obtained. . . . . . . . . . : Thursday, March 25, 2021 9:24:45 AM Lease Expires . . . . . . . . . . : Monday, March 29, 2021 1:28:44 PM Default Gateway . . . . . . . . . : fe80::250:56ff:feb9:4ddf%4 10.129.0.1 DHCP Server . . . . . . . . . . . : 10.129.0.1 DHCPv6 IAID . . . . . . . . . . . : 50352214 DHCPv6 Client DUID. . . . . . . . : 00-01-00-01-27-ED-DB-68-00-50-56-B9-90-94 DNS Servers . . . . . . . . . . . : 1.1.1.1 8.8.8.8 NetBIOS over Tcpip. . . . . . . . : Enabled ...SNPI...
|
Read More
Linux 系统上的 root 帐户提供对操作系统的完全管理级别访问权限。在评估期间,可能会在 Linux 主机上获得低权限 shell,并需要将权限提升到 root 帐户。
Environment Enumeration
枚举是特权提升的关键。有多个辅助脚本(如LinPEAS和LinEnum)可用于协助枚举。
Operating system and version
Ubuntu 维护周期
1 2 3 4 5 6 7 8 9 10 11 12 13 14
| $ cat /etc/os-release
NAME="Ubuntu" VERSION="20.04.4 LTS (Focal Fossa)" ID=ubuntu ID_LIKE=debian PRETTY_NAME="Ubuntu 20.04.4 LTS" VERSION_ID="20.04" HOME_URL="https://www.ubuntu.com/" SUPPORT_URL="https://help.ubuntu.com/" BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/" PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy" VERSION_CODENAME=focal UBUNTU_CODENAME=focal
|
PATH
1 2 3
| $ echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
|
env
1 2 3 4 5 6 7 8 9 10 11
| $ env
SHELL=/bin/bash PWD=/home/htb-student LOGNAME=htb-student XDG_SESSION_TYPE=tty MOTD_SHOWN=pam HOME=/home/htb-student LANG=en_US.UTF-8
<SNIP>
|
Read More