Artikel mit Tag angriff

WPScan - Wordpress Schwachstellen Scanner auf Ubuntu installieren

Eine der meistverwendeten Blogsysteme im Netz ist sicherlich Wordpress. Wie so oft bei beliebter Software, ist Wordpress auch ein begehrtes Angriffsziel für Hacker und Co.

Um diesen vorzugreifen ist ein regelmäßiger Test auf Sicherheitslücken sinnvoll. Ein perfektes Tool für solche Penetrationstests ist WPScan. Der WordPress Security Scanner ist auf bekannten Sicherheitsdistributionen wie Kali Linux oder BackBox vorhanden, lässt sich aber auch recht einfach auf einem Ubuntu Server 14.04 in Betrieb nehmen.

wpscan

Installation WordPress Security Scanner auf Ubuntu Server 14.04 LTS

Zunächst wird Ruby benötigt. Damit die Installation aktuell ist, wird dazu das Brightbox Repository verwendet. Danach werden weitere Pakete installiert, um dann den WPScanner via git zu laden.

Installation

sudo apt-get install software-properties-common
sudo apt-add-repository ppa:brightbox/ruby-ng
sudo apt-get update
sudo apt-get install ruby2.2 ruby2.2-dev git libxml2 libxml2-dev libxslt1-dev libcurl4-gnutls-dev

 

WPScan von Github herunterladen

sudo git clone https://github.com/wpscanteam/wpscan.git
cd wpscan/
sudo su
   gem install bundler && bundle install --without test

Successfully installed bundler-1.8.3
Parsing documentation for bundler-1.8.3
Done installing documentation for bundler after 3 seconds
1 gem installed
Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this application for all non-root users on this machine.
Fetching gem metadata from https://rubygems.org/.........
Fetching version metadata from https://rubygems.org/..
Resolving dependencies...
Installing addressable 2.3.7
Installing ffi 1.9.6
Installing ethon 0.7.3
Installing json 1.8.2
Installing mini_portile 0.6.2
Installing nokogiri 1.6.6.2
Installing ruby-progressbar 1.7.1
Installing terminal-table 1.4.5
Installing typhoeus 0.7.1
Using bundler 1.8.3
Bundle complete! 10 Gemfile dependencies, 10 gems now installed.
Gems in the group test were not installed.
Use `bundle show [gemname]` to see where a bundled gem is installed.

Update der WPScan Datenbank

sudo ./wpscan.rb --update
_______________________________________________________________
        __          _______   _____
        \ \        / /  __ \ / ____|
         \ \  /\  / /| |__) | (___   ___  __ _ _ __
          \ \/  \/ / |  ___/ \___ \ / __|/ _` | '_ \
           \  /\  /  | |     ____) | (__| (_| | | | |
            \/  \/   |_|    |_____/ \___|\__,_|_| |_|

        WordPress Security Scanner by the WPScan Team
                       Version 2.6
          Sponsored by Sucuri - https://sucuri.net
   @_WPScan_, @ethicalhack3r, @erwan_lr, pvdl, @_FireFart_
_______________________________________________________________

[i] Updating the Database ...
[i] Update completed.

wpscan_logo

Schwachstellen Scan auf installierte Themes oder Plugins

Die Überprüfung einer vorhandenen Wordpress Installation erfolgt über den Befehl --"url" gefolgt von der Scan Methode "--enumerate vt" überprüft in diesem Fall Templates auf Schwachstellen (momentan über 300).

Das "v" steht für den Verbose Mode und gibt etwas mehr Infos auf der Kommandozeile aus.

Ein Scan auf installierte Plugins würde beispielsweise mit dem Schlüssel "--enumerate -vp" gestartet. Hier befinden sich zurzeit über 2000 in der Datenbank.

Als Beispiel habe ich einen Scan auf Sicherheitslücken installierter Themes gewählt.

sudo ./wpscan.rb --url www.url.de --enumerate vt
 
_______________________________________________________________
        __          _______   _____
        \ \        / /  __ \ / ____|
         \ \  /\  / /| |__) | (___   ___  __ _ _ __
          \ \/  \/ / |  ___/ \___ \ / __|/ _` | '_ \
           \  /\  /  | |     ____) | (__| (_| | | | |
            \/  \/   |_|    |_____/ \___|\__,_|_| |_|

        WordPress Security Scanner by the WPScan Team
                       Version 2.6
          Sponsored by Sucuri - https://sucuri.net
   @_WPScan_, @ethicalhack3r, @erwan_lr, pvdl, @_FireFart_
_______________________________________________________________

[+] URL: http://www.url.de/
[+] Started: Thu xxx x xxx:xx:xx xxxx

[+] robots.txt available under: 'http://www.url.de/robots.txt'
[!] The WordPress 'http://www.url.de/readme.html' file exists exposing a version number
[!] Full Path Disclosure (FPD) in: 'http://www.url.de/wp-includes/rss-functions.php'
[+] Interesting header: SERVER: nginx/x.x.x
[+] Interesting header: X-POWERED-BY: PHP/x.x.x
[+] XML-RPC Interface available under: http://www.url.de/xmlrpc.php
[i] This may allow the GHOST vulnerability to be exploited, please see: https://www.rapid7.com/db/modules/auxiliary/scanner/http/wordpress_ghost_scanner

[+] WordPress version 4.0.1 identified from rss generator

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

[+] Name: 2-click-socialmedia-buttons - v1.6.4
 |  Location: http://www.url.de/wp-content/plugins/2-click-socialmedia-buttons/
 |  Readme: http://www.url.de/wp-content/plugins/2-click-socialmedia-buttons/readme.txt

[+] Name: font-awesome - v3.2.1
 |  Location: http://www.url.de/wp-content/plugins/font-awesome/
 |  Readme: http://www.url.de/wp-content/plugins/font-awesome/readme.txt

[+] Name: redactor - v3.1.45
 |  Location: http://www.url.de/wp-content/plugins/redactor/
 |  Readme: http://www.url.de/wp-content/plugins/redactor/readme.txt

[+] Enumerating installed themes (only vulnerable ones) ...

   Time: 00:01:10 <=================================================================================================================================================> (325 / 325) 100.00% Time: 00:01:10

[+] We found 309 themes:
[+] Name: 5star
 |  Location: http://www.url.de/wp-content/themes/5star/
 |  Style URL: http://www.url.de/wp-content/themes/5star/style.css
 |  Description:

[+] We could not determine a version so all vulnerabilities are printed out

[!] Title: 5star - Templatic Theme CSRF File Upload Vulnerability
    Reference: https://wpvulndb.com/vulnerabilities/7484
    Reference: http://1337day.com/exploit/22091

 

Troubleshooting

Fehlende Rechte bei der Installation von bundler, bringen folgende Meldung zu Tage.

Gelöst werden kann dies beispielsweise mit dem Wechsel in die Root Umgebung.

??? ERROR REPORT TEMPLATE ???????????????????????????????????????????????????????
- What did you do?
- What did you expect to happen?
- What happened instead?

Error details

    Errno::EACCES: Permission denied @ dir_s_mkdir - /scan/wpscan/.bundle
    /usr/lib/ruby/2.2.0/fileutils.rb:252:in `mkdir'
    /usr/lib/ruby/2.2.0/fileutils.rb:252:in `fu_mkdir'
    /usr/lib/ruby/2.2.0/fileutils.rb:226:in `block (2 levels) in mkdir_p'
    /usr/lib/ruby/2.2.0/fileutils.rb:224:in `reverse_each'
    /usr/lib/ruby/2.2.0/fileutils.rb:224:in `block in mkdir_p'
    /usr/lib/ruby/2.2.0/fileutils.rb:210:in `each'
    /usr/lib/ruby/2.2.0/fileutils.rb:210:in `mkdir_p'

Fazit

Wer Wordpress im Einsatz hat, sollte die Installation aktuell halten, Sicherheitsplugins installieren und auf vorhandene Lücken testen. Mit WPScan ist ein brauchbares OpenSource Tool auf Github für einen Penetrationstest vorhanden.