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-b9f4589650daunstable
parent
a127213a70
commit
0d1098e6bf
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue