File tree Expand file tree Collapse file tree 2 files changed +5
-1
lines changed
spec/lib/msf/core/exploit Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ module Exploit::AutoTarget
11
11
def auto_target?
12
12
selected_target = targets [ target_index ]
13
13
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
15
15
true
16
16
else
17
17
false
Original file line number Diff line number Diff line change 48
48
49
49
describe '#auto_target?' do
50
50
it 'should return true if the automatic target is selected' do
51
+ host_addr = '192.168.1.5'
52
+ host_obj = FactoryGirl . create ( :mdm_host , address : host_addr )
51
53
windows_exploit . datastore [ 'TARGET' ] = 0
54
+ windows_exploit . datastore [ 'WORKSPACE' ] = host_obj . workspace . name
55
+ windows_exploit . datastore [ 'RHOST' ] = host_addr
52
56
expect ( windows_exploit . auto_target? ) . to be true
53
57
end
54
58
You can’t perform that action at this time.
0 commit comments