Make the SMB connect() method take an optional 'global' argument, allows for secondary SMB connections

git-svn-id: file:///home/svn/framework3/trunk@7053 4d416f70-5f16-0410-b530-b9f4589650da
unstable
HD Moore 2009-09-22 21:26:20 +00:00
parent a127213a70
commit 0d1098e6bf
1 changed files with 11 additions and 7 deletions

View File

@ -59,16 +59,17 @@ module Exploit::Remote::SMB
], Msf::Exploit::Remote::SMB)
end
def connect()
def connect(global=true)
disconnect()
disconnect() if global
super
s = super(global)
self.sock = s if global
# Make sure that SMBDirect is false when RPORT is 139
direct = smb_direct
direct = false if rport.to_i == 139
self.simple = SIMPLE.new(self.sock, direct)
c = SIMPLE.new(s, direct)
# setup pipe evasion foo
if datastore['SMB::pipe_evasion']
@ -76,16 +77,19 @@ module Exploit::Remote::SMB
end
if (datastore['SMB::pad_data_level'])
self.simple.client.evasion_opts['pad_data'] = datastore['SMB::pad_data_level']
c.client.evasion_opts['pad_data'] = datastore['SMB::pad_data_level']
end
if (datastore['SMB::pad_file_level'])
self.simple.client.evasion_opts['pad_file'] = datastore['SMB::pad_file_level']
c.client.evasion_opts['pad_file'] = datastore['SMB::pad_file_level']
end
if (datastore['SMB::obscure_trans_pipe_level'])
self.simple.client.evasion_opts['obscure_trans_pipe'] = datastore['SMB::obscure_trans_pipe_level']
c.client.evasion_opts['obscure_trans_pipe'] = datastore['SMB::obscure_trans_pipe_level']
end
self.simple = c if global
c
end
# Convert a standard ASCII string to 16-bit Unicode