We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9dc4ee5 commit 31d36d9Copy full SHA for 31d36d9
lib/msf/core/exploit.rb
@@ -689,10 +689,17 @@ def passive?
689
#
690
def target
691
if self.respond_to?(:auto_targeted_index)
692
- auto_idx = auto_targeted_index
693
- if auto_idx.present?
694
- datastore['TARGET'] = auto_idx
+ if auto_target?
+ auto_idx = auto_targeted_index
+ if auto_idx.present?
695
+ datastore['TARGET'] = auto_idx
696
+ else
697
+ # If our inserted Automatic Target was selected but we failed to
698
+ # find a suitable target, we just grab the original first target.
699
+ datastore['TARGET'] = 1
700
+ end
701
end
702
+
703
704
705
target_idx = target_index
0 commit comments