An incremental advance for this mighty UPnP probe module.
git-svn-id: file:///home/svn/framework3/trunk@10959 4d416f70-5f16-0410-b530-b9f4589650daunstable
parent
fa962647f9
commit
13b15c9a2c
|
@ -14,7 +14,6 @@ require 'msf/core'
|
||||||
class Metasploit3 < Msf::Auxiliary
|
class Metasploit3 < Msf::Auxiliary
|
||||||
|
|
||||||
include Msf::Auxiliary::Report
|
include Msf::Auxiliary::Report
|
||||||
include Msf::Exploit::Remote::Udp
|
|
||||||
|
|
||||||
def initialize
|
def initialize
|
||||||
super(
|
super(
|
||||||
|
@ -132,26 +131,46 @@ class Metasploit3 < Msf::Auxiliary
|
||||||
|
|
||||||
data = pkt[0]
|
data = pkt[0]
|
||||||
info = []
|
info = []
|
||||||
if data[/Server:[\s]*(.*)/]
|
if data[/^Server:[\s]*(.*)/]
|
||||||
info << "\"#{$1.strip}\""
|
info << "\"#{$1.strip}\""
|
||||||
end
|
end
|
||||||
|
|
||||||
if data[/Location:[\s]*(.*)/] ||
|
ssdp_host = nil
|
||||||
info << $1.strip
|
ssdp_port = 80
|
||||||
|
if data[/^Location:[\s]*(.*)/]
|
||||||
|
location_string = $1.strip
|
||||||
|
info << location_string
|
||||||
|
if location_string[/(https?):\x2f\x2f([^\x5c\x2f]+)/]
|
||||||
|
ssdp_host,ssdp_port = $2.split(":")
|
||||||
|
if ssdp_port.nil?
|
||||||
|
ssdp_port = ($1 == "http" ? 80 : 443)
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if data[/USN:[\s]*(.*)/]
|
if data[/^USN:[\s]*(.*)/]
|
||||||
info << $1.strip
|
info << $1.strip
|
||||||
end
|
end
|
||||||
|
|
||||||
report_service(
|
report_service(
|
||||||
:host => addr,
|
:host => addr,
|
||||||
:port => port,
|
:port => port,
|
||||||
:proto => 'udp',
|
:proto => 'udp',
|
||||||
:name => 'SSDP',
|
:name => 'ssdp',
|
||||||
:info => info.join("|")
|
:info => info.join("|")
|
||||||
)
|
)
|
||||||
print_good "#{addr}:#{port}: Got an SSDP response from #{info.first}"
|
print_good "#{addr}:#{port}: Got an SSDP response from #{info.first}"
|
||||||
|
|
||||||
|
if ssdp_host
|
||||||
|
report_service(
|
||||||
|
:host => ssdp_host,
|
||||||
|
:port => ssdp_port,
|
||||||
|
:proto => 'tcp',
|
||||||
|
:name => 'upnp',
|
||||||
|
:info => location_string
|
||||||
|
)
|
||||||
|
print_good "#{ssdp_host}:#{ssdp_port}: UPnP services advertised at #{info.grep(/#{ssdp_host}/).first}"
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue