2010-07-01 23:33:07 +00:00
|
|
|
##
|
|
|
|
# This file is part of the Metasploit Framework and may be subject to
|
2010-05-05 03:08:30 +00:00
|
|
|
# redistribution and commercial restrictions. Please see the Metasploit
|
2012-02-21 01:40:50 +00:00
|
|
|
# web site for more information on licensing and terms of use.
|
|
|
|
# http://metasploit.com/
|
2010-05-05 03:08:30 +00:00
|
|
|
##
|
|
|
|
|
|
|
|
require 'msf/core'
|
|
|
|
|
|
|
|
class Metasploit3 < Msf::Auxiliary
|
2010-07-01 23:33:07 +00:00
|
|
|
|
2010-05-05 03:08:30 +00:00
|
|
|
include Msf::Exploit::Remote::HttpClient
|
|
|
|
include Msf::Auxiliary::Scanner
|
|
|
|
include Msf::Auxiliary::Report
|
|
|
|
|
|
|
|
def initialize
|
|
|
|
super(
|
|
|
|
'Name' => 'Lotus Domino Version',
|
2010-06-26 14:39:51 +00:00
|
|
|
'Description' => 'Several checks to determine Lotus Domino Server Version.',
|
2010-05-05 03:08:30 +00:00
|
|
|
'Author' => ['CG'],
|
|
|
|
'License' => MSF_LICENSE
|
|
|
|
)
|
|
|
|
register_options(
|
2010-06-26 14:39:51 +00:00
|
|
|
[
|
2010-07-01 23:33:07 +00:00
|
|
|
OptString.new('PATH', [ true, "path", '/']),
|
2010-06-26 14:39:51 +00:00
|
|
|
] )
|
2010-05-05 03:08:30 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def run_host(ip)
|
2010-07-01 23:33:07 +00:00
|
|
|
|
2012-11-08 16:42:48 +00:00
|
|
|
path = normalize_uri(datastore['PATH'])
|
2010-05-05 03:08:30 +00:00
|
|
|
check1 = [
|
|
|
|
'iNotes/Forms5.nsf',
|
|
|
|
'iNotes/Forms6.nsf',
|
|
|
|
'iNotes/Forms7.nsf',
|
2010-09-20 08:06:27 +00:00
|
|
|
]
|
2010-06-26 14:39:51 +00:00
|
|
|
|
2010-05-05 03:08:30 +00:00
|
|
|
check2 = [
|
2010-06-26 14:39:51 +00:00
|
|
|
'help/readme.nsf?OpenAbout'
|
|
|
|
]
|
|
|
|
check3 = [
|
2010-05-05 03:08:30 +00:00
|
|
|
'download/filesets/l_LOTUS_SCRIPT.inf',
|
|
|
|
'download/filesets/n_LOTUS_SCRIPT.inf',
|
|
|
|
'download/filesets/l_SEARCH.inf',
|
|
|
|
'download/filesets/n_SEARCH.inf',
|
|
|
|
]
|
2010-05-25 01:52:59 +00:00
|
|
|
|
2010-06-26 14:39:51 +00:00
|
|
|
currentversion = []
|
|
|
|
baseversion = []
|
|
|
|
|
2010-05-05 03:08:30 +00:00
|
|
|
begin
|
2010-07-01 23:33:07 +00:00
|
|
|
|
2010-05-05 03:08:30 +00:00
|
|
|
check1.each do | check |
|
|
|
|
|
|
|
|
res = send_request_raw({
|
2010-07-01 23:33:07 +00:00
|
|
|
'uri' => path+check,
|
2010-05-05 03:08:30 +00:00
|
|
|
'method' => 'GET',
|
|
|
|
}, 10)
|
|
|
|
|
|
|
|
if (res.nil?)
|
|
|
|
print_error("no response for #{ip}:#{rport} #{check}")
|
|
|
|
elsif (res.code == 200 and res.body)
|
|
|
|
#string we are regexing: <!-- Domino Release 7.0.3FP1 (Windows NT/Intel) -->
|
|
|
|
if match = res.body.match(/\<!-- Domino Release(.*) --\>/);
|
|
|
|
server1 = $1
|
|
|
|
report_note(
|
|
|
|
:host => ip,
|
2011-02-04 01:54:32 +00:00
|
|
|
:proto => 'tcp',
|
2012-02-22 05:57:55 +00:00
|
|
|
:sname => (ssl ? "https" : "http"),
|
2010-05-05 03:08:30 +00:00
|
|
|
:port => rport,
|
|
|
|
:type => 'lotusdomino.version.current',
|
|
|
|
:data => server1.strip
|
|
|
|
)
|
2010-06-26 14:39:51 +00:00
|
|
|
if currentversion.empty? then
|
|
|
|
currentversion << server1.strip
|
|
|
|
elsif server1.strip == currentversion.last then
|
|
|
|
''
|
|
|
|
else server1.strip != currentversion.last
|
2011-09-11 02:42:39 +00:00
|
|
|
print_error("Different current version values") #this shouldnt happen,but just in case
|
2010-07-01 23:33:07 +00:00
|
|
|
currentversion << ' : ' + server1.strip
|
2010-06-26 14:39:51 +00:00
|
|
|
end
|
2010-07-01 23:33:07 +00:00
|
|
|
else
|
2010-05-05 03:08:30 +00:00
|
|
|
''
|
2010-07-01 23:33:07 +00:00
|
|
|
end
|
|
|
|
elsif
|
2010-05-05 03:08:30 +00:00
|
|
|
if (res.code and res.headers['Location'])
|
|
|
|
print_error("#{ip}:#{rport} #{res.code} Redirect to #{res.headers['Location']}")
|
|
|
|
else
|
2010-07-01 23:33:07 +00:00
|
|
|
''
|
|
|
|
end
|
|
|
|
else
|
2010-05-05 03:08:30 +00:00
|
|
|
''
|
|
|
|
end
|
|
|
|
end
|
2010-06-26 14:39:51 +00:00
|
|
|
if currentversion.length == 0 then
|
|
|
|
''
|
|
|
|
else
|
|
|
|
print_status("#{ip}:#{rport} Lotus Domino Current Version: #{currentversion}")
|
|
|
|
end
|
2010-05-05 03:08:30 +00:00
|
|
|
|
|
|
|
check2.each do | check |
|
|
|
|
|
|
|
|
res = send_request_raw({
|
2010-07-01 23:33:07 +00:00
|
|
|
'uri' => path+check,
|
2010-06-26 14:39:51 +00:00
|
|
|
'method' => 'GET',
|
|
|
|
}, 10)
|
|
|
|
|
|
|
|
if (res.nil?)
|
|
|
|
print_error("no response for #{ip}:#{rport} #{check}")
|
|
|
|
elsif (res.code == 200 and res.body)
|
|
|
|
#string we are regexing: <title>IBM Lotus Notes/Domino 6.5.6 Release Notes</title>
|
|
|
|
if match = res.body.match(/\<title\>(.*)Lotus Notes\/Domino (.*) Release Notes\<\/title\>/);
|
|
|
|
server2 = $2
|
|
|
|
print_status("#{ip}:#{rport} Lotus Domino Release Notes Version: " + $2)
|
|
|
|
report_note(
|
|
|
|
:host => ip,
|
2011-02-04 01:54:32 +00:00
|
|
|
:proto => 'tcp',
|
2012-02-22 05:57:55 +00:00
|
|
|
:sname => (ssl ? "https" : "http"),
|
2010-06-26 14:39:51 +00:00
|
|
|
:port => rport,
|
|
|
|
:type => 'lotusdomino.version.releasenotes',
|
|
|
|
:data => server2.strip
|
|
|
|
)
|
2010-07-01 23:33:07 +00:00
|
|
|
else
|
2010-06-26 14:39:51 +00:00
|
|
|
''
|
2010-07-01 23:33:07 +00:00
|
|
|
end
|
|
|
|
elsif
|
2010-06-26 14:39:51 +00:00
|
|
|
if (res.code and res.headers['Location'])
|
|
|
|
print_error("#{ip}:#{rport} #{res.code} Redirect to #{res.headers['Location']}")
|
|
|
|
else
|
2010-07-01 23:33:07 +00:00
|
|
|
''
|
|
|
|
end
|
|
|
|
else
|
2010-06-26 14:39:51 +00:00
|
|
|
''
|
|
|
|
end
|
|
|
|
end
|
2010-07-01 23:33:07 +00:00
|
|
|
|
2010-06-26 14:39:51 +00:00
|
|
|
check3.each do | check |
|
|
|
|
|
|
|
|
res = send_request_raw({
|
2010-07-01 23:33:07 +00:00
|
|
|
'uri' => path+check,
|
2010-05-05 03:08:30 +00:00
|
|
|
'method' => 'GET',
|
|
|
|
}, 10)
|
|
|
|
|
|
|
|
if (res.nil?)
|
|
|
|
print_error("no response for #{ip}:#{rport} #{check}")
|
|
|
|
elsif (res.code == 200 and res.body and res.body.index('TotalFileSize') and res.body.index('FileCount'))
|
|
|
|
#string we are regexing: # Regex Version=8.5.1.0
|
|
|
|
if match = res.body.match(/Version=(.*)/);
|
2010-06-26 14:39:51 +00:00
|
|
|
server3 = $1
|
2010-05-05 03:08:30 +00:00
|
|
|
report_note(
|
|
|
|
:host => ip,
|
2011-02-04 01:54:32 +00:00
|
|
|
:proto => 'tcp',
|
2012-02-22 05:57:55 +00:00
|
|
|
:sname => (ssl ? "https" : "http"),
|
2010-05-05 03:08:30 +00:00
|
|
|
:port => rport,
|
|
|
|
:type => 'lotusdomino.version.base',
|
2010-06-26 14:39:51 +00:00
|
|
|
:data => server3.strip
|
2010-05-05 03:08:30 +00:00
|
|
|
)
|
2010-06-26 14:39:51 +00:00
|
|
|
if baseversion.empty? then
|
|
|
|
baseversion << server3.strip
|
|
|
|
elsif server3.strip == baseversion.last then
|
|
|
|
''
|
|
|
|
else server3.strip != baseversion.last #this shouldnt happen,but just in case
|
2011-09-11 02:42:39 +00:00
|
|
|
print_error("Different base version values")
|
2010-07-01 23:33:07 +00:00
|
|
|
baseversion << ' : ' + server3.strip
|
2010-06-26 14:39:51 +00:00
|
|
|
end
|
2010-07-01 23:33:07 +00:00
|
|
|
else
|
2010-05-05 03:08:30 +00:00
|
|
|
''
|
|
|
|
end
|
2010-07-01 23:33:07 +00:00
|
|
|
elsif
|
2010-05-05 03:08:30 +00:00
|
|
|
if (res.code and res.headers['Location'])
|
|
|
|
print_error("#{ip}:#{rport} #{res.code} Redirect to #{res.headers['Location']}")
|
|
|
|
else
|
|
|
|
''
|
2010-07-01 23:33:07 +00:00
|
|
|
end
|
|
|
|
else
|
2010-05-05 03:08:30 +00:00
|
|
|
''
|
|
|
|
end
|
|
|
|
end
|
2010-06-26 14:39:51 +00:00
|
|
|
if baseversion.length == 0 then
|
|
|
|
''
|
|
|
|
else
|
|
|
|
print_status("#{ip}:#{rport} Lotus Domino Base Install Version: #{baseversion}")
|
|
|
|
end
|
2010-05-05 03:08:30 +00:00
|
|
|
end
|
|
|
|
rescue ::Rex::ConnectionRefused, ::Rex::HostUnreachable, ::Rex::ConnectionTimeout
|
|
|
|
rescue Timeout::Error, Errno::EINVAL, Errno::ECONNRESET, Resolv::ResolvError, EOFError, Errno::ECONNABORTED, Errno::ECONNREFUSED, Errno::EHOSTUNREACH =>e
|
2011-09-11 02:42:39 +00:00
|
|
|
print_error(e.message)
|
2010-05-05 03:08:30 +00:00
|
|
|
end
|
|
|
|
end
|