md5-vs-injection
好久不做题了
肯定是文件泄露了,猜测容易得到index.phps泄露文件,然后看一下是啥
<?php
$flag = 'SniperOJ{********************}';
if(isset($_POST['password'])){
$current_password = "QNKCDZO";
$password = $_POST['password'];
if (($current_password != $password)){
$current_password_md5 = md5($current_password);
$password_md5 = md5($password);
if($current_password_md5 == $password_md5){
echo '<script>alert("You know php well!")</script>';
echo $flag;
}else{
echo('<script>alert("Your password is wrong!")</script>');
}
}else{
echo('<script>alert("Your password is wrong!")</script>');
}
}else{
echo('<script>alert("Input your password!")</script>');
}
?>
然后这就简单了,随便用一个
SniperOJ{pHp_is_the_best_programming_language_in_the_world}
2048
一看到题目中的参考资料发现…githacker???难道是源码泄露??一扫果然是
然后就用githacker下载吧
原来是js脚本啊,其实再chrome上也是可以看的,然后估计就死代码审计了,但是真的什么都没有啊!!!到底是什么鬼啊…
然后看了看高手的提示,这个题原本的问题并不在2048这个程序上,而是再git上!本来chrome就能阅读源码,何必再git上,对吧!因为git是关键点,这个题目是git日志的回转功能,即git再开发的过程中可以记录几个断点,利用git的命令可以返回工程的某个断点位置,类似于虚拟机的快照功能,本题就是把flag藏在了那里…真是…长见识了!
推荐一下王一航的文章,说得很清楚
http://www.jianshu.com/p/e9923b65789e
使用的工具也是需要用一航大牛的,lijiejie的Githacker不可以荡下来git信息
工具地址
https://github.com/wangyihang/githacker
制作过程
mkdir misc
cd misc
git init
echo "my file" > index.php
git add index.php
git commit -m "Init commit"
echo "SniperOJ{xxxxxx}" > flag
git stash save "hide my flag"
git log
git reflog
作者:王一航
链接:http://www.jianshu.com/p/e9923b65789e
來源:简书
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。
王大牛的做法是爆搜
cat `find .`
这个命令可以直接递归打印当前文件夹下所有的文件内容
然后看到了一条比较奇怪的 commit id
使用正常的git指令恢复如下
方法一
git log --reflog
git reset --hard af36ba2d86ee43cde7b95db513906975cb8ece03
首先第一个列出撤销点
看到一个添加什么my secret,然后返回到改断点即可!
然后发现再目录下就被恢复了
打开得到flag
方法二
git stash list | tee
git stash pop # 或者使用 git stash apply
真是学习了,膜一发
SniperOJ-Web-Browser
首先看到说浏览器限制
修改http头部的User-Agent
User