SMB


Nmap discovered a Windows Directory service on the target ports 139, and 445 The running service is Windows 7 Ultimate N 7600 microsoft-ds

┌──(kali㉿kali)-[~/PEN-200/PG_PRACTICE/kevin]
└─$ nmap --script smb-enum-shares -sV -p139,445 $IP
Starting Nmap 7.95 ( https://nmap.org ) at 2025-02-27 18:54 CET
Nmap scan report for 192.168.221.45
Host is up (0.020s latency).
 
PORT    STATE SERVICE      VERSION
139/tcp open  netbios-ssn  Microsoft Windows netbios-ssn
445/tcp open  microsoft-ds Microsoft Windows 7 - 10 microsoft-ds (workgroup: WORKGROUP)
Service Info: Host: KEVIN; OS: Windows; CPE: cpe:/o:microsoft:windows
 
Host script results:
| smb-enum-shares: 
|   note: ERROR: Enumerating shares failed, guessing at common ones (NT_STATUS_ACCESS_DENIED)
|   account_used: <blank>
|   \\192.168.221.45\ADMIN$: 
|     warning: Couldn't get details for share: NT_STATUS_ACCESS_DENIED
|     Anonymous access: <none>
|   \\192.168.221.45\C$: 
|     warning: Couldn't get details for share: NT_STATUS_ACCESS_DENIED
|     Anonymous access: <none>
|   \\192.168.221.45\IPC$: 
|     warning: Couldn't get details for share: NT_STATUS_ACCESS_DENIED
|     Anonymous access: READ
|   \\192.168.221.45\USERS: 
|     warning: Couldn't get details for share: NT_STATUS_ACCESS_DENIED
|_    Anonymous access: <none>
 
Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 24.31 seconds

Mapping SMB shares failed

┌──(kali㉿kali)-[~/PEN-200/PG_PRACTICE/kevin]
└─$ nxc smb $IP -u '' -p '' --shares --interfaces 
SMB         192.168.221.45  445    KEVIN            [*] Windows 7 Ultimate N 7600 x32 (name:KEVIN) (domain:kevin) (signing:False) (SMBv1:True)
SMB         192.168.221.45  445    KEVIN            [+] kevin\: 
SMB         192.168.221.45  445    KEVIN            [-] Error enumerating shares: STATUS_ACCESS_DENIED

It would appear that anonymous access is not allowed

Vulnerabilities


┌──(kali㉿kali)-[~/PEN-200/PG_PRACTICE/kevin]
└─$ nmap --script smb-vuln* -sV -p139,445 $IP      
Starting Nmap 7.95 ( https://nmap.org ) at 2025-02-27 18:55 CET
Nmap scan report for 192.168.221.45
Host is up (0.018s latency).
 
PORT    STATE SERVICE      VERSION
139/tcp open  netbios-ssn  Microsoft Windows netbios-ssn
445/tcp open  microsoft-ds Microsoft Windows 7 - 10 microsoft-ds (workgroup: WORKGROUP)
Service Info: Host: KEVIN; OS: Windows; CPE: cpe:/o:microsoft:windows
 
Host script results:
| 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/
|_smb-vuln-ms10-054: false
|_smb-vuln-ms10-061: NT_STATUS_ACCESS_DENIED
 
Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 11.52 seconds

The target Windows Directory server appears to be vulnerable to the infamous EternalBlue

┌──(kali㉿kali)-[~/PEN-200/PG_PRACTICE/kevin/MS17-010]
└─$ python2 checker.py $IP        
Target OS: Windows 7 Ultimate N 7600
The target is not patched
 
=== Testing named pipes ===
spoolss: STATUS_ACCESS_DENIED
samr: STATUS_ACCESS_DENIED
netlogon: STATUS_ACCESS_DENIED
lsarpc: STATUS_ACCESS_DENIED
browser: STATUS_ACCESS_DENIED

Exploitation appears to require a valid credential