본문 바로가기

전체 글237

[picoCTF] X marks the spot 1. 개요 xpath injection, blind sql injection 2. 분석 SQL Injection 과 유사하기 때문에 ' or 'a' ='a 을 입력하면, You're on the right path 라고 메시지가 표시됩니다. 다만, XPATH라는 힌트가 주어졌고, ' or //*[starts-with(text(),'picoCTF{')] or '1'=' 과 같이 XPATH 함수를 적용할 수 있고, 메시지에 표시되는 right path 여부를 통해 flag를 brute force를 맞추는 blind sql injection이 가능합니다. 3. 코드 const axios = require('axios') let isFindFlag = false let flag = "picoCTF{" const.. 2023. 4. 28.
[BSidesSF 2023 CTF] prototype 1. 개요 prototype pollution 문제 문제 링크 - https://github.com/BSidesSF/ctf-2023-release/tree/main/prototype 2. 분석 index.js를 살펴보면, innerHTML로 문자열을 넣어 주기 때문에 XSS에 취약합니다. 다만 구문을 자세히 보면, this.planet 조건을 통과해야합니다. (정리하면, XSS를 성공시키기 위해서는 this.planet과 this.address.planet 모두 truthy가 되어야합니다.) 그리고, sever.py 코드를 보면, payload에서 planet을 읽지 않고 있기 때문에 planet을 payload로 보내도 소용없습니다. elif(request.content_type.startswith(.. 2023. 4. 26.
[Root Me] CSP Bypass - Inline code 1. 개요 XSS, CSP 문제 2. 분석 헤더를 CSP는 다음과 같습니다. img 태그의 src는 풀렸있지만, onerror로 XSS를 실행시킵니다. connect-src 'none'; font-src 'none'; frame-src 'none'; img-src 'self'; manifest-src 'none'; media-src 'none'; object-src 'none'; script-src 'unsafe-inline'; style-src 'self'; worker-src 'none'; frame-ancestors 'none'; block-all-mixed-content; 요 형태를 응용할것이고, postbin을 생성해서, flag를 전송하도록 수정합니다. "https://" 문자열에 필터가 걸.. 2023. 4. 23.
[angstromCTF 2023] directory 1. 개요 브루트 포스 문제 2. 분석 디렉토리 인덱스가 0~4999 주어지는데 그 중에 flag가 있는 것 같습니다. flag가 없으면, 다음과 같이 나옵니다. 전부 호출하도록 코드를 작성했고, 약 10분정도 걸렸습니다. 참고로 동기로 호출하기 위해 await을 걸었습니다. const axios = require('axios'); const getFlagByIndex = async (index) => { const baseUrl = "https://directory.web.actf.co/" const targetUrl = `${baseUrl}${index}.html`; const response = await axios.get(targetUrl); return response.data; } const .. 2023. 4. 22.