For the complete documentation index, see llms.txt. This page is also available as Markdown.

MS09-050 SMB

Windows Server 2008 SP1 with SMBv2 can be vulnerable to CVE-2009-3103 / MS09-050. On the observed target, replacing the shellcode in a public PoC and running it against TCP/445 opened a Meterpreter session as NT AUTHORITY\SYSTEM.

Discovery

Nmap identified Windows Server 2008 SP1 over SMB:

445/tcp open  microsoft-ds  Windows Server (R) 2008 Standard 6001 Service Pack 1 microsoft-ds

Useful SMB enumeration:

nmap -sV --script smb-enum-shares,smb-enum-users,smb-os-discovery -p139,445 TARGET
python3 enum4linux-ng.py TARGET

Useful indicators:

OS: Windows Server (R) 2008 Standard 6001 Service Pack 1
NetBIOS computer name: INTERNAL
Workgroup: WORKGROUP
SMB 1.0: true
SMB 2.0.2: true
SMB signing required: false

Vulnerability Check

Run nmap's vuln scripts or the specific SMBv2 check:

sudo nmap -sVC -vvv TARGET --script vuln
nmap --script smb-vuln-cve2009-3103 -p445 TARGET

Expected finding:

Exploitation

Get the PoC:

Generate a Python-formatted Meterpreter payload:

The PoC uses a variable named shell, so replace its shellcode with the generated buf lines renamed to shell:

Start a handler:

Run the PoC:

Successful session:

Confirm context:

Last updated