show me you smile
来源:互联网 发布:公网ip绑定域名 nginx 编辑:程序博客网 时间:2024/04/28 13:17
地址:
http://hackinglab.cn/ShowQues.php?type=scripts
参考:
https://www.waitalone.cn/security-scripts-game.html
验证咋一看有两处逻辑矛盾。
1. $_GET
数组本身提取自$_SERVER['QUERY_STRING']
,而$_GET['^_^']
中的key包含_
符号,而$_SERVER['QUERY_STRING']
却不允许。
2. file_exists
需要寻找的文件必须不存在,但file_get_content
却能读到文件内容。
绕过1可以通过将^_^
修改为^.^
,服务器端PHP会自动将.
改为_
。然而当我请求这样的url的时候,
http://localhost/~caiqiqi/lab1.xseclab.com/?^.^=flag.php
却被preg_match
的/\./
给挡住了。
该参考给出的思路:
1. 当.
或者[]
之类的符号作为参数的key的时候,会被PHP改写为_
,但由于$_SERVER['QUERY_STRING']
为用户提交的内容,所以不被修改。参考:http://ca.php.net/variables.external。
2. file_get_content
可以获取远程数据,但常用网络协议都已经被正则过滤,因此需要选取其他协议。查阅PHP支持的协议和包装,发现RFC 2397的data协议可用。巧合的是,file_exists
对于data指向的内容判断为不存在。
于是可以构造这样的url http://lab1.xseclab.com/base13_ead1b12e47ec7cc5390303831b779d47/index.php?^.^=data://text/plain;charset=unicode, (●'◡'●)
//之前将unicode和(●’◡’●)之间的,
看成了空格,于是没能得到正确响应。
- show me you smile
- Did you smile today?
- You&&Me
- Give Me a Handle, and I'll Show You an Object
- Give Me a Handle, and I'll Show You an Object
- Show me the Template
- Show me the Template
- Show me the money
- Show Me the Money
- Smile
- Smile
- Smile
- smile
- smile
- smile
- Smile
- smile
- Because You Loved Me
- ORB原理与Opencv源码解析
- 【matlab 爬虫】用matlab做网络爬虫入门系列1
- coreML 初窥
- Java事务(6)——使用动态代理(Dynamic Proxy)
- Oracle查询用户所有表
- show me you smile
- k3-Cloud开发初识常见问题
- Java中Runnable和Thread的区别
- from module import 和 import module 的区别
- A Practical Model for Subsurface Light Transport 中文翻译
- windows+iis的平台上搭建支持php+mysql 服务器上也是一样
- Struts2遇到的问题
- spring相关题目
- Java事务(7)——使用Transactional注解