From 6f8c7f092a2c91c51e44f5b73de5ce7233abd1c4 Mon Sep 17 00:00:00 2001 From: sinn3r Date: Thu, 7 Aug 2014 17:51:45 -0500 Subject: [PATCH] Fix direct datastore assignments to pass msftidy --- modules/auxiliary/scanner/smb/smb_enumusers.rb | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/modules/auxiliary/scanner/smb/smb_enumusers.rb b/modules/auxiliary/scanner/smb/smb_enumusers.rb index bef9a6374d..cc8d0e20e0 100644 --- a/modules/auxiliary/scanner/smb/smb_enumusers.rb +++ b/modules/auxiliary/scanner/smb/smb_enumusers.rb @@ -33,6 +33,14 @@ class Metasploit3 < Msf::Auxiliary deregister_options('RPORT', 'RHOST') end + def rport + @rport || datastore['RPORT'] + end + + def smbdirect + @smbdirect || datastore['SMBDirect'] + end + # Locate an available SMB PIPE for the specified service def smb_find_dcerpc_pipe(uuid, vers, pipes) found_pipe = nil @@ -132,8 +140,8 @@ class Metasploit3 < Msf::Auxiliary [[139, false], [445, true]].each do |info| - datastore['RPORT'] = info[0] - datastore['SMBDirect'] = info[1] + @rport = info[0] + @smbdirect = info[1] sam_pipe = nil sam_handle = nil @@ -291,7 +299,7 @@ class Metasploit3 < Msf::Auxiliary report_note( :host => ip, :proto => 'tcp', - :port => datastore['RPORT'], + :port => rport, :type => 'smb.domain.enumusers', :data => domains[domain] )