Skip to content

Commit 3fad756

Browse files
committed
Final touches to make MSF happy with all refactorings
1 parent 834756c commit 3fad756

File tree

6 files changed

+55
-38
lines changed

6 files changed

+55
-38
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# -*- coding: binary -*-
2+
3+
require 'msf/core'
4+
require 'msf/core/payload/transport_config'
5+
6+
module Msf
7+
8+
###
9+
#
10+
# Complex payload generation for Android that speaks TCP
11+
#
12+
###
13+
14+
module Payload::Android::ReverseTcp
15+
16+
include Msf::Payload::TransportConfig
17+
include Msf::Payload::Android
18+
19+
#
20+
# Generate the transport-specific configuration
21+
#
22+
def transport_config(opts={})
23+
transport_config_reverse_tcp(opts)
24+
end
25+
26+
end
27+
end
28+

modules/payloads/stagers/android/reverse_http.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ module MetasploitModule
1515
include Msf::Payload::Stager
1616
include Msf::Payload::Android
1717
include Msf::Payload::Android::ReverseHttp
18-
include Msf::Payload::UUID::Options
1918

2019
def initialize(info = {})
2120
super(merge_info(info,

modules/payloads/stagers/android/reverse_https.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ module MetasploitModule
1414

1515
include Msf::Payload::Stager
1616
include Msf::Payload::Android
17-
include Msf::Payload::Android::ReverseHttps
17+
include Msf::Payload::Android::ReverseHttp
1818

1919
def initialize(info = {})
2020
super(merge_info(info,
@@ -25,6 +25,7 @@ def initialize(info = {})
2525
'Platform' => 'android',
2626
'Arch' => ARCH_DALVIK,
2727
'Handler' => Msf::Handler::ReverseHttps,
28+
'Convention' => 'javaurl',
2829
'Stager' => {'Payload' => ''}
2930
))
3031
end

modules/payloads/stagers/android/reverse_tcp.rb

Lines changed: 12 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -3,40 +3,29 @@
33
# Current source: https://github.com/rapid7/metasploit-framework
44
##
55

6-
require 'metasploit-payloads'
76
require 'msf/core'
87
require 'msf/core/handler/reverse_tcp'
9-
require 'msf/core/payload/transport_config'
10-
require 'msf/base/sessions/command_shell'
11-
require 'msf/base/sessions/command_shell_options'
8+
require 'msf/core/payload/android/reverse_tcp'
129

1310
module MetasploitModule
1411

1512
CachedSize = :dynamic
1613

1714
include Msf::Payload::Stager
18-
include Msf::Payload::TransportConfig
1915
include Msf::Payload::Android
20-
include Msf::Payload::UUID::Options
16+
include Msf::Payload::Android::ReverseTcp
2117

2218
def initialize(info = {})
2319
super(merge_info(info,
24-
'Name' => 'Android Reverse TCP Stager',
25-
'Description' => 'Connect back stager',
26-
'Author' => ['timwr', 'OJ Reeves'],
27-
'License' => MSF_LICENSE,
28-
'Platform' => 'android',
29-
'Arch' => ARCH_DALVIK,
30-
'Handler' => Msf::Handler::ReverseTcp,
31-
'Stager' => {'Payload' => ''}
32-
))
20+
'Name' => 'Android Reverse TCP Stager',
21+
'Description' => 'Connect back stager',
22+
'Author' => ['mihi', 'egypt'],
23+
'License' => MSF_LICENSE,
24+
'Platform' => 'android',
25+
'Arch' => ARCH_DALVIK,
26+
'Handler' => Msf::Handler::ReverseTcp,
27+
'Convention' => 'javasocket',
28+
'Stager' => {'Payload' => ''}
29+
))
3330
end
34-
35-
#
36-
# Generate the transport-specific configuration
37-
#
38-
def transport_config(opts={})
39-
transport_config_reverse_tcp(opts)
40-
end
41-
4231
end

modules/payloads/stagers/java/reverse_tcp.rb

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@ module MetasploitModule
1717

1818
def initialize(info = {})
1919
super(merge_info(info,
20-
'Name' => 'Java Reverse TCP Stager',
21-
'Description' => 'Connect back stager',
22-
'Author' => ['mihi', 'egypt'],
23-
'License' => MSF_LICENSE,
24-
'Platform' => 'java',
25-
'Arch' => ARCH_JAVA,
26-
'Handler' => Msf::Handler::ReverseTcp,
27-
'Convention' => 'javasocket',
28-
'Stager' => {'Payload' => ''}
29-
))
20+
'Name' => 'Java Reverse TCP Stager',
21+
'Description' => 'Connect back stager',
22+
'Author' => ['mihi', 'egypt'],
23+
'License' => MSF_LICENSE,
24+
'Platform' => 'java',
25+
'Arch' => ARCH_JAVA,
26+
'Handler' => Msf::Handler::ReverseTcp,
27+
'Convention' => 'javasocket',
28+
'Stager' => {'Payload' => ''}
29+
))
3030
end
3131
end

modules/payloads/stages/android/meterpreter.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
require 'msf/core/payload/android/meterpreter_loader'
99
require 'msf/base/sessions/meterpreter_android'
1010
require 'msf/base/sessions/meterpreter_options'
11-
require 'rex/payloads/meterpreter/config'
11+
1212

1313
module MetasploitModule
1414

@@ -18,8 +18,8 @@ module MetasploitModule
1818
def initialize(info = {})
1919
super(update_info(info,
2020
'Name' => 'Android Meterpreter',
21-
'Description' => 'Run a meterpreter server on Android',
22-
'Author' => ['mihi', 'egypt', 'anwarelmakrahy', 'OJ Reeves'],
21+
'Description' => 'Run a meterpreter server in Android',
22+
'Author' => ['mihi', 'egypt', 'OJ Reeves'],
2323
'Platform' => 'android',
2424
'Arch' => ARCH_DALVIK,
2525
'PayloadCompat' => {'Convention' => 'javasocket javaurl'},

0 commit comments

Comments
 (0)