diff --git a/core/main/ar-migrations/022_create_ipec_exploit.rb b/core/main/ar-migrations/022_create_ipec_exploit.rb deleted file mode 100644 index 6bf6ed46a..000000000 --- a/core/main/ar-migrations/022_create_ipec_exploit.rb +++ /dev/null @@ -1,9 +0,0 @@ -class CreateIpecExploit < ActiveRecord::Migration[6.0] - def change - create_table :ipec_exploits do |t| - t.text :name - t.text :protocol - t.text :os - end - end -end diff --git a/core/main/ar-migrations/023_create_ipec_exploit_run.rb b/core/main/ar-migrations/023_create_ipec_exploit_run.rb deleted file mode 100644 index d48c8eabf..000000000 --- a/core/main/ar-migrations/023_create_ipec_exploit_run.rb +++ /dev/null @@ -1,9 +0,0 @@ -class CreateIpecExploitRun < ActiveRecord::Migration[6.0] - def change - create_table :ipec_exploit_runs do |t| - t.boolean :launched - t.text :http_headers - t.text :junk_size - end - end -end diff --git a/extensions/admin_ui/api/handler.rb b/extensions/admin_ui/api/handler.rb index 0cd82481f..75764866c 100644 --- a/extensions/admin_ui/api/handler.rb +++ b/extensions/admin_ui/api/handler.rb @@ -78,7 +78,6 @@ module BeEF ui/panel/tabs/ZombieTabRider.js ui/panel/tabs/ZombieTabXssRays.js wterm/wterm.jquery.js - ui/panel/tabs/ZombieTabIpec.js ui/panel/tabs/ZombieTabAutorun.js ui/panel/PanelViewer.js ui/panel/LogsDataGrid.js diff --git a/extensions/admin_ui/media/javascript/ui/panel/WelcomeTab.js b/extensions/admin_ui/media/javascript/ui/panel/WelcomeTab.js index 4a0d9e02e..56e867641 100644 --- a/extensions/admin_ui/media/javascript/ui/panel/WelcomeTab.js +++ b/extensions/admin_ui/media/javascript/ui/panel/WelcomeTab.js @@ -39,7 +39,6 @@ WelcomeTab = function() {
  • Proxy: The Proxy tab allows you to submit arbitrary HTTP requests on behalf of the hooked browser. \ Each request sent by the Proxy is recorded in the History panel. Click a history item to view the HTTP headers and HTML source of the HTTP response.
  • \
  • Network: The Network tab allows you to interact with hosts on the local network(s) of the hooked browser.
  • \ -
  • IPEC: Send commands to the victims systems using Inter-Protocol Exploitation/Communication (IPEC)
  • \
  • WebRTC: Send commands to the victims systems via a zombie specified as the primary WebRTC caller.
  • \
    \

    You can also right-click a hooked browser to open a context-menu with additional functionality:


    \ diff --git a/extensions/admin_ui/media/javascript/ui/panel/ZombieTab.js b/extensions/admin_ui/media/javascript/ui/panel/ZombieTab.js index f548676a3..07fcd3367 100644 --- a/extensions/admin_ui/media/javascript/ui/panel/ZombieTab.js +++ b/extensions/admin_ui/media/javascript/ui/panel/ZombieTab.js @@ -10,7 +10,6 @@ ZombieTab = function(zombie) { commands_tab = new ZombieTab_Commands(zombie); proxy_tab = new ZombieTab_Requester(zombie); xssrays_tab = new ZombieTab_XssRaysTab(zombie); - ipec_tab = new ZombieTab_IpecTab(zombie); autorun_tab = new ZombieTab_Autorun(zombie); network_tab = new ZombieTab_Network(zombie); webrtc_tab = new ZombieTab_Rtc(zombie); @@ -32,7 +31,6 @@ ZombieTab = function(zombie) { commands_tab, proxy_tab, xssrays_tab, - ipec_tab, autorun_tab, network_tab, webrtc_tab @@ -41,8 +39,6 @@ ZombieTab = function(zombie) { afterrender:function(component){ // Hide auto-run tab component.hideTabStripItem(autorun_tab); - // Hide IPEC tab - it's current broken - component.hideTabStripItem(ipec_tab); // Hide tabs for disabled functionality <%= BeEF::Core::Configuration.instance.get("beef.extension.webrtc.enable") ? '' : 'component.hideTabStripItem(webrtc_tab);' %> <%= BeEF::Core::Configuration.instance.get("beef.extension.xssrays.enable") ? '' : 'component.hideTabStripItem(xssrays_tab);' %> diff --git a/extensions/admin_ui/media/javascript/ui/panel/tabs/ZombieTabIpec.js b/extensions/admin_ui/media/javascript/ui/panel/tabs/ZombieTabIpec.js deleted file mode 100644 index ac1fb8013..000000000 --- a/extensions/admin_ui/media/javascript/ui/panel/tabs/ZombieTabIpec.js +++ /dev/null @@ -1,236 +0,0 @@ -// -// Copyright (c) 2006-2023 Wade Alcorn - wade@bindshell.net -// Browser Exploitation Framework (BeEF) - http://beefproject.com -// See the file 'doc/COPYING' for copying permission -// - -/* - * The Ipec Tab panel for the selected zombie. - */ - -ZombieTab_IpecTab = function(zombie) { - - var commands_statusbar = new Beef_StatusBar('ipec-bbar-zombie-'+zombie.session); - - var ipec_config_panel = new Ext.Panel({ - id: 'ipec-config-zombie-'+zombie.session, - title: 'Scan Config', - layout: 'fit', - autoscroll: true - }); - - function get_module_id(name, token){ - var id = ""; - var url = "/api/modules/search/" + name + "?token=" + token; - $jwterm.ajax({ - contentType: 'application/json', - dataType: 'json', - type: 'GET', - url: url, - async: false, - processData: false, - success: function(data){ - id = data.id; - }, - error: function(){ - beef.debug("Error getting module id."); - } - }); - return id; - } - - - function escape_html(str) { - str = str.toString(); - str = str.replace(//g, '>'); -// str = str.replace(/\u0022/g, '"'); - str = str.replace(/\u0027/g, '''); - str = str.replace(/\"\"/g, ''); - str = str.replace(/\\r/g, ''); - str = str.replace(/\\n/g, '
    '); - str = str.replace(/\\\\/g, '\\'); - str = str.replace(/\\t/g, '    '); -// str = str.replace(/\\/g, '\'); - return str; - } - - function validateNumber(input, min, max) { - var value = parseInt(input); - return (!isNaN(value) && value >= min && value <= max); - } - - - function initTerminal(zombie){ - String.prototype.reverse = function() { - return this.split('').reverse().join(''); - }; - - $jwterm( document ).ready( function() { - $jwterm('#wterm').wterm( { WIDTH: '100%', HEIGHT: '100%', WELCOME_MESSAGE: 'Welcome to BeEF Bind interactive shell. Unfortunately the IPEC shell is currently broken. See: https://github.com/beefproject/beef/issues/1394 - To Begin Using type \'help\'' }); - }); - - var target_ip = ""; - var target_port = ""; - - var command_directory = { - - 'target': function(tokens){ - var ip_regex = new RegExp('^(?:[0-9]{1,3}\.){3}[0-9]{1,3}$'); - target_ip = tokens[1]; - target_port = tokens[2]; - if(ip_regex.test(target_ip) && validateNumber(target_port, 1, 65535)){ - return "Target is now " + tokens[1] + ":" + tokens[2]; - }else{ - return "Target error: invalid IP or port."; - } - }, - - 'exec': function(tokens){ - if(target_ip.length == 0 || target_port.length == 0) - return "Error: target ip or port not set." - - tokens.shift(); //remove the first element (exec) - var cmd = tokens.join(' '); //needed in case of commands with options - cmd = cmd.replace(/\\/g, '\\\\'); //needed to prevent JS errors (\ need to be escaped) - - var token = beefwui.get_rest_token(); - var mod_id = get_module_id("BeEF_bind_shell", token); - - var uri = "/api/modules/" + zombie.session + "/" + mod_id + "?token=" + token; - - var result = null; - - $jwterm.ajax({ - contentType: 'application/json', - data: JSON.stringify({"rhost":target_ip, "rport":target_port, "path":"/", "cmd":cmd}), - dataType: 'json', - type: 'POST', - url: uri, - async: false, - processData: false, - success: function(data){ - beef.debug("data: " + data.command_id); - result = "Command [" + data.command_id + "] sent successfully"; - }, - error: function(){ - beef.debug("Error sending command"); - return "Error sending command"; - } - }); - - return result; - }, - - 'get': function(tokens){ - var command_id = tokens[1]; - - if(command_id != null){ - - var token = beefwui.get_rest_token(); - var mod_id = get_module_id("BeEF_bind_shell", token); - - var uri_results = "/api/modules/" + zombie.session + "/" + mod_id + "/" - + command_id + "?token=" + token; - var results = ""; - $jwterm.ajax({ - contentType: 'application/json', - dataType: 'json', - type: 'GET', - url: uri_results, - async: false, - processData: false, - success: function(data){ - $jwterm.each(data, function(i){ - beef.debug("result [" + i +"]: " + $jwterm.parseJSON(data[i].data).data); - results += $jwterm.parseJSON(data[i].data).data; - }); - - }, - error: function(){ - beef.debug("Error sending command"); - return "Error sending command"; - } - }); - results = escape_html(results); - if(results.charAt(0) == '"' && results.charAt(results.length-1) == '"') - results = results.slice(1,results.length-1); - - return results; - } - }, - - 'strrev': { - PS1: 'strrev $', - - EXIT_HOOK: function() { - return 'exit interface commands'; - }, - - START_HOOK: function() { - return 'exit interface commands'; - }, - - DISPATCH: function( tokens ) { - return tokens.join('').reverse(); - } - } - }; - - for( var j in command_directory ) { - $jwterm.register_command( j, command_directory[j] ); - } - - $jwterm.register_command( 'help', function() { - return 'target - Usage: target <IP> <port> - Send commands to the specified IP:port
    ' + - 'exec - Usage exec <command> <command options> - Exec a command, returns the command id.
    ' + - 'get - Usage get <command id> - Retrieve command results given a specified command id.
    ' - - }); - }; - - - var ipec_terminal_panel = new Ext.Panel({ - id: 'ipec-terminal-zombie-'+zombie.session, - title: 'Terminal', - layout: 'fit', - padding: '1 1 1 1', - autoScroll: true, - html: "
    ", - listeners: { - afterrender : function(){ - initTerminal(zombie); - } - } - - }); - - function createIpecTerminalPanel(zombie, bar, value) { - - panel = Ext.getCmp('ipec-config-zombie-'+zombie.session); - panel.setTitle('Prompt'); - panel.add(ipec_terminal_panel); - } - - ZombieTab_IpecTab.superclass.constructor.call(this, { - id: 'ipec-log-tab-'+zombie.session, - title: 'Ipec', - activeTab: 0, - viewConfig: { - forceFit: true, - type: 'fit', - autoScroll:true - }, - items: [ipec_config_panel], - bbar: commands_statusbar, - listeners: { - afterrender : function(){ - createIpecTerminalPanel(zombie, commands_statusbar); - }, - autoScroll:true - - } - }); -}; - -Ext.extend(ZombieTab_IpecTab, Ext.TabPanel, {} ); diff --git a/extensions/ipec/config.yaml b/extensions/ipec/config.yaml deleted file mode 100644 index 63c57336d..000000000 --- a/extensions/ipec/config.yaml +++ /dev/null @@ -1,11 +0,0 @@ -# -# Copyright (c) 2006-2023 Wade Alcorn - wade@bindshell.net -# Browser Exploitation Framework (BeEF) - http://beefproject.com -# See the file 'doc/COPYING' for copying permission -# -beef: - extension: - ipec: - enable: false - name: 'Inter-Protocol Exploitation' - authors: ["antisnatchor"] diff --git a/extensions/ipec/extension.rb b/extensions/ipec/extension.rb deleted file mode 100644 index 314b47bbd..000000000 --- a/extensions/ipec/extension.rb +++ /dev/null @@ -1,41 +0,0 @@ -# -# Copyright (c) 2006-2023 Wade Alcorn - wade@bindshell.net -# Browser Exploitation Framework (BeEF) - http://beefproject.com -# See the file 'doc/COPYING' for copying permission -# -module BeEF - module Extension - # TODO: remove it from here: - # Handlers - # require 'extensions/ipec/fingerprinter' - # require 'extensions/ipec/launcher' - require 'extensions/ipec/junk_calculator' - - module Ipec - extend BeEF::API::Extension - - @short_name = 'Ipec' - @full_name = 'Inter-Protocol Exploitation' - @description = "Use the Inter-Protocol Exploitation technique to send shellcode to daemons implementing 'tolerant' protocols." - - module RegisterIpecRestHandler - def self.mount_handler(server) - server.mount('/api/ipec', BeEF::Extension::Ipec::IpecRest.new) - end - end - - BeEF::API::Registrar.instance.register(BeEF::Extension::Ipec::RegisterIpecRestHandler, BeEF::API::Server, 'mount_handler') - - # TODO: remove it from here, and make it dynamic. - BeEF::Extension::Ipec::JunkCalculator.instance.bind_junk_calculator('imapeudora1') - end - end -end - -# Models -# todo: to be used when we'll have more IPEC exploits -# require 'extensions/ipec/models/ipec_exploits' -# require 'extensions/ipec/models/ipec_exploits_run' - -# RESTful api endpoints -require 'extensions/ipec/rest/ipec' diff --git a/extensions/ipec/files/LinkTargetFinder.xpi b/extensions/ipec/files/LinkTargetFinder.xpi deleted file mode 100644 index 3fadfa9c2..000000000 Binary files a/extensions/ipec/files/LinkTargetFinder.xpi and /dev/null differ diff --git a/extensions/ipec/files/LinkTargetFinder/chrome.manifest b/extensions/ipec/files/LinkTargetFinder/chrome.manifest deleted file mode 100644 index f9ad9ab4c..000000000 --- a/extensions/ipec/files/LinkTargetFinder/chrome.manifest +++ /dev/null @@ -1,8 +0,0 @@ -content linktargetfinder chrome/content/ -content linktargetfinder chrome/content/ contentaccessible=yes -overlay chrome://browser/content/browser.xul chrome://linktargetfinder/content/browser.xul - -locale linktargetfinder en-US locale/en-US/ - -skin linktargetfinder classic/1.0 skin/ -style chrome://global/content/customizeToolbar.xul chrome://linktargetfinder/skin/skin.css \ No newline at end of file diff --git a/extensions/ipec/files/LinkTargetFinder/chrome/content/browser.xul b/extensions/ipec/files/LinkTargetFinder/chrome/content/browser.xul deleted file mode 100644 index 5b63810a8..000000000 --- a/extensions/ipec/files/LinkTargetFinder/chrome/content/browser.xul +++ /dev/null @@ -1,22 +0,0 @@ - - - - -