目录

Tomato靶机攻略

Tomato靶机攻略

将tomato改为NAT模式

扫描ip

arp-scan -l

https://i-blog.csdnimg.cn/direct/7e9ade553a68405ab498e2becfb67664.png

扫描端口,发现ssh服务端口从22改为2211

扫描目录

https://i-blog.csdnimg.cn/direct/8b36f7b6e1a2415a82b481d4fa289471.png

发现http://192.168.31.134/antibot_image/  访问

https://i-blog.csdnimg.cn/direct/00ed398dfb6e4488b30889c1646d20fc.png

查看所有php文件的源码,看看有什么不同的地方

在info.php的源码中发现问题

https://i-blog.csdnimg.cn/direct/692b99a50a7446f2bd1f6f133476ecaa.png

https://i-blog.csdnimg.cn/direct/e65d916db40e4ac98f2958776879fd14.png

在输入后,成功显示,说明文件包含漏洞

info.php?image=/etc/passwd

https://i-blog.csdnimg.cn/direct/81020aecffab41b5bc191509b53f76c9.png

通过/var/log/auth.log这个在linux中使用的日志文件,成功查看到日志

info.php?image=/var/log/auth.log

https://i-blog.csdnimg.cn/direct/e18b7a06138a46ee83cb9806abc42d5d.png

使用ssh登录,看日志里会不会出现记录

https://i-blog.csdnimg.cn/direct/b06a4fd9a0d1427a91ec163fce9f3275.png

发现日志中有记录

使用kali,让一句话木马写入日志中

ssh ‘’@192.168.31.134 -p 2211,

我的kali写入失败,选择用xshell连接

https://i-blog.csdnimg.cn/direct/55e61351bdf549a9beab5fc29970bfab.png

https://i-blog.csdnimg.cn/direct/7cb2027715a6498baf830bb4b7a05582.png

之后点击连接,当然肯定会失败,日志记录了就可以

https://i-blog.csdnimg.cn/direct/1d32dc709b504770a78fda34e1900b9c.png

使用中国蚁剑连接

https://i-blog.csdnimg.cn/direct/ff53ab801e144c92be207fece798812a.png