第六章:MySQL高级进阶-黑客常说的SQL注入是什么?

直接学习:https://edu.csdn.net/course/play/27328/370720
黑客常说的SQL注入是什么?
#1、SQL注入(sql injection )是指应用程序对用户输入数据的合法性没有判断,没有过滤攻击者可以在应用程序中通过表单提交特殊的字符串,该特殊字符串会改变SQL语句的运行结果,从而在管理员毫不知情的情况下实现非法操作,以此来实现欺骗数据库的执行非授权的任意查询。
在这里插入图片描述
#2、示例代码入下:

create table user(
id int not null auto_increment primary key,
username varchar(30) comment '用户名',
password varchar(30) comment '密码'
);

insert into user(username,password) values('admin','123456');
insert into user(username,password) values('test','123456');
select * from user where username='admin' and password = '123456';
select * from user where username='test' and password = '123456';

select * from user where username='xyz' and password ='' or '1'='1';
发布了107 篇原创文章 · 获赞 6 · 访问量 968

猜你喜欢

转载自blog.csdn.net/weixin_43597208/article/details/105526881
今日推荐