Skip to content

Commit 3632cc4

Browse files
committed
Fix nil error when target not found
1 parent 1bfa84b commit 3632cc4

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

modules/exploits/windows/browser/mozilla_reduceright.rb

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,17 +88,21 @@ def junk(n=4)
8888
def on_request_uri(cli, request)
8989
agent = request.headers['User-Agent']
9090
if agent !~ /Firefox\/3\.6\.(16|17)/
91-
print_error("This browser is not supported: #{agent.to_s}")
91+
print_error("This browser is not supported: #{agent}")
9292
send_not_found(cli)
9393
return
9494
end
9595

9696
my_target = target
9797
if my_target.name == 'Automatic'
98-
if agent =~ /NT 5\.1/ and agent =~ /Firefox\/3\.6\.16/
98+
if agent =~ /NT 5\.1/ && agent =~ /Firefox\/3\.6\.16/
9999
my_target = targets[1]
100-
elsif agent =~ /NT 6\.1/ and agent =~ /Firefox\/3\.6\.16/
100+
elsif agent =~ /NT 6\.[01]/ && agent =~ /Firefox\/3\.6\.16/
101101
my_target = targets[2]
102+
else
103+
print_error("This browser is not a viable target: #{agent}")
104+
send_not_found(cli)
105+
return
102106
end
103107
end
104108

0 commit comments

Comments
 (0)