Improved auxiliary detection
git-svn-id: file:///home/svn/framework3/trunk@8481 4d416f70-5f16-0410-b530-b9f4589650daunstable
parent
ee4fd8c75d
commit
9c227ea0e7
|
@ -54,6 +54,25 @@ class Metasploit3 < Msf::Auxiliary
|
|||
res = smb_fingerprint()
|
||||
|
||||
if(res['os'] and res['os'] != 'Unknown')
|
||||
|
||||
case res['os']
|
||||
when /Windows/
|
||||
os = OperatingSystems::WINDOWS
|
||||
else
|
||||
case res['sp']
|
||||
when /apple/
|
||||
os = OperatingSystems::MAC_OSX
|
||||
when /ubuntu/
|
||||
os = 'Ubuntu'
|
||||
res['os'] = OperatingSystems::LINUX
|
||||
when /debian/
|
||||
os = 'Ubuntu'
|
||||
res['os'] = OperatingSystems::LINUX
|
||||
else
|
||||
os = OperatingSystems::UNKNOWN
|
||||
end
|
||||
end
|
||||
|
||||
desc = "#{rhost} is running #{res['os']} #{res['sp']} (language: #{res['lang']})"
|
||||
if(simple.client.default_name)
|
||||
desc << " (name:#{simple.client.default_name})"
|
||||
|
@ -72,23 +91,6 @@ class Metasploit3 < Msf::Auxiliary
|
|||
:name => 'smb',
|
||||
:info => "#{res['os']} #{res['sp']} (language: #{res['lang']})"
|
||||
)
|
||||
case res['os']
|
||||
when /Windows/
|
||||
os = OperatingSystems::WINDOWS
|
||||
else
|
||||
case res['sp']
|
||||
when /apple/
|
||||
os = OperatingSystems::MAC_OSX
|
||||
when /ubuntu/
|
||||
os = 'Ubuntu'
|
||||
res['os'] = OperatingSystems::LINUX
|
||||
when /debian/
|
||||
os = 'Ubuntu'
|
||||
res['os'] = OperatingSystems::LINUX
|
||||
else
|
||||
os = OperatingSystems::UNKNOWN
|
||||
end
|
||||
end
|
||||
|
||||
report_host({
|
||||
:host => ip,
|
||||
|
|
|
@ -46,6 +46,36 @@ class Metasploit3 < Msf::Auxiliary
|
|||
ver,msg = (ver.split(/(\n|\r)/))
|
||||
print_status("#{target_host}:#{rport}, SSH server version: #{ver}")
|
||||
report_service(:host => rhost, :port => rport, :name => "ssh", :info => ver)
|
||||
|
||||
os_name = nil
|
||||
os_flav = nil
|
||||
case ver
|
||||
when /ubuntu/i
|
||||
os_name = 'Linux'
|
||||
os_flav = 'Ubuntu'
|
||||
when /debian/i
|
||||
os_name = 'Linux'
|
||||
os_flav = 'Debian'
|
||||
when /sun_ssh/i
|
||||
os_name = 'Solaris'
|
||||
when /vshell|remotelyanywhere|freessh/i
|
||||
os_name = 'Windows'
|
||||
when /vshell/i
|
||||
os_name = 'Windows'
|
||||
when /radware/i
|
||||
os_name = 'Radware'
|
||||
when /dropbear/
|
||||
os_name = 'Linux'
|
||||
when /cisco|vpn3/i
|
||||
os_name = 'Cisco'
|
||||
end
|
||||
|
||||
if(os_name || os_flav)
|
||||
info = {:host => target_host}
|
||||
info[:os_flavor] = os_flav if os_flav
|
||||
info[:os_name] = os_name if os_name
|
||||
report_host(info)
|
||||
end
|
||||
else
|
||||
print_status("#{target_host}:#{rport}, SSH server version detection failed!")
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue