Skip to content

Commit c52b728

Browse files
committed
Merge branch 'android_ext2' of github.com:AnwarMohamed/metasploit-framework into anwar-android-bins
2 parents 27444e6 + c2be3d6 commit c52b728

File tree

6 files changed

+18
-23
lines changed

6 files changed

+18
-23
lines changed

lib/msf/base/sessions/meterpreter_android.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# -*- coding: binary -*-
22

33
require 'msf/base/sessions/meterpreter'
4+
require 'msf/base/sessions/meterpreter_java'
45
require 'msf/base/sessions/meterpreter_options'
56

67
module Msf

lib/msf/base/sessions/meterpreter_java.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ module Sessions
1111
#
1212
###
1313
class Meterpreter_Java_Java < Msf::Sessions::Meterpreter
14-
1514
def supports_ssl?
1615
false
1716
end

lib/msf/base/sessions/meterpreter_options.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,12 @@ def on_session(session)
5959
end
6060
end
6161

62+
if session.platform =~ /android/i
63+
if (datastore['AutoLoadAndroid'])
64+
session.load_android
65+
end
66+
end
67+
6268
[ 'InitialAutoRunScript', 'AutoRunScript' ].each do |key|
6369
if (datastore[key].empty? == false)
6470
args = Shellwords.shellwords( datastore[key] )

lib/rex/post/meterpreter/extensions/android/android.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#!/usr/bin/env ruby
22
# -*- coding: binary -*-
3-
43
require 'rex/post/meterpreter/extensions/android/tlv'
54
require 'rex/post/meterpreter/packet'
65
require 'rex/post/meterpreter/client'
@@ -120,7 +119,6 @@ def check_root
120119
response = client.send_request(request)
121120
response.get_tlv(TLV_TYPE_CHECK_ROOT_BOOL).value
122121
end
123-
124122
end
125123

126124
end

lib/rex/post/meterpreter/ui/console/command_dispatcher/android.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -*- coding: binary -*-
2-
require 'msf/core'
32
require 'rex/post/meterpreter'
3+
require 'msf/core/auxiliary/report'
44

55
module Rex
66
module Post
@@ -15,9 +15,9 @@ module Ui
1515
class Console::CommandDispatcher::Android
1616
include Console::CommandDispatcher
1717
include Msf::Auxiliary::Report
18-
19-
def initialize(shell)
20-
super
18+
19+
def framework
20+
client.framework
2121
end
2222

2323
#

modules/payloads/stages/android/meterpreter.rb

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,17 @@ module Metasploit3
1414

1515
def initialize(info = {})
1616
super(update_info(info,
17-
'Name' => 'Android Meterpreter',
18-
'Description' => 'Run a meterpreter server on Android',
19-
'Author' => [
17+
'Name' => 'Android Meterpreter',
18+
'Description' => 'Run a meterpreter server on Android',
19+
'Author' => [
2020
'mihi', # all the hard work
2121
'egypt', # msf integration
2222
'anwarelmakrahy' # android extension
2323
],
24-
'Platform' => 'android',
25-
'Arch' => ARCH_DALVIK,
26-
'License' => MSF_LICENSE,
27-
'Session' => Msf::Sessions::Meterpreter_Java_Android))
24+
'Platform' => 'android',
25+
'Arch' => ARCH_DALVIK,
26+
'License' => MSF_LICENSE,
27+
'Session' => Msf::Sessions::Meterpreter_Java_Android))
2828

2929
register_options(
3030
[
@@ -48,13 +48,4 @@ def generate_stage
4848
# it from, and then finally the meterpreter stage
4949
java_string(clazz) + java_string(metstage) + java_string(met)
5050
end
51-
52-
def on_session(session)
53-
super
54-
framework.sessions.schedule Proc.new {
55-
if (datastore['AutoLoadAndroid'])
56-
session.load_android
57-
end
58-
}
59-
end
6051
end

0 commit comments

Comments
 (0)