<?php // NinjaFirewall's dropins.php ~ Do not delete this file!
  if (! defined( 'NFW_ENGINE_VERSION' ) ) { die( 'Forbidden' ); } if (defined('WP_CLI') && WP_CLI ) { return; } if (! is_super_admin() ) { if ( isset( $_REQUEST['action'] ) ) { $nfw_act_hash = sha1( $_REQUEST['action'] ); if ( $nfw_act_hash == '1090835a56ce389cedc3ef268ebcb45c59d6dba9' ) { nfw_dropin_block( "REQUEST:action = {$_REQUEST['action']}", 3, 1627 ); } elseif ( in_array( $nfw_act_hash, array( 'f8182d759d82f2d390c086a94fd4132abc88eeb7', '65e3caa6ed411246bf5b70df49e666b0fe3e20e2' ) ) ) { nfw_dropin_block( "REQUEST:action = {$_REQUEST['action']}", 3, 1625); } elseif ( $nfw_act_hash == '8e1ef5a25995c199f49d1893f2781583d8dd88c6' ) { if (! empty( $_POST['data'] ) ) { $atts = explode('&', rawurldecode( rawurldecode( $_POST['data'] ) ) ); foreach( $atts as $att ) { $a = explode('=', $att); if ( empty( $a[1] ) ) { continue; } if ( in_array( $a[0], array('form_id', 'ids') ) && ! is_numeric( $a[1] ) ) { nfw_dropin_block( "REQUEST:action = {$_REQUEST['action']}, param = {$a[0]} : {$a[1]}", 3, 1629); } } } } } if ( isset( $_POST['directorist_reset_password'] ) && nfw_dropin_isvulnplugin('directorist/directorist-base.php', '7.5.5') === true ) { nfw_dropin_block( "directorist_reset_password = {$_POST['directorist_reset_password']}", 3, 1631 ); } } if ( isset( $_POST['eael-resetpassword-submit'] ) && nfw_dropin_isvulnplugin('essential-addons-for-elementor-lite/essential_adons_elementor.php', '5.7.2') === true ) { nfw_dropin_block( "eael-resetpassword-submit = {$_POST['eael-resetpassword-submit']}", 3, 1604 ); } if ( isset( $_POST['learndash-reset-password-form-post-nonce'] ) && nfw_dropin_isvulnplugin('sfwd-lms/sfwd_lms.php', '4.6.0.1') === true ) { nfw_dropin_block( "user_login = {$_POST['user_login']}", 3, 1605 ); } if ( file_exists( WP_PLUGIN_DIR .'/wpcargo/includes/barcode.php' ) ) { if ( filesize( WP_PLUGIN_DIR .'/wpcargo/includes/barcode.php' ) > 1 ) { rename( WP_PLUGIN_DIR .'/wpcargo/includes/barcode.php', WP_PLUGIN_DIR .'/wpcargo/includes/barcode.php_VULNERABLE' ); touch( WP_PLUGIN_DIR .'/wpcargo/includes/barcode.php' ); } } if ( isset( $_POST['extraData']['content'] ) ) { $data = explode( ';base64,', $_POST['extraData']['content'] ); $data = base64_decode( $data[ 1 ] ); if ( preg_match( '/\b[OC]:\d+:"[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*":\d+:{.*?}/', $data ) ) { nfw_dropin_block( "POST:extraData:content = PHP Object Injection", 3, 1606 ); } } if ( isset( $_REQUEST['NF_Admin_Processes_ImportForm::startup'] ) ) { nfw_dropin_block( "NF_Admin_Processes_ImportForm::startup = {$_REQUEST['NF_Admin_Processes_ImportForm::startup'] }", 3, 1607 ); } function nfw_dropin_block( $message, $level, $rule ) { nfw_log2('WP vulnerability', $message, $level, $rule); exit("NinjaFirewall blocked your request, please contact the administrator."); } function nfw_dropin_can_edit_post( $postid ) { $type = get_post_type( (int) $postid ); if ( ( $type == 'page' || $type == 'post' ) && ! current_user_can( "edit_{$type}", $postid ) ) { return false; } return true; } function nfw_dropin_can_delete_post( $postid ) { $type = get_post_type( (int) $postid ); if ( ( $type == 'page' || $type == 'post' ) && ! current_user_can( "delete_{$type}", $postid ) ) { return false; } return true; } function nfw_dropin_isvulnplugin( $slug, $version ) { if ( file_exists( WP_PLUGIN_DIR ."/$slug") ) { if (! function_exists('get_plugin_data') ) { require_once( ABSPATH .'wp-admin/includes/plugin.php'); } $info = get_plugin_data( WP_PLUGIN_DIR ."/$slug"); if (version_compare( $info['Version'], $version, '<') ) { return true; } } return false; } 