標題:Hack The Box —— Blocky

taibeihacker

Moderator

Hack The Box —— Blocky​

20190906143059.png-water_print

信息搜集​

nmap​

1
nmap -T4 -A -v 10.10.10.37
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
Starting Nmap 7.80 ( https://nmap.org ) at 2019-09-06 10:37 CST
PORT STATE SERVICE VERSION
21/tcp open ftp ProFTPD 1.3.5a
22/tcp open ssh OpenSSH 7.2p2 Ubuntu 4ubuntu2.2 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey:
| 2048 d6:2b:99:b4:d5:e7:53:ce:2b:fc:b5:d7:9d:79:fb:a2 (RSA)
| 256 5d:7f:38:95:70:c9:be:ac:67:a0:1e:86:e7:97:84:03 (ECDSA)
|_ 256 09:d5:c2:04:95:1a:90:ef:87:56:25:97:df:83:70:67 (ED25519)
80/tcp open http Apache httpd 2.4.18 ((Ubuntu))
|_http-generator: WordPress 4.8
| http-methods:
|_ Supported Methods: GET HEAD POST OPTIONS
|_http-server-header: Apache/2.4.18 (Ubuntu)
|_http-title: BlockyCraft #8211; Under Construction!
8192/tcp closed sophos
Service Info: OSs: Unix, Linux; CPE: cpe:/o:linux:linux_kernel
開放了21、22、80 端口。
嘗試搜索ProFTPD 1.3.5a 版本的漏洞,發現未授權文件複製漏洞,利用msf 測試,無法利用。
訪問80 端口,是一個簡單的WordPress 站點, 利用wpscan 工具進行掃描:
1
wpscan --enumerate t --enumerate p --enumerate u --url=http://10.10.10.37/
得到以下信息:
使用者名稱
notch
主題
twentyseventeen
插件
akismet - v3.3.2
未發現相關漏洞。

目录爆破​

使用dirbuster 工具,得到以下結果:
20190906144201.png-water_print

發現了一個plugins 目錄,由於正常的wp 插件目錄存放在wp-content/plugins 下,訪問
該目錄,得到兩個jar 包:
20190906144339.png-water_print

將jar 包下載到本地,反編譯,得到數據庫的用戶名的密碼:
20190906144431.png-water_print

嘗試使用該密碼登錄phpmyadmin,發現成功登錄:
20190906144525.png-water_print

漏洞利用​

在現有的基礎上,嘗試使用sql語句讀文件,首先查看可讀目錄的範圍:
1
show GLOBAL VARIABLES like '%secure_file_priv'
20190906144733.png-water_print

但是目錄被限制,轉而其它思路。
想到密碼可能重複利用,遂利用notch 賬戶和mysql 的密碼登錄ssh。
發現可以登錄。
20190906145108.png-water_print

查看user.txt 獲得第一個flag。
嘗試權限提升,但是試了好多方法都不行,突然想到再次用相同的密碼切到root 用戶,發現成功切到root。
查看root.txt,得到第二個flag。
20190906145332.png-water_print
 
返回
上方