# WaniCTF 2023 [TOC] 大阪大學舉辦的(應該吧 官方網址 : https://wanictf.org/ ![](https://hackmd.io/_uploads/B1Lr7RHV3.png) ![](https://hackmd.io/_uploads/rkxrQRHVn.png) ## For ### Just_mp4 用 exiftool 檢查發現這一行,base64 後取得 flag ![](https://i.imgur.com/FtYYBEw.png) ## Misc ### shuffle_base64 給的 output 長這樣,從 python 中可以知道最後用 base64 加密了 ![](https://i.imgur.com/MCTrnC0.png) 所以 base64 解密後 ![](https://i.imgur.com/riW7PPi.png) 從頭開始理解 code,最先的 pad function 將字串以二為單位切割,並在後面塞入一個亂數字符,變成三個三個一組 ![](https://i.imgur.com/M9cNxfm.png) 接著這個 function 將剛才三個為一組的總組數作排列組合,共有 8! == 40320種組合 ![](https://i.imgur.com/ER55Uyu.png) make_str_blocks 這個 function 不重要不想講, order 那一行就是隨機取一個 0 到 40320 中的一個數字,下面的 for 迴圈就以 shuffle_list[order] 這組組合變成字串,也就是 base64 解碼的那個字串 ![](https://i.imgur.com/ghwGm9x.png) 阿下面是固定的順序,剩下的想辦法還原,然後我看到題目叫做 shuffle_base64......,flag 的答案不用我說了吧 ![](https://i.imgur.com/29zbkla.png) ## rev ### Just_Passw0rd --Beginner 將給的檔案用 strings 打開就找到 flag 了 ![](https://i.imgur.com/VE8Tmwn.png) ### javersing --easy 將給的 java.jar 丟上 online rev 後, code 長這樣,主要是 s 是根據 ```i * 7 % 30```的方式打亂順序,所以排序就好 ![](https://i.imgur.com/tSj4Of8.png) 哭啊,我真的不會 python, C++ 萬歲!! ```C++= #include <iostream> #include <string.h> using namespace std; int main(){ string s = "Fcn_yDlvaGpj_Logi}eias{iaeAm_s"; char result[30]; int array[30]; // put the sort of string s in a int array for(int i=0;i<30;i++) array[i] = i * 7 % 30; // return the sort of flag for(int i=0;i<30;i++){ result[array[i]] = s[i]; } // output the flag for(auto i: result) cout << i; cout << endl; } ``` ## 曾經的排名 QQ ![](https://hackmd.io/_uploads/HkmZEAr42.jpg) ![](https://hackmd.io/_uploads/SkiGN0rV3.jpg)