Web

Hay muchas formas de proteger Wordpress. Uno de los fallos de seguridad más frecuentes es a través de peticiones POST a través de vulnerabilidades descubiertas y publicadas en foros de seguridad. 

Como siempre Wordpress ofrece un repertorio bastante amplio de plugins para todo tipo de funcionalidades que se busque. En este caso, Wordpress ofrece también plugins para bloquear peticiones POST maliciosas como es el caso de Block Bad Queries, bastante útil para proteger la web contra los ataques más frecuentes. 

Otra posibilidad es modificar el fichero .htaccess del directorio donde se encuentra la plantilla de Wordpress introduciendo el siguiente código:

$request_uri = $_SERVER['REQUEST_URI'];

$query_string = $_SERVER['QUERY_STRING'];

$user_agent = $_SERVER['HTTP_USER_AGENT'];

 

// request uri

if (    //strlen($request_uri) > 255 || 

    stripos($request_uri, 'eval(') || 

    stripos($request_uri, 'CONCAT') || 

    stripos($request_uri, 'UNION+SELECT') || 

    stripos($request_uri, '(null)') || 

    stripos($request_uri, 'base64_') || 

    stripos($request_uri, '/localhost') || 

    stripos($request_uri, '/pingserver') || 

    stripos($request_uri, '/config.') || 

    stripos($request_uri, '/wwwroot') || 

    stripos($request_uri, '/makefile') || 

    stripos($request_uri, 'crossdomain.') || 

    stripos($request_uri, 'proc/self/environ') || 

    stripos($request_uri, 'etc/passwd') || 

    stripos($request_uri, '/https/') || 

    stripos($request_uri, '/http/') || 

    stripos($request_uri, '/ftp/') || 

    stripos($request_uri, '/cgi/') || 

    stripos($request_uri, '.cgi') || 

    stripos($request_uri, '.exe') || 

    stripos($request_uri, '.sql') || 

    stripos($request_uri, '.ini') || 

    stripos($request_uri, '.dll') || 

    stripos($request_uri, '.asp') || 

    stripos($request_uri, '.jsp') || 

    stripos($request_uri, '/.bash') || 

    stripos($request_uri, '/.git') || 

    stripos($request_uri, '/.svn') || 

    stripos($request_uri, '/.tar') || 

    stripos($request_uri, ' ') || 

    stripos($request_uri, '<') || 

    stripos($request_uri, '>') || 

    stripos($request_uri, '/=') || 

    stripos($request_uri, '...') || 

    stripos($request_uri, '+++') || 

    stripos($request_uri, '://') || 

    stripos($request_uri, '/&&') || 

    // query strings

    stripos($query_string, '?') || 

    stripos($query_string, ':') || 

    stripos($query_string, '[') || 

    stripos($query_string, ']') || 

    stripos($query_string, '../') || 

    stripos($query_string, '127.0.0.1') || 

    stripos($query_string, 'loopback') || 

    stripos($query_string, '%0A') || 

    stripos($query_string, '%0D') || 

    stripos($query_string, '%22') || 

    stripos($query_string, '%27') || 

    stripos($query_string, '%3C') || 

    stripos($query_string, '%3E') || 

    stripos($query_string, '%00') || 

    stripos($query_string, '%2e%2e') || 

    stripos($query_string, 'union') || 

    stripos($query_string, 'input_file') || 

    stripos($query_string, 'execute') || 

    stripos($query_string, 'mosconfig') || 

    stripos($query_string, 'environ') || 

    //stripos($query_string, 'scanner') || 

    stripos($query_string, 'path=.') || 

    stripos($query_string, 'mod=.') || 

    // user agents

    stripos($user_agent, 'binlar') || 

    stripos($user_agent, 'casper') || 

    stripos($user_agent, 'cmswor') || 

    stripos($user_agent, 'diavol') || 

    stripos($user_agent, 'dotbot') || 

    stripos($user_agent, 'finder') || 

    stripos($user_agent, 'flicky') || 

    stripos($user_agent, 'libwww') || 

    stripos($user_agent, 'nutch') || 

    stripos($user_agent, 'planet') || 

    stripos($user_agent, 'purebot') || 

    stripos($user_agent, 'pycurl') || 

    stripos($user_agent, 'skygrid') || 

    stripos($user_agent, 'sucker') || 

    stripos($user_agent, 'turnit') || 

    stripos($user_agent, 'vikspi') || 

    stripos($user_agent, 'zmeu')

) {

    @header('HTTP/1.1 403 Forbidden');

    @header('Status: 403 Forbidden');

    @header('Connection: Close');

    @exit;

Conviene aclarar que cada plantilla de wordpress tiene sus peculiaridades, por lo tanto no es aconsejable introducir el código a pelo en el fichero .htaccess. Si lo haces, lo más probable es que la web deje de funcionar. 

Advanced Access Manager

Advanced Access Manager (aka AAM) is all you need to manage access to your website frontend and backend for any user, role or visitors.

 

FEW QUICK FACTS

The only plugin that gives you absolute freedom to define the most granular access to any aspect of your website and most of the feature are free;

Bullet-proven plugin that is used on over 100,000 websites where all features are well-tested and documented. Very low amount of support tickets speaks for quality;

It is the only plugin that gives you the ability to manage access to your website content for any role, individual user and visitors or even define the default access to all posts, pages, custom post types, categories and custom hierarchical taxonomies;

AAM is developer oriented plugin. It has dozens of hooks and configurations. It is integrated with WordPress RESTful and XML-RPC APIs and has numerous abstract layers to simplify coding;

No ads or other promotional crap. The UI is clean and well crafted so you can focus only on what matters;

No need to be a “paid” customer to get help. Request support via email or start chat with Google Hangout;

Some features are limited or available only with premium extensions. AAM functionality is transparent and you will absolute know when you need to get a premium extension;

MAIN AREAS OF FOCUS

Access & Security Policy allows you to define who, when, how and under what conditions your website resources can be accessed;

Content access control on frontend, backend and API sides to posts, pages, custom post types, categories, custom hierarchical taxonomies and CPTs for any role, user and visitors;

Roles & capabilities management with ability to create new roles and capabilities, edit, clone or delete existing;

Access control to backend area including backend menu, toolbar, metaboxes & widgets;

Access control to RESTful & XML-RPC APIs;

Developer friendly API so it can be used by other developers to work with AAM core;

And all necessary features to setup smooth user flow during login, logout, access denied even, 404 etc.

THE MOST POPULAR FEATURES

[free] Manage Backend Menu. Manage access to the backend menu for any user or role. Find out more from How to manage WordPress backend menu article;

[free] Manage Roles & Capabilities. Manage all your WordPress role and capabilities.

[free] Create temporary user accounts. Create and manage temporary user accounts. Find out more from How to create temporary WordPress user account;

[limited] Content access. Very granular access to unlimited number of post, page or custom post type (19 different options). With premium Plus Package extension also manage access to hierarchical taxonomies or setup the default access to all post types and taxonomies. Find out more from How to manage access to the WordPress content article;

[free] Manage Admin Toolbar. Filter out unnecessary items from the top admin toolbar for any role or user.

[free] Backend Lockdown. Restrict access to your website backend side for any user or role. Find out more from How to lockdown WordPress backend article;

[free] Secure Login Widget & Shortcode. Drop AJAX login widget or shortcode anywhere on your website. Find out more from How does AAM Secure Login works article;

[free] Ability to enable/disable RESTful and XML-RPC APIs.

[limited] URI Access. Allow or deny access to any page of you website by the page URL as well as how to redirect user when access is denied;

[free] Manage access to RESTful or XML-RPC individual endpoints for any role, user or visitors.

[free] JWT authentication. Authenticate user with WordPress RESTful API and use received JWT token for further requests. Fid out more from Hot to authenticate WordPress user with JWT token

[free] Login with URL. For more information check WordPress: Temporary User Account, Login With URL & JWT Token article.

[free] Content Filter. Filter or replace parts of your content with AAM shortcodes. Find out more from How to filter WordPress post content article;

[free] Login/Logout Redirects. Define custom login and logout redirect for any user or role;

[free] 404 Redirect. Redefine where user should be redirected when page does not exist. Find out more from How to redirect on WordPress 404 error;

[free] Access Denied Redirect. Define custom redirect for any role, user or visitors when access is denied for restricted area on your website;

[free] Manage Metaboxes & Widgets. Filter out restricted or unnecessary metaboxes and widgets on both frontend and backend for any user, role or visitors. Find out more from How to hide WordPress metaboxes & widgets article;

[paid] Manage access based on IP address or referred domain. Manage access to your website for all visitors based on referred host or IP address. Find out more from How to manage access to WordPress website by IP address article;

[paid] Monetize access to you content. Start selling access to your website content with premium E-Commerce extension. Find out more from How to monetize access to the WordPress content article;

[free] Multisite support. Sync access settings across your network or even restrict none-members from accessing one of your sites. Find out more from AAM and WordPress Multisite support;

[free] Multiple role support. Finally AAM supports multiple roles per user WordPress access control for users with multiple roles

 

[and even more…] Check our help page to learn more about AAM

Página 1 de 8