> For the complete documentation index, see [llms.txt](https://gitbook-88.gitbook.io/ctf-writeup/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://gitbook-88.gitbook.io/ctf-writeup/ba-chang/gong-fang-shi-jie/php2.md).

# PHP2

phps文件就是php的源代码文件，通常用于提供给用户（访问者）查看php代码，因为用户无法直接通过Web浏览器看到php文件的内容，所以需要知用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，所以大概是要通过两次urldecode。

将admin连续urlencode两次得到payload。

?id=%2561dmin
