[MRCTF2020]Ez_bypass
目录
信息收集
打开靶场页面显示给出提示
I put something in F12 for you
include 'flag.php';
$flag='MRCTF{xxxxxxxxxxxxxxxxxxxxxxxxx}';
if(isset($_GET['gg'])&&isset($_GET['id'])) {
$id=$_GET['id'];
$gg=$_GET['gg'];
if (md5($id) === md5($gg) && $id !== $gg) {
echo 'You got the first step';
if(isset($_POST['passwd'])) {
$passwd=$_POST['passwd'];
if (!is_numeric($passwd))
{
if($passwd==1234567)
{
echo 'Good Job!';
highlight_file('flag.php');
die('By Retr_0');
}
else
{
echo "can you think twice??";
}
}
else{
echo 'You can not get it !';
}}
else{
die('only one way to get the flag');
}
}
else {
echo "You are not a real hacker!";
}
}
else{
die('Please input first');
}
}Please input first
代码如下
-
-
include 'flag.php';
-
$flag='MRCTF{xxxxxxxxxxxxxxxxxxxxxxxxx}';
-
if(isset($_GET['gg'])&&isset($_GET['id'])) {
-
$id=$_GET['id'];
-
$gg=$_GET['gg'];
-
if (md5($id) === md5($gg) && $id !== $gg) {
-
echo 'You got the first step';
-
if(isset($_POST['passwd'])) {
-
$passwd=$_POST['passwd'];
-
if (!is_numeric($passwd))
-
{
-
if($passwd==1234567)
-
{
-
echo 'Good Job!';
-
highlight_file('flag.php');
-
die('By Retr_0');
-
}
-
else
-
{
-
echo "can you think twice??";
-
}
-
}
-
else{
-
echo 'You can not get it !';
-
}
-
-
}
-
else{
-
die('only one way to get the flag');
-
}
-
}
-
else {
-
echo "You are not a real hacker!";
-
}
-
}
-
else{
-
die('Please input first');
-
}
-
}
-
代码审计
可以看到题目需要我们传两个GET参数和一个POST参数
需要绕过两处:(md5($id) === md5($gg) && $id !== $gg)=true
(!is_numeric($passwd) && $passwd==1234567)=true
第一个判断
payload
id[]=1&gg[]=2
第二层判断
php弱类型比较
php==在比较不同类型的数据时,会首先将==两边的数据转化为同一类型,字符型数据与数字型数据进行比较,字符型数据会转化为数据型数据。
需要passwd非数字且==1234567
payload
passwd=1234567coleak
传参方式
在 网址?id[]=1&gg[]=2页面通过post请求传入第二个payload
最后整合如下,同时进行get和post传参
拿到flag
补充说明
md5(array()) = null
sha1(array()) = null
ereg(pattern,array()) = null vs preg_match(pattern,array) = false
strcmp(array(), "abc") = null
strpos(array(),"abc") = null
这篇好文章是转载于:学新通技术网
- 版权申明: 本站部分内容来自互联网,仅供学习及演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,请提供相关证据及您的身份证明,我们将在收到邮件后48小时内删除。
- 本站站名: 学新通技术网
- 本文地址: /boutique/detail/tanhgfjfcg
-
photoshop保存的图片太大微信发不了怎么办
PHP中文网 06-15 -
Android 11 保存文件到外部存储,并分享文件
Luke 10-12 -
word里面弄一个表格后上面的标题会跑到下面怎么办
PHP中文网 06-20 -
《学习通》视频自动暂停处理方法
HelloWorld317 07-05 -
photoshop扩展功能面板显示灰色怎么办
PHP中文网 06-14 -
微信公众号没有声音提示怎么办
PHP中文网 03-31 -
excel下划线不显示怎么办
PHP中文网 06-23 -
excel打印预览压线压字怎么办
PHP中文网 06-22 -
怎样阻止微信小程序自动打开
PHP中文网 06-13 -
TikTok加速器哪个好免费的TK加速器推荐
TK小达人 10-01