HTB(hack the box) FreeLancer

HTB(hack the box) FreeLancer

这是一道30points的web题。
HTB(hack the box) FreeLancer
提示:
你能测试我的网站有多安全吗?证明我错了,拿到flag!

进入网站:
HTB(hack the box) FreeLancer
继续往下浏览:
HTB(hack the box) FreeLancer
看到了这个,难道是xss?构造后send,提示:
HTB(hack the box) FreeLancer
看来不是xss,只能继续寻找。
然后我看到了:
HTB(hack the box) FreeLancer
一个长期存在的事实是,当读者在看一个页面的布局时,他们会被可读的内容分散注意力。

会不会在源码中?
查看源码,最后发现了线索:
HTB(hack the box) FreeLancer
跟过去,发现:

HTB(hack the box) FreeLancer
应该是sql注入。
测试、得到列,得到数据库,查看用户、查看权限。

3列、
HTB(hack the box) FreeLancer
HTB(hack the box) FreeLancer
HTB(hack the box) FreeLancer
发现是root权限。那么我们就可以读取文件了。
先测试/etc/passwd
HTB(hack the box) FreeLancer
成功读取文件。
接下来,就需要得到绝对路径:
因为目标服务器为linux,那么路径应该为/var/www/html/
测试:
HTB(hack the box) FreeLancer
路径果然是这个。
接下来,就需要得到flag的文件。
使用dirbuster来爆目录。最后在administrat目录下发现了一个文件panel.php

读取文件,得到flag。
HTB(hack the box) FreeLancer
红色遮盖的就为flag。
提交,30points到手。