Added mssql response parsing

git-svn-id: file:///home/svn/framework3/trunk@3829 4d416f70-5f16-0410-b530-b9f4589650da
unstable
HD Moore 2006-08-13 18:14:38 +00:00
parent a6cb1142e9
commit 3682e30261
1 changed files with 27 additions and 2 deletions

View File

@ -107,8 +107,10 @@ class Auxiliary::Scanner::Discovery::SweepUDP < Msf::Auxiliary
app = 'Portmap'
when 1434
app = 'SQL Server'
idx = pkt[0].index('ServerName')
inf = pkt[0][idx, pkt[0].length-idx] if idx
mssql_ping_parse(pkt[0]).each_pair { |k,v|
inf += k+'='+v+' '
}
when 161
app = 'SNMP'
when 5093
@ -118,6 +120,29 @@ class Auxiliary::Scanner::Discovery::SweepUDP < Msf::Auxiliary
print_status("Discovered #{app} on #{pkt[1]} (#{inf})")
end
#
# Parse a 'ping' response and format as a hash
#
def mssql_ping_parse(data)
res = {}
var = nil
idx = data.index('ServerName')
return res if not idx
data[idx, data.length-idx].split(';').each do |d|
if (not var)
var = d
else
if (var.length > 0)
res[var] = d
var = nil
end
end
end
return res
end
#
# The probe definitions