XCTF-WEB-高手进阶区-PHP2-笔记

鬼才作者。。。特么卡了我那么长时间,这知识点我真不知道

o(╥﹏╥)o 拿Dirserach扫只能扫出来index.php和index.php/login 一度让我怀疑是有我不会的姿势去解这道题

 

 最后忍不了了去网上找答案才发现(⇀‸↼‶)  居然是Index.phps

 你强

 得到代码:

<?php
if("admin"===$_GET[id]) {
  echo("<p>not allowed!</p>");
  exit();
}

$_GET[id] = urldecode($_GET[id]);
if($_GET[id] == "admin")
{
  echo "<p>Access granted!</p>";
  echo "<p>Key: xxxxxxx </p>";
}
?>

Can you anthenticate to this website?

 

 注意Urldecode 代码中的urldecode,应是将“admin”给编码

 一次编码会自动转化为admin,会报not allow

 

 俩次编码admin,得到%25%36%31%25%36%34%25%36%64%25%36%39%25%36%65

 因此Url为:http://159.138.137.79:64420/?id=%25%36%31%25%36%34%25%36%64%25%36%39%25%36%65

 

 

 

  在使用站长之家去做urlencode的时候发现总是没法编码,是因为站长之家默认是对基本类型进行编码

  网上找到了一个能正常编码的网站:http://web.chacuo.net/charseturlencode

  PHPS释义参考:https://filext.com/file-extension/PHPS

posted @ 2020-04-16 21:14  Yeung丶  阅读(245)  评论(0编辑  收藏  举报