Skip to content

Commit 750b6fc

Browse files
committed
Land rapid7#3348, some Ruby warning fixes
2 parents dfab26e + c421b8e commit 750b6fc

12 files changed

+14
-27
lines changed

modules/exploits/windows/firewall/blackice_pam_icq.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def initialize(info = {})
3434
],
3535
'Payload' =>
3636
{
37-
'Space' => 504 -31 -4,
37+
'Space' => 504-31-4,
3838
'BadChars' => "\x00",
3939
'MinNops' => 0,
4040
'MaxNops' => 0,

modules/exploits/windows/misc/eureka_mail_err.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def initialize(info = {})
6565
end
6666

6767
def on_client_connect(client)
68-
return if ((p = regenerate_payload(client)) == nil)
68+
return unless regenerate_payload(client)
6969

7070
# the offset to eip depends on the local ip address string length...
7171
already = "Your POP3 server had a problem.\n"

modules/exploits/windows/misc/fb_svc_attach.rb

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,6 @@ def exploit_target(target)
7070

7171
connect
7272

73-
# Attach database
74-
op_attach = 19
75-
76-
# Create database
77-
op_create = 20
78-
7973
# Service attach
8074
op_service_attach = 82
8175

modules/exploits/windows/misc/ib_svc_attach.rb

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -115,12 +115,6 @@ def exploit_target(target)
115115

116116
connect
117117

118-
# Attach database
119-
op_attach = 19
120-
121-
# Create database
122-
op_create = 20
123-
124118
# Service attach
125119
op_service_attach = 82
126120

modules/exploits/windows/misc/ibm_director_cim_dllinject.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@ def on_request_uri(cli, request)
8585
end
8686

8787
# If there is no subdirectory in the request, we need to redirect.
88-
if (request.uri == '/') or not (request.uri =~ /\/[^\/]+\//)
89-
if (request.uri == '/')
88+
if request.uri == '/' || request.uri !~ /\/[^\/]+\//
89+
if request.uri == '/'
9090
subdir = '/' + rand_text_alphanumeric(8+rand(8)) + '/'
9191
else
9292
subdir = request.uri + '/'
@@ -128,7 +128,7 @@ def process_get(cli, request, target)
128128
# dispatch based on extension
129129
if (request.uri =~ /\.dll$/i)
130130
print_status("Sending DLL")
131-
return if ((p = regenerate_payload(cli)) == nil)
131+
return unless regenerate_payload(cli)
132132
dll_payload = generate_payload_dll
133133
send_response(cli, dll_payload, { 'Content-Type' => 'application/octet-stream' })
134134
else

modules/exploits/windows/misc/ibm_tsm_rca_dicugetidentify.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ def extract_port(buf)
9797
print_error("Insufficient data from CAD service.")
9898
return nil
9999
end
100-
rca_port = data[24,port_str_len].unpack('n*').pack('C*').to_i
100+
data[24,port_str_len].unpack('n*').pack('C*').to_i
101101
end
102102

103103

modules/exploits/windows/misc/mirc_privmsg_server.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def initialize(info = {})
5959
end
6060

6161
def on_client_connect(client)
62-
return if ((p = regenerate_payload(client)) == nil)
62+
return unless regenerate_payload(client)
6363
print_status("Client connected! Sending payload...")
6464
buffer = ":my_irc_server.com 001 wow :Welcome to the #{datastore['SRVNAME']} wow\r\n"
6565
client.put(buffer)

modules/exploits/windows/misc/poppeeper_date.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def on_client_connect(client)
6060
end
6161

6262
def on_client_data(client)
63-
return if ((p = regenerate_payload(client)) == nil)
63+
return unless regenerate_payload(client)
6464

6565
ok = "+OK\r\n"
6666
client.put(ok)

modules/exploits/windows/misc/talkative_response.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def on_client_connect(client)
5757
end
5858

5959
def on_client_data(client)
60-
return if ((p = regenerate_payload(client)) == nil)
60+
return unless regenerate_payload(client)
6161

6262
sploit = ":" + rand_text_alpha_upper(272) + Rex::Arch::X86.jmp_short(6)
6363
sploit << rand_text_alpha_upper(2) + [target.ret].pack('V') + payload.encoded

modules/exploits/windows/misc/wireshark_lua.rb

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,9 +128,6 @@ def process_propfind(cli, request)
128128
vprint_status("Received WebDAV PROPFIND request: #{path}")
129129
body = ''
130130

131-
my_host = (datastore['SRVHOST'] == '0.0.0.0') ? Rex::Socket.source_address(cli.peerhost) : datastore['SRVHOST']
132-
my_uri = "http://#{my_host}/"
133-
134131
if path !~ /\/$/
135132
if path.index(".")
136133
print_status("Sending 404 for #{path} ...")

0 commit comments

Comments
 (0)