From e75287875b1fe54a35fc1b8bbb686d409f1bdbd7 Mon Sep 17 00:00:00 2001 From: Brent Cook Date: Mon, 22 Jun 2015 20:41:58 -0500 Subject: [PATCH] hack android-specific commands back to life --- data/meterpreter/ext_server_android.jar | 0 lib/msf/base/sessions/meterpreter_android.rb | 7 +++++++ lib/msf/base/sessions/meterpreter_options.rb | 6 ++++++ 3 files changed, 13 insertions(+) create mode 100644 data/meterpreter/ext_server_android.jar diff --git a/data/meterpreter/ext_server_android.jar b/data/meterpreter/ext_server_android.jar new file mode 100644 index 0000000000..e69de29bb2 diff --git a/lib/msf/base/sessions/meterpreter_android.rb b/lib/msf/base/sessions/meterpreter_android.rb index 01080744d3..5728ddd036 100644 --- a/lib/msf/base/sessions/meterpreter_android.rb +++ b/lib/msf/base/sessions/meterpreter_android.rb @@ -19,6 +19,13 @@ class Meterpreter_Java_Android < Msf::Sessions::Meterpreter_Java_Java 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 b070950371..0d8c7b3b70 100644 --- a/lib/msf/base/sessions/meterpreter_options.rb +++ b/lib/msf/base/sessions/meterpreter_options.rb @@ -65,6 +65,12 @@ module MeterpreterOptions end end + if session.platform =~ /android/i + if datastore['AutoLoadAndroid'] + session.load_android + end + end + [ 'InitialAutoRunScript', 'AutoRunScript' ].each do |key| if (datastore[key].empty? == false) args = Shellwords.shellwords( datastore[key] )