第四屆浙江省網路安全技能競賽決賽部分WP
阿新 • • 發佈:2021-11-01
emmmmm,暴打出題人,預賽和決賽就只會簽到QAQ!!!
Web
遠古特性
<?php
// Present from glzjin :)
highlight_file(__FILE__);
$file = $_GET['file'];
if(preg_match('/^hint\/hint.txt$/m', $file)) {
echo file_get_contents($file);
} else {
echo "Try again!";
} Try again!
php程式碼審計,正則表示式提示輸入的引數得有hint/hint.txt
才能成功。
因為正則表示式/m要換多行匹配,所以需要換行符;第一行通過第二行執行正則指令,換行符為%0A
所以輸入?file=hint/hint.txt%0A../../../../../flag
得到提示:
Warning: file_get_contents(hint/hint.txt ../../../../../flag): failed to open stream: No such file or directory in /var/www/html/index.php on line 10
表示檔案未找到,繼續加../
,得到flag:
RE
最簡單的逆向
附件ida開啟,f5
找到for迴圈後雙擊enc得到
將enc進行對比:
flag = '' enc = [0x76, 0x73, 0x85, 0x75, 0x86, 0x78, 0xAD, 0x6B, 0x97, 0x68, 0x98,0x67, 0x64, 0x64,0x62, 0x97, 0x68, 0x98, 0x6B,0x6B, 0x96,0x67, 0x62, 0x69, 0x95, 0x96, 0x65, 0x96, 0x6A, 0x69,0x69,0x65, 0x66, 0x97, 0x68, 0x98, 0x6A, 0x95, 0x68, 0xAF, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00] for i in enc: print(chr(int(i)-50),end='')
得到flag:
Crypto
decode_and_decode
附件下載
得到一堆base密文,根據題目提示一直解碼試試,開始一直用工具在解密發現是base迴圈加密,指令碼貼上
import base64 with open(r'decode_and_decode的附件22.txt', 'r', encoding='utf-8') as f: for a in f: while 1: try: a = base64.b64decode(a).decode("utf-8") except: pass try: a = base64.b32decode(a).decode("utf-8") except: pass try: a = base64.b16decode(a).decode('utf-8') except: pass if "{" in a: print(a) break
得到flag:
MISC
site_log
附件下載得到:
開啟日誌檔案可以發現attack字樣後有chr字元讀取字樣,將所有chr讀取字元轉換得到
一連串命令列,不難發現解壓密碼為
hehehe233_Igotroot!
用WinRAR
解壓得到flag:
asoul_lover
最近我旁邊的灝妹天天上班第一句就是“Avaava”,還說要當安恆第一頂碗人。在他桌面上似乎發現了一個好康的壓縮檔案,想想他之前用過自己的名字+生日來做壓縮密碼,這把應該也能破解出來咯?對咯,他的壓縮軟體支援中文密碼。flag的格式為 DASCTF{xxxxxx},提交時只需要提交括號內的字串。
檔案資訊結合附件可以找到壓縮包密碼為:
向晚0612
得到flag: