Installare e configurare wordpress è veramente semplice, soprattutto grazie al suo wizard user friendly.
Come spesso accade però le configurazioni di default necessitanto di ritocchi.
Una delle principali personalizzazioni da eseguire è quella di impedire la lettura degli utenti wordpress da remoto.
Per testare l’importanza di questo aspetto, possiamo utilizzare il security scanner WPScan :

[root@wpscan_test wpscan]# ./wpscan.rb --url http://www.example.it --enumerate u
_______________________________________________________________
        __          _______   _____
        \ \        / /  __ \ / ____|
         \ \  /\  / /| |__) | (___   ___  __ _ _ __
          \ \/  \/ / |  ___/ \___ \ / __|/ _` | '_ \
           \  /\  /  | |     ____) | (__| (_| | | | |
            \/  \/   |_|    |_____/ \___|\__,_|_| |_|

        WordPress Security Scanner by the WPScan Team
                    Version v2.3r59131b6
     Sponsored by the RandomStorm Open Source Initiative
   @_WPScan_, @ethicalhack3r, @erwan_lr, pvdl, @_FireFart_
_______________________________________________________________

[+] URL: http://www.example.it/
[+] Started: Fri Apr  4 20:40:32 2014

[+] Interesting header: SERVER: HTTP OK
[+] XML-RPC Interface available under: http://www.example.it/xmlrpc.php

[+] WordPress version 3.8.1 identified from meta generator

[+] WordPress theme in use: k2 - v1.0.3

 | Name: k2 - v1.0.3
 | Location: http://www.example.it/wp-content/themes/k2/
 | Style URL: http://www.example.it/wp-content/themes/k2/style.css
 | Theme Name: K2
 | Theme URI: http://getk2.com
 | Description: <strong><a href="themes.php?page=k2-options">Configure K2</a></strong> or visit the <a href="http...
 | Author: Various Artists
 | Author URI: http://getk2.com/

[+] Enumerating plugins from passive detection ...
 |  1 plugins found:

 | Name: add-to-any - v1.2.9.2
 | Location: http://www.example.it/wp-content/plugins/add-to-any/
 | Readme: http://www.example.it/wp-content/plugins/add-to-any/README.txt

[+] Enumerating usernames ...
[+] Identified the following 1 user/s:
    +----+-------+-------------------+
    | Id | Login | Name              |
    +----+-------+-------------------+
    | 1  | admin | Amministratore    |
    +----+-------+-------------------+
    | 2  | pino2 | Scrittore Art.    |
    +----+-------+-------------------+

[+] Finished: Fri Apr  4 20:40:36 2014
[+] Memory used: 1.305 MB
[+] Elapsed time: 00:00:03
[root@wpscan_test wpscan]#

Come si può notare in pochi minuti è possibile avere l’intera lista degli utenti sotto gli occhi.
Qualcuno potrebbe obbiettare: “Si ok, ma le password non ci sono”.
Questo è vero, ma è vero anche che un male intenzionato partirebbe già avvantaggiato in un eventuale attacco di tipo bruteforce.
Per chi ne fosse all’oscuro, il bruteforce è un attacco che si basa sui tantissimi tentativi di login con l’utilizzo di username e password casuali.
Esistono tantissimi programmi che agiscono in questo modo in maniera autonoma fino a quando non trovano la combinazione giusta, quindi perchè avvantaggiare il cracker spiattegliandogli l’utente?

Per tamponare questa vulnerabilità non c’è bisogno di alcun plugin ma soltanto di due regole di Rewrite scritte in un file .htacess all’interno della root directory del sito wordpress.

<IfModule mod_rewrite.c>

RewriteEngine On
RewriteBase /

# block user enumeration
RewriteCond %{QUERY_STRING} (^|&)author=
RewriteRule . http://%{SERVER_NAME}/? [L]

</IfModule>

Creato il file .htaccess, testare nuovamente l’applicativo con WPScan:

[root@wpscan_test wpscan]# ./wpscan.rb --url http://www.example.it --enumerate u
_______________________________________________________________
        __          _______   _____
        \ \        / /  __ \ / ____|
         \ \  /\  / /| |__) | (___   ___  __ _ _ __
          \ \/  \/ / |  ___/ \___ \ / __|/ _` | '_ \
           \  /\  /  | |     ____) | (__| (_| | | | |
            \/  \/   |_|    |_____/ \___|\__,_|_| |_|

        WordPress Security Scanner by the WPScan Team
                    Version v2.3r59131b6
     Sponsored by the RandomStorm Open Source Initiative
   @_WPScan_, @ethicalhack3r, @erwan_lr, pvdl, @_FireFart_
_______________________________________________________________

[+] URL: http://www.example.it/
[+] Started: Fri Apr  4 20:39:19 2014

[+] robots.txt available under: 'http://www.example.it/robots.txt'
[+] Interesting header: SERVER: HTTP OK
[+] XML-RPC Interface available under: http://www.example.it/xmlrpc.php

[+] WordPress version 3.8.1 identified from meta generator

[+] WordPress theme in use: k2 - v1.0.3

 | Name: k2 - v1.0.3
 | Location: http://www.example.it/wp-content/themes/k2/
 | Style URL: http://www.example.it/wp-content/themes/k2/style.css
 | Theme Name: K2
 | Theme URI: http://getk2.com
 | Description: <strong><a href="themes.php?page=k2-options">Configure K2</a></strong> or visit the <a href="http...
 | Author: Various Artists
 | Author URI: http://getk2.com/

[+] Enumerating plugins from passive detection ...
 |  1 plugins found:

 | Name: add-to-any - v1.2.9.2
 | Location: http://www.example.it/wp-content/plugins/add-to-any/
 | Readme: http://www.example.it/wp-content/plugins/add-to-any/README.txt

[+] Enumerating usernames ...
[+] We did not enumerate any usernames

[+] Finished: Fri Apr  4 20:39:26 2014
[+] Memory used: 1.105 MB
[+] Elapsed time: 00:00:07

Come si può notare dal risultato gli utenti non vengono più visualizzati.
Se non dovesse funzionare, chiedere al gestore del proprio spazio web  l’abilitazione all’utilizzo dei file .htaccess .