分析一下

__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解题思路的更多相关文章

  1. n皇后2种解题思路与代码-Java与C++实现

    林炳文Evankaka原创作品.转载请注明出处http://blog.csdn.net/evankaka 摘要:本文主要讲了n皇后问题的解题思路,并分别用java和c++实现了过程,最后,对于算法改进 ...

  2. 阿里聚安全攻防挑战赛第三题Android PwnMe解题思路

    阿里聚安全攻防挑战赛第三题Android PwnMe解题思路 大家在聚安全挑战赛正式赛第三题中,遇到android app 远程控制的题目.我们今天带你一探究竟,如何攻破这道题目. 一.题目 购物应用 ...

  3. [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 ...

  4. [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 ...

  5. [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 ...

  6. [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 ...

  7. [LeetCode] Minimum Size Subarray Sum 解题思路

    Given an array of n positive integers and a positive integer s, find the minimal length of a subarra ...

  8. [LeetCode] Word Break 解题思路

    Given a string s and a dictionary of words dict, determine if s can be segmented into a space-separa ...

  9. [LeetCode] Longest Valid Parentheses 解题思路

    Given a string containing just the characters '(' and ')', find the length of the longest valid (wel ...

随机推荐

  1. 【百度前端学院 Day4】背景边框列表链接和更复杂的选择器

    1. 背景 背景指的是元素内容.内边距和边界下层的区域(可用background-clip修改) background-color  背景色 background-image  背景图片(url) b ...

  2. ArrayList、LinkedList、Vector、Array和HashMap、HashTable

    就 ArrayList 与 Vector 主要从二方面来说. 一.同步性:Vector 是线程安全的,也就是说是同步的,而ArrayList 是线程序不安全的,不是同步的 二.数据增长:当需要增长时, ...

  3. 使用navicat连接mysql连接错误:Lost connection to Mysql server at 'waiting for initial communication packet'

    使用navicat时,报错截图如下: 原因分析: mysql开启了DNS的反向解析功能,这样mysql对连接的客户端会进行DNS主机名查找. mysql处理客户端解析过程: 当mysql的client ...

  4. C#数据结构与算法系列(一):介绍

    1.介绍 数据结构:是指相互之间存在一种或多种特定关系的数据元素的集合用计算机存储.组织数据的方式.数据结构分别为逻辑结构.(存储)物理结构和数据的运算三个部分. 数据结构包括:线性结构和非线性结构. ...

  5. Source Insight 中的 Auto Indenting

    编码过程中,希望输入花括号时能自动对齐,Source Insigth 应如何设置? 先来看一下Source Insight 中的帮助. “ Auto Indenting The auto-indent ...

  6. LVS实现四层负载均衡

    LVS详解(思维导图) 1. 集群概述 1.1 Linux Cluster Linux Cluster的类型 LB(Load Balance) HA(High Available) HP(High P ...

  7. [TopCoder]Seatfriends

    题目   点这里看题目. 分析   可以想到用 DP 解决.   由于把空位放到状态里面太麻烦了,因此我们单独将 " 组 " 提出来进行 DP .   \(f(i,j)\):前\( ...

  8. 使用vscode 开发go项目的最新姿势. go版本1.14.2

    使用了go 1.14.2. 版本, 再也不用建src, pkg, bin 目录了,   以及再也不用强制配置GOPATH了 前提条件: 必须是 go mod 项目. 在工程目录下, 执行这样的命令生成 ...

  9. ASP.NET处理管道初谈

    客户端往发送的请求到达服务端到服务端响应回客户端的这段时间内,实际上服务器内并不只是简单地对请求进行处理,然后把处理结果响应回去,而是经过一系列多达19个事件之后才能产生最后地处理结果. 因此:其处理 ...

  10. JS新界面关闭原界面刷新的多种形式

    ------------恢复内容开始------------ 1.新界面为当前界面弹出的形式: 第一步:首先原界面的原生JS事件需要放到 (function () {  ......  })(); 中 ...