web
web1
https://segmentfault.com/a/1190000016750234
知识基础
涉及到的几个函数:
1.$_REQUEST: 可以获取以POST方法和GET方法提交的数据,但是速度比较慢
2.eval: 把字符串按照 PHP 代码来计算,该字符串必须是合法的 PHP 代码,且必须以分号结尾。
1 |
|
3.var_dump: 函数用于输出变量的相关信息
1 | # 数字 |
解题思路
eval应该是此题的突破口,能够执行php代码。
hello是接受参数的变量,接下来就是构建hello变量,使其能够闭合var_dump,利用print_r输出
首先闭合var_dump: 1)";
第二步构建print_r:print_r(file("./flag.php"));
URL构建结束:
http://123.206.87.240:8003/index.php?hello=1);print_r(file("./flag.php")
构建的URL触发的 eval操作为
eval("var_dump(1);print_r(file("./flag.php")")
成功输出 flag.php 文件内容
web2
这题考爆破密码
web3
这题源码有问题
知识基础
PHP自动化的全局变量:**$GLOBALS** — 引用全局作用域中可用的全部变量,一个包含了全部变量的全局组合数组。变量的名字就是数组的键解题思路
正则表达式”/^\w+$/“,匹配字符串,\w表示字符+数字+下划线{ a-z,A-Z,_,0-9 }。如果不匹配会输出 ‘’args error!‘’\
1 | 两个`/``/`表明正则表达式的开始与结束,`^`开始字符,`$`结束字符,`+`代表可以有一个或多个`\w` |
PHP中变量可以当作另一个变量的变量名:$$args,结合第一句flag In the variable !
所以构造payload:URL?args=BLOBLAS
即可爆出所有args,其中包含flag
web4
知识基础
通过抓包修改file值的办法去运行一些本来不该运行的文件
也可以通过此方法直接输出一些敏感的配置文件和远程包含shell(需要目标主机开启allow_url_fopen)
解题思路
通过构造如下语句:
1 | http://xxx.com/index.php?file=php://filter/read=convert.base64-encode/resource=xxx.php |
就能获得xxx.php的代码的base64加密结果,通过base64解密后便可获得xxx.php的代码
web5
知识基础
这题不难,看php语言都会了解题思路
1 | $what=$_GET['what']; |
1 | http://xxx.com/?what=flag |
web6
知识基础
1 | $what=$_POST['what']; |
解题思路
很明显这个是post请求web7
知识基础
> JavaScript是一种属于网络的脚本语言,已经被广泛用于Web应用开发,常用来为网页添加各式各样的动态功能,为用户提供更流畅美观的浏览效果。通常JavaScript脚本是通过嵌入在HTML中来实现自身的功能的。 > jother是另类的javascript工具 > 一堆+!的东西就用jother解码 > 可以打开谷歌浏览器 按F12 > 然后console将那堆解码的东西复制过去 按回车即可解码 >解题思路
多看源码,我也不知道这是什么鬼copy到console
显示”ctf{whatfk}”
得到flag
web8
知识基础
1 | php |
解题思路
构造num=1X X还可以是任何字母或者字符串,构造url:http://xxx.com/get/index1.php?num=1xx得到flag
web9
知识基础
1
解题思路
1
web10
知识基础
1
解题思路
1
web11
知识基础
1
解题思路
1
web12
知识基础
1
解题思路
1
web13
知识基础
1
解题思路
1
web14
知识基础
1
解题思路
1
web15
知识基础
1
解题思路
1
web16
知识基础
1
解题思路
1
XRSec has the right to modify and interpret this article. If you want to reprint or disseminate this article, you must ensure the integrity of this article, including all contents such as copyright notice. Without the permission of the author, the content of this article shall not be modified or increased or decreased arbitrarily, and it shall not be used for commercial purposes in any way