전체 글 80

level 3 CSS Injection

코드 분석token_generate() 함수def token_generate(): while True: token = "".join(random.choice(string.ascii_lowercase) for _ in range(8)) token_exists = execute( "SELECT * FROM users WHERE token = :token;", {"token": token} ) if not token_exists: return token랜덤으로 소문자 아스키값을 8개 생성하고 token 변수에 저장users 테이블에 해당 토큰이 이미 존재하는지 확인한다. 만약 해당 토큰이 존재하지 않으면 해당 토큰을..

CTF & Wargame(WEB) 2025.04.18

level 2 Client Side Template Injection

문제를 살펴보면 이전의 문제들과 마찬가지로 /vuln, /memo, /flag 페이지가 존재한다. 엔드포인트 분석add_header() 함수@app.after_requestdef add_header(response): global nonce response.headers['Content-Security-Policy'] = f"default-src 'self'; img-src https://dreamhack.io; style-src 'self' 'unsafe-inline'; script-src 'nonce-{nonce}' 'unsafe-eval' https://ajax.googleapis.com; object-src 'none'" nonce = os.urandom(16).hex() r..

CTF & Wargame(WEB) 2025.04.18

level 1 CSRF Advanced

웹 서비스 분석/login : 특정 계정으로 로그인을 할 수 있는 페이지/change_password : 현재 로그인 되어 있는 계정의 비밀번호를 바꿀수 있는 페이지/vuln : 사용자가 입력한 값을 그대로 출력해주는 페이지/flag : param에 입력한 url로 사용자가 이동 엔드 포인트 분석/loginusers = { 'guest': 'guest', 'admin': FLAG}session_storage = {}token_storage = {}@app.route('/login', methods=['GET', 'POST'])def login(): if request.method == 'GET': return render_template('login.html') elif..

CTF & Wargame(WEB) 2025.04.18