极客大挑战2019EasySQL

 如果不输入

 随便输入

 由地址栏的check.php?username=sadsad&password=sadsad可以猜测sql语句:

$sql="select * from xx where username='$name' and password='$password'";

既然是考sql注入,先试试万能密码

用户名:’ or 1#

密码随意

判断是否正确的sql语句可能为:$sql="select * from xx where username='$name' and password='$password'";

当输入' or 1#会变为:select * from xx where username='' or 1 # 'and password='$password'

#为sql语句的注释符,#后面的会被注释掉

即$sql="select * from xx where username='' or 1 ";(username='' 是两个单引号);

这样也就不需要密码正确与否了。

 成功拿到flag

posted on   没名字别找了  阅读(29)  评论(0编辑  收藏  举报

相关博文:
阅读排行:
· 地球OL攻略 —— 某应届生求职总结
· 周边上新:园子的第一款马克杯温暖上架
· Open-Sora 2.0 重磅开源!
· 提示词工程——AI应用必不可少的技术
· .NET周刊【3月第1期 2025-03-02】
点击右上角即可分享
微信分享提示