码迷,mamicode.com
首页 > 数据库 > 详细

sql注入

时间:2019-01-24 20:42:07      阅读:190      评论:0      收藏:0      [点我收藏+]

标签:sel   利用   where   不为   .exe   select   本质   cursor   info   

用处 ;  防止用户利用特殊符号来进行非法登录

uname = input()

upwd = input()

sql = select * from userinfo where user= %s and upwd=%s

res = cursor.execute(sql,[uname,upwd]))#这样可以防止用户使用特殊符号,本质是吧特殊符号进行了替换 将特殊符号过滤掉

where res :#res为的到的行数  如果这个行数不为0 说明账号密码正确

  print(登录成功)

sql注入

标签:sel   利用   where   不为   .exe   select   本质   cursor   info   

原文地址:https://www.cnblogs.com/16795079a/p/10316581.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!