Skip to content

Commit 2108913

Browse files
David MaloneyDavid Maloney
authored andcommitted
target_host method had a name collision
this method appears to have been accidentaly overriding another method causing sessions to never finish being established
1 parent 969df40 commit 2108913

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

lib/msf/core/exploit/auto_target.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def auto_targeted_index
3838
# @return [Msf::Module::Target] the Target that our automatic routine selected
3939
def select_target
4040
return nil unless auto_target?
41-
host_record = target_host
41+
host_record = auto_target_host
4242
return nil if host_record.nil?
4343
filtered_targets = filter_by_os(host_record)
4444
filtered_targets.first
@@ -48,7 +48,7 @@ def select_target
4848
#
4949
# @return [Mdm:Host] the Host record if one exists
5050
# @return [nil] if no Host record is present, or the DB is not active
51-
def target_host
51+
def auto_target_host
5252
return nil unless self.respond_to?(:rhost)
5353
return nil unless framework.db.active
5454
current_workspace = framework.db.find_workspace(self.workspace)

spec/lib/msf/core/exploit/auto_target_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,12 @@
6969
host_obj = FactoryGirl.create(:mdm_host, address: host_addr )
7070
windows_exploit.datastore['WORKSPACE'] = host_obj.workspace.name
7171
windows_exploit.datastore['RHOST'] = host_addr
72-
expect(windows_exploit.target_host).to eq host_obj
72+
expect(windows_exploit.auto_target_host).to eq host_obj
7373
end
7474

7575
it 'should return nil if there is not one' do
7676
windows_exploit.datastore['RHOST'] = '192.168.111.115'
77-
expect(windows_exploit.target_host).to be_nil
77+
expect(windows_exploit.auto_target_host).to be_nil
7878
end
7979
end
8080

0 commit comments

Comments
 (0)