BUUCTF_WEB_20200924

WEB-[SUCTF 2019]Pythonginx

        @app.route('/getUrl', methods=['GET', 'POST'])
def getUrl():
    url = request.args.get("url")
    host = parse.urlparse(url).hostname
    if host == 'suctf.cc':
        return "我扌 your problem? 111"
    parts = list(urlsplit(url))
    host = parts[1]
    if host == 'suctf.cc':
        return "我扌 your problem? 222 " + host
    newhost = []
    for h in host.split('.'):
        newhost.append(h.encode('idna').decode('utf-8'))
    parts[1] = '.'.join(newhost)
    #去掉 url 中的空格
    finalUrl = urlunsplit(parts).split(' ')[0]
    host = parse.urlparse(finalUrl).hostname
    if host == 'suctf.cc':
        return urllib.request.urlopen(finalUrl).read()
    else:
        return "我扌 your problem? 333"

分析由于三个if判断都是检验是否为suctf.cc,但是我们想要得到flag还要绕过前两个if,只执行最后一个if这时候就看到这样一句话

    newhost.append(h.encode('idna').decode('utf-8'))

意思是将域名每个部分进行idna编码后,再utf-8解码,所以我们的思路就是修改一下suctf.cc的格式让他最后可以变为suctf.cc就可以了这时候就可以利用℆来绕过,这道题,不能让他为 suctf.cc,但是经过了 urlunsplit 后变成 suctf.cc,很容易就构造出:file:suctf.cc/usr/local/nginx/conf/nginx.conf

找到了flag的位置,就在fffffflag里那就修改一下payload直接去读取这个文件file://suctf.c℆sr/fffffflag

flag

flag{a9fa77ab-bac8-4b43-80c3-4bec3c2251f2}

WEB-[ASIS 2019]Unicorn shopf12

F12有点小提示

输入Item ID为1 Price为1返回错误,输入Item ID为4Price为2.0返回不一样,这里提示告诉了我们只能使用一个字符,所以猜测出题人是购买第四只独角兽,获取flag,于是我们需要找到一个字符比1337大的数字,也就是utf-8编码的转换。https://www.compart.com/en/unicode/搜索大于 thousand 的单个字符

挑一个大于1337的数字然后utf-8unicode

flag

flag{d314e16e-2c69-4df0-9875-6165fda6532e}

WEB-[NCTF2019]Fake XML cookbook

  • XXE漏洞

尝试sql注入无果,在根据题目提示的xml,联想到XXE漏洞,那就用XXE常用的payload进行尝试

发现可以注入,我们尝试读取flag

flag

flag{04957237-0257-40c4-9c18-f0019b550d3b}

posted @ 2020-09-24 20:50  WANGXIN_YU  阅读(193)  评论(0)    收藏  举报