Skip to content

Commit 38a4c2a

Browse files
David MaloneyDavid Maloney
authored andcommitted
fix autotargeting failure
the fallback to the original default was failing because it was assuming rhost was already set, so it would always go back to the first default target. now the auto_target? method only returns true if can pull an auto_target_host
1 parent 18347a8 commit 38a4c2a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/msf/core/exploit/auto_target.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ module Exploit::AutoTarget
1111
def auto_target?
1212
selected_target = targets[target_index]
1313
return false if selected_target.nil?
14-
if selected_target.name =~ /Automatic/ && selected_target['AutoGenerated'] == true
14+
if selected_target.name =~ /Automatic/ && selected_target['AutoGenerated'] == true && auto_target_host
1515
true
1616
else
1717
false

0 commit comments

Comments
 (0)