免责声明:本文提及的安全环境、工具和方法等仅供试用及教学用途,禁止非法使用,请与24小时内删除!
前言
在前面得文章提到这么拿下棋牌得服务器frp过来cs上线一起打牌吧,现在发现使用ms17-015烂土豆提权也不是万能得,多学几招防防身也是不错的
前因
遇到一个情况,通过烂土豆提权后,当时提权是没有什么问题。甚至创建用户、提升新建用户为管理员组、查看进程等信息,都没有什么问题,,但是在msf可能会遇到执行命令超时,当时以为已经提升的用户权限,实际上是没有,或许是frp有时候不够稳定。当登录服务器的时候,才发现无论是新建用户,还是想运行什么的软件,发现拒绝访问。经查看,明显的权限不足。于是有了这期本地提权
贴几条提权常用的命令
net user test 123456 /add //新建名为test密码为123456的用户
net localgroup administrator test /add //把test用户提升为管理员组
net start TermServicenet stop TermService //开启远程桌面服务
netstat -ano //查看端口占用情况
REG ADD HKLMSYSTEMCurrentControlSetControlTerminal" "Server /v fDenyTSConnections /t REG_DWORD /d 00000000 /f //开启3389端口
REG ADD HKLMSYSTEMCurrentControlSetControlTerminal" "Server /v fDenyTSConnections /t REG_DWORD /d 11111111 /f //关闭3389端口
可能遇到开启了远程桌面服务,但是服务不是在3389端口,可以这么查询
tasklist /svc | findstr TermService //查看远程桌面服务
netstat -ano | findstr **** //查找****的信息,其中***为上一条命令查找到的id
言归正传,把上面的问题解决先。
先查看系统的补丁信息
Systeminfo //能获取补丁号信息,但是信息也不是很详细
wmic qfe list //获取完整的补丁信息
后果
本地复现,复现环境Windows 2008 R2
一、CVE-2015-1710
项目地址:
https://github.com/hfiref0x/CVE-2015-1701
影响范围:
Windows Server 2003
Windows Vista
Windows Server 2008
Windows 7
Windows Server 2008 R2
Windows 8 和 Windows 8.1
Windows Server 2012 和 Windows Server 2012 R2
Windows RT 和 Windows RT 8.1
先新建一个普通用户
然后切换用户登录,把下载好的文件上传(这里我查看了系统信息是64位的,按实际情况来使用)
直接双击打开exe文件,直接就是system权限了,在窗口能够执行的命令就更多了
二、CVE-2018-8639
项目地址:
https://github.com/timwhitez/CVE-2018-8639-EXP
影响范围:
Windows 7
Windows Server 2012 R2
Windows RT 8.1
Windows Server 2008
Windows Server 2019
Windows Server 2012
Windows 8.1
Windows Server 2016
Windows Server 2008 R2
Windows 10 1607、1703、1709、1803、1809
同上,新建用户,切换,上传文件,执行
CVE-2018-8639-EXP “***” //***为需要执行的命令,缺点,每次都需要这样去执行,不能一次提权
三、CVE-2019-0803
项目地址:
https://github.com/yedada-wei/Kernelhub/tree/master/CVE-2019-0803
影响范围:
Microsoft Windows Server 2019 0
Microsoft Windows Server 2016 0
Microsoft Windows Server 2012 R2 0
Microsoft Windows Server 2012 0
Microsoft Windows Server 2008 R2 for x64-based Systems SP1
Microsoft Windows Server 2008 R2 for Itanium-based Systems SP1
Microsoft Windows Server 2008 for x64-based Systems SP2
Microsoft Windows Server 2008 for Itanium-based Systems SP2
Microsoft Windows Server 2008 for 32-bit Systems SP2
Microsoft Windows Server 1803 0
Microsoft Windows Server 1709 0
Microsoft Windows RT 8.1
Microsoft Windows 8.1 for x64-based Systems 0
Microsoft Windows 8.1 for 32-bit Systems 0
Microsoft Windows 7 for x64-based Systems SP1
Microsoft Windows 7 for 32-bit Systems SP1
Microsoft Windows 10 Version 1809 for x64-based Systems 0
Microsoft Windows 10 Version 1809 for ARM64-based Systems 0
Microsoft Windows 10 Version 1809 for 32-bit Systems 0
Microsoft Windows 10 Version 1803 for x64-based Systems 0
Microsoft Windows 10 Version 1803 for ARM64-based Systems 0
Microsoft Windows 10 Version 1803 for 32-bit Systems 0
Microsoft Windows 10 version 1709 for x64-based Systems 0
Microsoft Windows 10 Version 1709 for ARM64-based Systems 0
Microsoft Windows 10 version 1709 for 32-bit Systems 0
Microsoft Windows 10 version 1703 for x64-based Systems 0
Microsoft Windows 10 version 1703 for 32-bit Systems 0
Microsoft Windows 10 Version 1607 for x64-based Systems 0
Microsoft Windows 10 Version 1607 for 32-bit Systems 0
Microsoft Windows 10 for x64-based Systems 0
Microsoft Windows 10 for 32-bit Systems 0
一样,新建用户,切换,上传文件,直接双击打开即可
最后
以上三种方法均是利用了windows win32k服务提权的漏洞,提权千万条,学到才是自己的
漏洞成因:Win32k.sys内核模式驱动程序没有正确处理内存对象,在实现上存在权限提升漏洞。漏洞危害:成功利用此漏洞可使攻击者在内核模式中运行任意代码。漏洞利用:攻击者必须具有有效的登录凭证,并且可以本地登录以利用此漏洞。
友情
tips:
补丁号有很多个,不同的系统补丁号不一样,有时新的补丁包含旧洞补丁旧的补丁号会被替换掉,所以每次提权都应该先到官方查看下对应补丁号。不要老是查询有没旧的补丁号,然后再去提权,没有旧的补丁号不代表没补。
不要忘了及时打补丁哦~
免责声明:本文提及的安全环境、工具和方法等仅供试用及教学用途,禁止非法使用,请与24小时内删除!
----------------------------------关注再走呗--------------------------------
本文始发于微信公众号(Tools杂货铺):复现几个Win本地提权
- 左青龙
- 微信扫一扫
-
- 右白虎
- 微信扫一扫
-
评论