Explicit mult-line match

unstable
HD Moore 2013-02-03 21:06:57 -06:00
parent 42c8a2d265
commit 0660347fca
1 changed files with 4 additions and 4 deletions

View File

@ -38,7 +38,7 @@ class Metasploit3 < Msf::Auxiliary
"ST:upnp:rootdevice\r\n" + "ST:upnp:rootdevice\r\n" +
"Man:\"ssdp:discover\"\r\n" + "Man:\"ssdp:discover\"\r\n" +
"MX:3\r\n" + "MX:3\r\n" +
"\r\n\r\n" # Non-standard, but helps "\r\n"
end end
def scanner_prescan(batch) def scanner_prescan(batch)
@ -144,14 +144,14 @@ class Metasploit3 < Msf::Auxiliary
} }
} }
if data =~ /^Server:[\s]*(.*)/i if data =~ /^Server:[\s]*(.*)/mi
@results[skey][:info][:server] = $1.strip @results[skey][:info][:server] = $1.strip
end end
ssdp_host = nil ssdp_host = nil
ssdp_port = 80 ssdp_port = 80
location_string = '' location_string = ''
if data =~ /^Location:[\s]*(.*)/i if data =~ /^Location:[\s]*(.*)/mi
location_string = $1 location_string = $1
@results[skey][:info][:location] = $1.strip @results[skey][:info][:location] = $1.strip
if location_string[/(https?):\x2f\x2f([^\x5c\x2f]+)/] if location_string[/(https?):\x2f\x2f([^\x5c\x2f]+)/]
@ -168,7 +168,7 @@ class Metasploit3 < Msf::Auxiliary
end end
end end
if data =~ /^USN:[\s]*(.*)/i if data =~ /^USN:[\s]*(.*)/mi
@results[skey][:info][:usn] = $1.strip @results[skey][:info][:usn] = $1.strip
end end