第133-134天:windows权限提升篇&溢出漏洞&土豆家族&通杀全系&补丁对比&EXP筛选

image-20250909183206708

image-20250909183221558

1、Web权限提升及转移

2、系统权限提升及转移

3、宿主权限提升及转移

4、域控权限提升及转移

1
2
3
4
#简要点:
1、各类权限获取入口点,应用场景
2、各类权限功能操作,相互转移及提升
3、各类权限提升中技术分类,所需条件

演示案例-Web到Win-系统提权-人工操作

解决工具或插件无法实时更新,又或者面对的操作系统较高的情况下人工操作更适合

1
2
优点:解决实时更新不集成的EXP
缺点:操作繁琐,需要各种复现调试

图片1

如果提权中无法执行命令的话,可以尝试上传本地cmd.exe到可读写目录再调用

在线查询

1
2
#小迪视频中的网站已经打不开了
http://bypass.tidesec.com/exp/

image-20250909183619325

就是直接将systeminfo的信息粘贴就可以了:

image-20250909183716651

第二个网站:

1
https://tools.zjun.info/getmskb/

image-20250909183814900

github上的项目:

1
https://github.com/bitsadmin/wesng

image-20250909183901764

首先将systeminfo的信息保存到一个文本文档中:

image-20250909184053723

1
2
python wes.py systeminfo.txt --color
python wes.py systeminfo.txt --color -i "Elevation of Privilege" -o vuln.csv

image-20250909184228316

然后你就要从里面找对应的漏洞编号的POC或者exp,然后自己去验证,一个一个实验,唯一可以快速的方式是经验。

EXP获取执行

KernelHub 针对常用溢出编号指定找EXP

1
https://github.com/Ascotbe/Kernelhub

image-20250909184445761

上面的漏洞编号,可以从这个项目中进行查询。

image-20250909184527156

image-20250909184543429

这里会给出利用方式,如果没有利用方式,也会给出哪里可以找到利用方式。

Poc-in-Github 针对年份及编号指定找EXP

1
https://github.com/nomi-sec/PoC-in-GitHub

image-20250909184707184

image-20250909184751967

演示案例-Web到Win-系统提权-土豆家族

参考链接:

1
https://mp.weixin.qq.com/s/OW4ybuqtErh_ovkTWLSr8w
  • 土豆(potato)提权通常用在我们获取WEB/数据库权限的时候,可以将低权限的服务用户提升为“NT AUTHORITY\SYSTEM”特权。

自行搭建+Windows 2019(IIS+ASP.NET)-人工操作

image-20250909185602872

首先上传一个asp的木马,模拟拿下webshell,然后上传土豆家族的exe

用一个土豆进行执行whoami的命令

1
BadPotato.exe whoami

image-20250909191109503

用这个土豆运行cs.exe的后门,cs得到的权限就是system:

1
BadPotato.exe cs.exe

image-20250909191851517

Test in:自行搭建+Windows 2022(IIS+ASP.NET)-人工操作

image-20250909192551802

1
这里使用win2022,还是可以用BadPotato.exe提权成功

Test in:Windows 10/11(1809/21H2)

Win10

我的windows10全部不行,感觉是SeShutdownPrivilege的原因:

1
whoami /priv

image-20250909202648053

提权发现了一个小盲点,就是现在windows在安装的时候,好像不能和以前一样可以设置administrator了,必须要创建一个新的用户,然后administrator用户禁用,如果你不是administrator用户,这个时候去提权,是提不了的,虽然你自己创建的用户等同于administrator,但是就是提权不了

image-20250909203342807

Win11

image-20250909203825968

1
2
3
4
5
6
7
8
9
10
11
12
SweetPotato        OK
RoguePotato
BadPotato OK
EfsPotato OK
GodPotato OK
PetitPotato OK
MultiPotato
CandyPotato
RasmanPotato OK
CoercedPotato
JuicyPotatoNG
PrintNotifyPotato OK

土豆家族项目地址

默认有些项目不是编译好的,需要自己编译成EXE文件。

GodPotato-自带exe

1
项目地址:https://github.com/BeichenDream/GodPotato

image-20250909204148773

RoguePotato-自带exe

1
https://github.com/antonioCoco/RoguePotato

image-20250909204225345

PetitPotato-自带exe

1
https://github.com/wh0amitz/PetitPotato

image-20250909204259510

JuicyPotatoNG-自带exe

1
https://github.com/antonioCoco/JuicyPotatoNG

image-20250909204333277

PrintNotifyPotato-自带exe

1
https://github.com/BeichenDream/PrintNotifyPotato

image-20250909204406794

BadPotato-需要自行编译成exe

1
https://github.com/BeichenDream/BadPotato

image-20250909204455455

image-20250909204446995

image-20250909204529454

EfsPotato-需要自行编译成exe

1
https://github.com/zcgonvh/EfsPotato

image-20250909204601477

CandyPotato-需要自行编译成exe

1
https://github.com/klezVirus/CandyPotato

image-20250909204638875

RasmanPotato-需要自行编译成exe

1
https://github.com/crisprss/RasmanPotato

image-20250909204712244

MultiPotato-需要自行编译成exe

1
https://github.com/S3cur3Th1sSh1t/MultiPotato

image-20250909204749657

SweetPotato-需要自行编译成exe

1
https://github.com/CCob/SweetPotato

image-20250909204818328

CoercedPotato需要自行编译成exe

1
https://github.com/Prepouce/CoercedPotato

image-20250909204848647

权限提升-Windows权限提升篇&数据库篇&MYSQL&MSSQL&ORACLE&自动化项目

转载:https://blog.csdn.net/m0_60571842/article/details/136987336

1
2
3
4
5
6
数据库提权流程:
1、先获取到数据库用户密码(源码泄漏,弱密码爆破)
-网站存在SQL注入漏洞
-数据库的存储文件或备份文件
-网站应用源码中的数据库配置文件
-采用工具或脚本爆破(需解决外联问题)

利用数据库自动化提权项目进行连接

  • MDUT-图形化
    https://github.com/SafeGroceryStore/MDUT

image-20250909210721653

  • Sylas-图形化
    https://github.com/Ryze-T/Sylas

image-20250909210658693

  • RequestTemplate-图形化(项目已经没了)
    https://github.com/1n7erface/RequestTemplate

image-20250909210814173

  • Databasetools-命令行
    https://github.com/Hel10-Web/Databasetools

image-20250909210925070

利用数据库自动化提权项目时可能需要解决不支持外联问题

1
2
-利用已知Web权限建立代理节点,然后自动化提权项目在连接这个代理节点(等同于本地连接)
-利用已知权限执行SQL开启外联(让数据库支持外联)

MYSQL(默认不支持不外联)

1
2
GRANT ALL PRIVILEGES ON *.* TO '帐号'@'%' IDENTIFIED BY '密码' WITH GRANT OPTION;
flush privileges;

MSSQL(默认支持外联)

1
2
3
4
EXEC sp_configure 'show advanced options', 1;
RECONFIGURE;
EXEC sp_configure 'Ad Hoc Distributed Queries', 1;
RECONFIGURE;

Oracle(默认支持外联)

1
2
3
ALTER SYSTEM SET REMOTE_LOGIN_PASSWORDFILE=EXCLUSIVE SCOPE=SPFILE;
SHUTDOWN IMMEDIATE;
STARTUP;

演示案例-Web到Win-数据库提权-MYSQL(默认3306端口)

1
2
3
MYSQL:PHP+MYSQL 以web入口提权
条件:ROOT密码(高版本的-secure-file-priv没有进行目录限制,如果进行了目录限制就会导致提权失败)
技术:UDF MOF(win2008之后就用不了) 启动项 反弹Shell

image-20250909210409755

image-20250909210434756

image-20250909210449024

image-20250909210522101

MDUT

image-20250909211133884

image-20250909211210476

image-20250909211146972

image-20250909211200225

image-20250909211226298

image-20250909211243024

image-20250909211254661

image-20250909211259505

RequestTemplate

image-20250909211313903

image-20250909211319373

image-20250909211325423

image-20250909211334139

image-20250909211348740

image-20250909211353890

image-20250909211358816

image-20250909211409413

image-20250909211416148

image-20250909211422054

演示案例-Web到Win-数据库提权-MSSQL(默认1433端口)

1
2
3
MSSQL:.NET+MSSQL 以web入口提权
条件:sa密码
技术:xp_cmdshell sp_oacreate CLR 沙盒

image-20250909211502588

image-20250909211509211

image-20250909211513685

MDUT

image-20250909211529183

image-20250909211534244

image-20250909211543480

image-20250909211552546

image-20250909211559729

image-20250909211606785

image-20250909211614050

RequestTemplate

image-20250909211620769

image-20250909211634068

image-20250909211639409

image-20250909211645164

image-20250909211650224

image-20250909211654712

image-20250909211713653

image-20250909211719567

image-20250909211724472

image-20250909211734488

image-20250909211741276

演示案例-Web到Win-数据库提权-ORACLE(默认1521端口)

1
2
3
Oracle:(站库分离,非JSP,直接数据库到系统等)
条件:数据库用户密码
技术:DBA,普通用户,注入模式

image-20250909211808242

oracleshell

https://github.com/jas502n/oracleShell

image-20250909211824566

image-20250909211829311

image-20250909211835649

image-20250909211841311

image-20250909211845363

当然也可以使用其他数据库自动化提权项目