Skip to content

Commit 8812285

Browse files
committed
Move print of my_target.name to after nil check
Avoids "Exception handling request: undefined method `name' for nil:NilClass" when we don't have a target for the connecting browser. [FixRM rapid7#7593]
1 parent c66777d commit 8812285

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

modules/exploits/windows/browser/adobe_flash_otf_font.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,6 @@ def get_target(agent)
159159
def on_request_uri(cli, request)
160160
agent = request.headers['User-Agent']
161161
my_target = get_target(agent)
162-
print_status("Target selected: #{my_target.name}")
163-
print_status("Client requesting: #{request.uri}")
164162

165163
# Avoid the attack if the victim doesn't have the same setup we're targeting
166164
if my_target.nil?
@@ -169,6 +167,9 @@ def on_request_uri(cli, request)
169167
return
170168
end
171169

170+
print_status("Target selected: #{my_target.name}")
171+
print_status("Client requesting: #{request.uri}")
172+
172173
# The SWF request itself
173174
if request.uri =~ /\.swf$/
174175
print_status("Sending SWF")

0 commit comments

Comments
 (0)