[SUCTF 2018]annonymous

我们进行代码审计

1
2
3
4
5
6
7
8
9
10
11
12
13
<?php

$MY = create_function("","die(`cat flag.php`);");
$hash = bin2hex(openssl_random_pseudo_bytes(32));
eval("function SUCTF_$hash(){"
."global \$MY;"
."\$MY();"
."}");
if(isset($_GET['func_name'])){
$_GET["func_name"]();
die();
}
show_source(__FILE__);

首先创建了一个匿名函数,会输出flag

接着openssl_random_pseudo_bytes(32)生成一个随机数,然后将其转成了十六进制,将其赋值给$hash

题解

[RootersCTF2019]babyWeb

image-20240825195614654

看页面提示是个sql注入,提示过滤了unionsleepor-benchmark

我们先测试字段数,当字段为2时,页面正常回显,为3是则发生报错

1
2
1 order by 2
1 order by 3
题解sql注入

弗拉格之地的入口

根据提示,我们访问robots.txt,得到下一个页面的入口

复现