n00bzCTF 2024

n00bzCTF 2024

Passwordless

给了源码

#!/usr/bin/env python3
from flask import Flask, request, redirect, render_template, render_template_string
import subprocess
import urllib
import uuid
global leet

app = Flask(__name__)
flag = open('/flag.txt').read()
leet=uuid.UUID('13371337-1337-1337-1337-133713371337')

@app.route('/',methods=['GET','POST'])
def main():
    global username
    if request.method == 'GET':
        return render_template('index.html')
    elif request.method == 'POST':
        username = request.values['username']
        if username == 'admin123':
            return 'Stop trying to act like you are the admin!'
        uid = uuid.uuid5(leet,username) # super secure!
        return redirect(f'/{uid}')

@app.route('/<uid>')
def user_page(uid):
    if uid != str(uuid.uuid5(leet,'admin123')):
        return f'Welcome! No flag for you :('
    else:
        return flag

if __name__ == '__main__':
    app.run(host='0.0.0.0', port=1337)

uuid和username

获取uid 得到url

访问得到flag

LIT CTF

anti-inspect

没看提示 打开链接了崩了.. 还纳闷咋打不开..

向题目链接发出请求

image-20240816112126753

jwt-1

读提示和token有关 在加上jwt

获取token

image-20240816113619473

image-20240816113119513

将false改成true 保存token

image-20240816113225908

image-20240816113426318

jwt-2

image-20240816113741605

老方法先试一下

image-20240816113834977

发现是上一道题的flag

查看源码

image-20240816114822467

伪造令牌 绕过检查

image-20240816115047064

image-20240816115118427

image-20240816115140989

traversed

image-20240816123000493

posted @ 2024-09-07 22:00  Yolololololo  阅读(11)  评论(0编辑  收藏  举报