Web_php_unserialize解题思路

分析一下
__construct:当使用 new 操作符创建一个类的实例时,构造方法将会自动调用
__destuct:在销毁一个类之前执行执行 __wakeup,unserialize()` 会检查是否存在一个`__wakeup()` 方法。如果存在,则会先调用 `__wakeup` 方法,预先准备对象需要的资源。

检查变量var是否存在然后在base64解密 正则过滤了首字母为o或c,冒号,一个或多个数字,冒号,忽略大小写 成功提示stop hacking,失败反序列化var变量 程序结束会销毁新建的Demo对象,触发__destruct()。
这只要对Demo这个类进行序列化,base64加密之后,赋值给var变量进行get传参就行了。
但是
1.反序列化时调用,__wakeup会把$file重置成index.php。
2.序列化开头又字母O,这里被正则过滤了。
想想办法
绕过__wakeup():
绕过__wakeup()是利用CVE-2016-7124漏洞,例如O:4:"Demo":2:{s:10:"\0Demo\0file";s:8:"fl4g.php";}(正常是O:4:"Demo":1:...),反序列化化时不会触发__wakeup()。 (就是只需要令序列化字符串中标识变量数量的值大于实 际变量即可绕过__wakeup()函数)。
绕过正则:
使用+可以绕过preg_match() 正则匹配这里匹配的是 O:4,我们用 O:+4 即可绕过。

构造payload

Web_php_unserialize解题思路的更多相关文章
- n皇后2种解题思路与代码-Java与C++实现
林炳文Evankaka原创作品.转载请注明出处http://blog.csdn.net/evankaka 摘要:本文主要讲了n皇后问题的解题思路,并分别用java和c++实现了过程,最后,对于算法改进 ...
- 阿里聚安全攻防挑战赛第三题Android PwnMe解题思路
阿里聚安全攻防挑战赛第三题Android PwnMe解题思路 大家在聚安全挑战赛正式赛第三题中,遇到android app 远程控制的题目.我们今天带你一探究竟,如何攻破这道题目. 一.题目 购物应用 ...
- [LeetCode] 16. 3Sum Closest 解题思路
Given an array S of n integers, find three integers in S such that the sum is closest to a given num ...
- [LeetCode] 234. Palindrome Linked List 解题思路
Given a singly linked list, determine if it is a palindrome. Follow up:Could you do it in O(n) time ...
- [LeetCode] 76. Minimum Window Substring 解题思路
Given a string S and a string T, find the minimum window in S which will contain all the characters ...
- [LeetCode] 3Sum 解题思路
Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all un ...
- [LeetCode] Minimum Size Subarray Sum 解题思路
Given an array of n positive integers and a positive integer s, find the minimal length of a subarra ...
- [LeetCode] Word Break 解题思路
Given a string s and a dictionary of words dict, determine if s can be segmented into a space-separa ...
- [LeetCode] Longest Valid Parentheses 解题思路
Given a string containing just the characters '(' and ')', find the length of the longest valid (wel ...
随机推荐
- Postgresql DB安装和使用问题记录
2.选择语言后提示: Error: There has been an error. Please put SELinux in permissive mode and then run instal ...
- Linux - Python的虚拟环境配置的坑 virtualenv: error: unrecognized arguments: --no-site-packages
如果你在CentOS8下面配置虚拟环境时,遇到如下错误: [root@localhost ~]# mkvirtualenv my_django usage: virtualenv [--version ...
- Jmeter基础001----jmeter的安装与配置
一.Java环境安装 1.下载jdk----oracal官网 2.JDK版本要求: JMeter2.x- jdk1.6 ...
- C++中为什么按两次ctrl+D才能结束标准I/O
参考资料: https://www.douban.com/group/topic/127062773/ 今天学习了C++语言的标准I/O,也就是std::cin和std::cout,但是我发现当系统在 ...
- 002.OpenShift安装与部署
一 前置条件说明 1.1 安装准备概述 Red Hat OpenShift容器平台是由Red Hat作为RPM包和容器映像两种类型存在.RPM包使用订阅管理器从标准Red Hat存储库(即Yum存储库 ...
- 迷你图书管理系统 源代码 Java初级小项目
今天博主再给大家分享一个小项目:MiNi图书管理系统.用的是Java语言开发的,代码不多,大概260行左右吧,系统是实现图书的新增图书.删除图书.借阅图书.归还图书.查看图书等简单的功能(后附源代码) ...
- sed 命令使用入门
上一篇说了 awk 命令的基本使用方法,这一篇就来说说其兄弟 sed 的使用方法吧(传说之中,Linux 命令行下处理文件文件三大上古神器:grep.awk.sed,每一个都很好很强大,有时间了说说 ...
- I/O格式化与运算符
I/O格式化与运算符 输出函数 Python3 - print() 在Python3中.print()的使用方法如下: >>> # ==== Python3 print() ==== ...
- dart快速入门教程 (8)
9.dart中的库 9.1.自定义库 自定义库我们在前面已经使用过了,把某些功能抽取到一个文件,使用的时候通过import引入即可 9.2.系统内置库 以math库为例: import "d ...
- 1.记我的第一次python爬虫爬取网页视频
It is my first time to public some notes on this platform, and I just want to improve myself by reco ...