聊城比赛writeup

writeup

Posted by mr_king on November 26, 2020

web1

考点:文件包含

1.注册登录

image-20201126130109068

发现可用php伪协议读取文件

读取源码:php://filter/read=convert.base64-encode/resource=[文件名]

在info.php中发现templates/info.html

DwWksH.png

读取源码:

发现templates/profile233.html

DwWeot.png

需要FLAG_SIG==1

DwWKW8.png

全局搜索,发现在config.php中定义了FLAG_SIG=1

DwWBy4.png

user.php->function.php->config.php

所以只需在主页就可以绕过die,进行包含

[url=https://imgchr.com/i/DwffNq][img]https://s3.ax1x.com/2020/11/26/DwffNq.md.png[/img][/url]

在robots.txt中,提示有php.php

phpinfo中有session文件的存储位置

包含session文件,查看自己的phpsessid

进行文件包含

session文件:sess_

DwhZPP.png

web2

web3

misc1 bassssse

连续base加密

直接上脚本

# -*- coding: UTF-8 -*-
import base64

f = open(r'bassssse.txt','r')
buf = f.read()
step = 1
while True:
    try:
        buf = base64.b64decode(buf).decode()
        print ('[+] Step ' + str(step) + ' Do Base64_Decode!')
        step += 1
    except:
        try:
            buf = base64.b32decode(buf).decode()
            print ('[+] Step ' + str(step) + ' Do Base32_Decode!')
            step += 1
        except:
            try:
                buf = base64.b16decode(buf).decode()
                print ('[+] Step ' + str(step) + ' Do Base16_Decode!')
                step += 1
            except:
                try:
                    buf = base64.b85decode(buf).decode()
                    print ('[+] Step ' + str(step) + ' Do Base85_Decode!')
                    step += 1
                except:
                    break
print (buf)
f.close()

DBFZ6K.png

misc2 放松一下

binwalk分出一个flag.txt和一个goodmusic.mp3

使用mp3stgo,解出隐藏信息。(密码为mp3属性中的信息base64)

解出文件,fakeflag

将两个文本异或一下


import base64

flag = ""
str_1 = 'AA0KAh1VBwFIElNeXG9eUg9QRFBmRVpDXmdCEEZda15aUwNbWwA='

str_2 = 'fakeflag{same_length_with_true_flaghh}'

str_1 = base64.b64decode(str_1).decode().encode()

str_2 = str_2.encode()

for i in range(len(str_1)):
    tmp = str_1[i]^str_2[i]
    flag+=chr(tmp)

print(flag)

DBF6XT.png

misc3 ezDecode

html实体编码->hex->string

flag{f9df54010083b0f1f23a3eaecc5d5a7c}

misc4 好多二维码

识别二维码,发现0,1

直接手撕0,1

二进制转16,转字符串