码迷,mamicode.com
首页 > Web开发 > 详细

【实验吧】CTF_Web_登录一下好吗?

时间:2017-11-02 00:04:40      阅读:2193      评论:0      收藏:0      [点我收藏+]

标签:rom   index   html   登录界面   sql   nbsp   insert   数据库   span   

 

实验吧CTF---Web篇

1. 打开登录地址(http://ctf5.shiyanbar.com/web/wonderkun/web/index.html),发现为一个登录界面,第一想到的是查看源代码,没有发现其他信息,然后输入万能密码1‘or‘1‘=‘1,发现过滤了or ,但未过滤单引号(‘)等,如下图:

技术分享

 

     经过一些列测试,发现不但过滤了or,并且过滤了/ # -- select | union等。

     猜测原SQL语句可能为:

select * form user where username =   and password =  

    在Mysql上创建user表模拟该登录表的信息:    

create database test;   //创建test数据库

use test;    

create table user(username varchar(8), password varchar(32));  //创建user表

insert into user(username, password) values(test,123456);  //插入数据

select * from user where name = cat=‘‘ and passwd = cat=‘‘;  可成功执行

  如下图所示,可成功执行并返回数据库信息:


技术分享

组合后代码为:
select * from user where name = cat=‘‘ and passwd = cat=‘‘;
即payload:   cat=/cat=

可成功登录并获取flag:  ctf{51d1bf8fb65a8c2406513ee8f52283e7}

技术分享

 

 

   

 

【实验吧】CTF_Web_登录一下好吗?

标签:rom   index   html   登录界面   sql   nbsp   insert   数据库   span   

原文地址:http://www.cnblogs.com/caizhiren/p/7768936.html

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