diff --git a/lib/msf/base/sessions/meterpreter_android.rb b/lib/msf/base/sessions/meterpreter_android.rb index 6727bfd81b49..f3417ae8c7d8 100644 --- a/lib/msf/base/sessions/meterpreter_android.rb +++ b/lib/msf/base/sessions/meterpreter_android.rb @@ -14,22 +14,18 @@ module Sessions ### class Meterpreter_Java_Android < Msf::Sessions::Meterpreter_Java_Java - def supports_ssl? - false - end - def supports_zlib? - false - end def initialize(rstream, opts={}) super self.platform = 'java/android' end + def load_android original = console.disable_output console.disable_output = true console.run_single('load android') console.disable_output = original end + end end diff --git a/lib/msf/base/sessions/meterpreter_options.rb b/lib/msf/base/sessions/meterpreter_options.rb index 2a02ad9aa7b5..f9d60d30b8b7 100644 --- a/lib/msf/base/sessions/meterpreter_options.rb +++ b/lib/msf/base/sessions/meterpreter_options.rb @@ -60,7 +60,7 @@ def on_session(session) end if session.platform =~ /android/i - if (datastore['AutoLoadAndroid']) + if datastore['AutoLoadAndroid'] session.load_android end end diff --git a/lib/rex/post/meterpreter/ui/console/command_dispatcher/android.rb b/lib/rex/post/meterpreter/ui/console/command_dispatcher/android.rb index c540a2b01fa2..a31638bc61f6 100644 --- a/lib/rex/post/meterpreter/ui/console/command_dispatcher/android.rb +++ b/lib/rex/post/meterpreter/ui/console/command_dispatcher/android.rb @@ -15,10 +15,6 @@ module Ui class Console::CommandDispatcher::Android include Console::CommandDispatcher include Msf::Auxiliary::Report - - def framework - client.framework - end # # List of supported commands. @@ -35,18 +31,17 @@ def commands reqs = { 'dump_sms' => [ 'dump_sms' ], - 'dump_contacts' => [ 'dump_contacts'], - 'geolocate' => [ 'geolocate'], - 'dump_calllog' => [ 'dump_calllog'], - 'check_root' => [ 'check_root'], + 'dump_contacts' => [ 'dump_contacts' ], + 'geolocate' => [ 'geolocate' ], + 'dump_calllog' => [ 'dump_calllog' ], + 'check_root' => [ 'check_root' ], 'device_shutdown' => [ 'device_shutdown'] } + # Ensure any requirements of the command are met all.delete_if do |cmd, desc| reqs[cmd].any? { |req| not client.commands.include?(req) } end - - all end def cmd_device_shutdown(*args) @@ -55,7 +50,7 @@ def cmd_device_shutdown(*args) device_shutdown_opts = Rex::Parser::Arguments.new( '-h' => [ false, 'Help Banner' ], '-t' => [ false, 'Shutdown after n seconds'] - ) + ) device_shutdown_opts.parse(args) { | opt, idx, val | case opt @@ -98,7 +93,7 @@ def cmd_dump_sms(*args) end } - smsList = Array.new + smsList = [] smsList = client.android.dump_sms if smsList.count > 0 @@ -106,7 +101,7 @@ def cmd_dump_sms(*args) begin info = client.sys.config.sysinfo - data = String::new + data = "" data << "\n=====================\n" data << "[+] Sms messages dump\n" data << "=====================\n\n" @@ -191,7 +186,7 @@ def cmd_dump_contacts(*args) end } - contactList = Array.new + contactList = [] contactList = client.android.dump_contacts if contactList.count > 0 @@ -199,7 +194,7 @@ def cmd_dump_contacts(*args) begin info = client.sys.config.sysinfo - data = String::new + data = "" data << "\n======================\n" data << "[+] Contacts list dump\n" data << "======================\n\n" @@ -273,7 +268,6 @@ def cmd_geolocate(*args) print_line("\tLongitude: #{geo[0]['long']}\n") print_line("To get the address: https://maps.googleapis.com/maps/api/geocode/json?latlng=#{geo[0]['lat'].to_f},#{geo[0]['long'].to_f}&sensor=true\n") - if generate_map link = "https://maps.google.com/maps?q=#{geo[0]['lat'].to_f},#{geo[0]['long'].to_f}" print_status("Generated map on google-maps:") @@ -312,7 +306,7 @@ def cmd_dump_calllog(*args) begin info = client.sys.config.sysinfo - data = String::new + data = "" data << "\n=================\n" data << "[+] Call log dump\n" data << "=================\n\n" @@ -368,7 +362,7 @@ def cmd_check_root(*args) is_rooted = client.android.check_root if is_rooted - print_status('Device is rooted') + print_good('Device is rooted') elsif print_status('Device is not rooted') end