728x90

1. Write-Up ์ž‘์„ฑ

Lab: User role controlled by request parameter

๋ฌธ์ œ์˜ ๋ชฉํ‘œ๋Š” /admin ๊ฒฝ๋กœ์— ์žˆ๋Š” ๊ด€๋ฆฌ์ž ํŒจ๋„์— ์ ‘๊ทผํ•˜์—ฌ ์‚ฌ์šฉ์ž carlos๋ฅผ ์‚ญ์ œํ•˜๋Š” ๊ฒƒ์ž…๋‹ˆ๋‹ค.


์šฐ์„  My account์— ๊ฐ€์„œ ๋ฌธ์ œ์— ๋‚˜์™€์žˆ๋Š” wiener:peter๋กœ ๋กœ๊ทธ์ธ์„ ํ•ด๋ณด๊ณ  /admin ๊ฒฝ๋กœ๋กœ ๊ฐ€๋ดค๋Š”๋ฐ admin ํŽ˜์ด์ง€์— ์ ‘๊ทผํ•  ์ˆ˜ ์—†์—ˆ์Šต๋‹ˆ๋‹ค.

 

๊ฐœ๋ฐœ์ž ๋„๊ตฌ๋ฅผ ์ด์šฉํ•ด ์ฟ ํ‚ค๋ฅผ ๋ถ„์„ํ•ด ๋ณด๋‹ˆ admin ๊ฐ’์ด false๋กœ ๋˜์–ด์žˆ์—ˆ๊ณ  ์ด๋ฅผ true ๊ฐ’์œผ๋กœ ๋ฐ”๊ฟจ์Šต๋‹ˆ๋‹ค.

 

๊ฐ’์„ true๋กœ ๋ฐ”๊พธ๊ณ  ์ƒˆ๋กœ๊ณ ์นจ์„ ํ•˜๋‹ˆ Admin panel๋กœ ๋ฐ”๋€Œ์—ˆ์Šต๋‹ˆ๋‹ค.

 

๊ทธ๋‹ค์Œ /admin ๊ฒฝ๋กœ๋กœ ์ด๋™ํ•œ ๋’ค ์‚ฌ์šฉ์ž carlos๋ฅผ ์‚ญ์ œ๋ฅผ ํ•ด์คŒ์œผ๋กœ์จ ๋ฌธ์ œ๋ฅผ ํ•ด๊ฒฐํ–ˆ์Šต๋‹ˆ๋‹ค!


2. xss ๊ณต๊ฒฉ์— ๋งŽ์ด ์“ฐ์ด๋Š” ๊ณต๊ฒฉ ๊ตฌ๋ฌธ ์กฐ์‚ฌ

https://portswigger.net/web-security/cross-site-scripting/cheat-sheet

 

Cross-Site Scripting (XSS) Cheat Sheet - 2024 Edition | Web Security Academy

Interactive cross-site scripting (XSS) cheat sheet for 2024, brought to you by PortSwigger. Actively maintained, and regularly updated with new vectors.

portswigger.net

 

https://gist.github.com/kurobeats/9a613c9ab68914312cbb415134795b45

 

XSS Vectors Cheat Sheet

XSS Vectors Cheat Sheet. GitHub Gist: instantly share code, notes, and snippets.

gist.github.com


<script>alert('XSS');</script>
  • <script> ํƒœ๊ทธ๋Š” HTML ๋ฌธ์„œ ๋‚ด์—์„œ ์ž๋ฐ”์Šคํฌ๋ฆฝ์„ ์‚ฝ์ž…ํ•˜๊ธฐ ์œ„ํ•œ ํƒœ๊ทธ
  • ์ด ๊ตฌ๋ฌธ์ด ์‹คํ–‰๋˜๋ฉด, ๋ธŒ๋ผ์šฐ์ €์—์„œ alert() ํ•จ์ˆ˜๊ฐ€ ํ˜ธ์ถœ๋˜์–ด "XSS"๋ผ๋Š” ํŒ์—… ์ฐฝ์ด ๋œจ๊ฒŒ ๋œ๋‹ค.
  • ๋ธŒ๋ผ์šฐ์ €๊ฐ€ HTML ์ฝ”๋“œ๋ฅผ ํŒŒ์‹ฑ ํ•  ๋•Œ, <script> ํƒœ๊ทธ ๋‚ด์˜ ์ž๋ฐ”์Šคํฌ๋ฆฝํŠธ๋ฅผ ์‹คํ–‰ํ•œ๋‹ค. ์ด๋•Œ ์‚ฝ์ž…๋œ ์•…์„ฑ ์Šคํฌ๋ฆฝํŠธ๊ฐ€ ์‹คํ–‰๋˜๋ฉด์„œ ๊ณต๊ฒฉ์ด ๋ฐœ์ƒํ•˜๊ฒŒ ๋œ๋‹ค.
  • ๊ฐ„๋‹จํ•œ ๊ฒฝ๊ณ  ์ฐฝ์„ ๋„์šฐ๋Š” ์Šคํฌ๋ฆฝํŠธ๋กœ ๋ณด์ด์ง€๋งŒ, ์‹ค์งˆ์ ์ธ ๊ณต๊ฒฉ์—์„œ๋Š” ์•…์„ฑ ์ฝ”๋“œ๋‚˜ ํฌ๋กฌ ํ™•์žฅ ํ”„๋กœ๊ทธ๋žจ ์„ค์น˜ ์œ ๋„, ์‚ฌ์šฉ์ž ์„ธ์…˜ ํƒˆ์ทจ ๋“ฑ ์‹ฌ๊ฐํ•œ ๊ณต๊ฒฉ์œผ๋กœ ํ™•์žฅ๋  ์ˆ˜ ์žˆ๋‹ค.

 

<img src="#" onerror="alert('XSS')">
  • <img> ํƒœ๊ทธ๋Š” ์›น ํŽ˜์ด์ง€์— ์ด๋ฏธ์ง€๋ฅผ ์‚ฝ์ž…ํ•˜๊ธฐ ์œ„ํ•œ ํƒœ๊ทธ
  • onerror๋Š” ์ด๋ฏธ์ง€๊ฐ€ ๋กœ๋“œ๋˜์ง€ ์•Š๊ฑฐ๋‚˜ ์—๋Ÿฌ๊ฐ€ ๋ฐœ์ƒํ–ˆ์„ ๋•Œ ์‹คํ–‰๋˜๋Š” ์ด๋ฒคํŠธ
  • ์ด ๊ตฌ๋ฌธ์—์„œ๋Š” ์กด์žฌํ•˜์ง€ ์•Š๋Š” ์ด๋ฏธ์ง€๋ฅผ ๋กœ๋“œํ•˜๋ ค๋‹ค ์—๋Ÿฌ๊ฐ€ ๋ฐœ์ƒํ•˜๋ฉด, alert('XSS')๊ฐ€ ์‹คํ–‰๋œ๋‹ค.
  • ์ด๋ฏธ์ง€ ๋กœ๋”ฉ์ด ์‹คํŒจํ•œ ๊ฒฝ์šฐ(ex. ์ž˜๋ชป๋œ ๊ฒฝ๋กœ, ํŒŒ์ผ์ด ์—†๋Š” ๊ฒฝ์šฐ ๋“ฑ), onerror ์ด๋ฒคํŠธ ํ•ธ๋“ค๋Ÿฌ ๋‚ด์— ์‚ฝ์ž…๋œ ์ž๋ฐ”์Šคํฌ๋ฆฝํŠธ๊ฐ€ ์‹คํ–‰๋œ๋‹ค. ๊ณต๊ฒฉ์ž๋Š” ์ด๋Ÿฐ ๋ฐฉ์‹์„ ์ด์šฉํ•ด ์•…์„ฑ ์Šคํฌ๋ฆฝํŠธ๋ฅผ ์›น ํŽ˜์ด์ง€์— ์‚ฝ์ž…ํ•  ์ˆ˜ ์žˆ๋‹ค.
  • ์ด ๋ฐฉ์‹์€ ์‚ฌ์šฉ์ž ์ž…๋ ฅ์— ๋Œ€ํ•œ ๊ฒ€์ฆ์ด ์ œ๋Œ€๋กœ ์ด๋ฃจ์–ด์ง€์ง€ ์•Š๋Š” ์›น ํŽ˜์ด์ง€์—์„œ ์ž์ฃผ ๋ฐœ์ƒํ•œ๋‹ค.

 

<a href="javascript:alert('XSS')">Click me</a>
  • ์ด ๊ตฌ๋ฌธ์€ HTML์˜ <a> ํƒœ๊ทธ๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ๋งํฌ๋ฅผ ๋งŒ๋“ค์ง€๋งŒ, ์ผ๋ฐ˜์ ์ธ URL ๋Œ€์‹  javascript: ํ”„๋กœํ† ์ฝœ์„ ์‚ฌ์šฉํ•˜์—ฌ ๋งํฌ๊ฐ€ ํด๋ฆญ๋  ๋•Œ ์ž๋ฐ”์Šคํฌ๋ฆฝํŠธ๋ฅผ ์‹คํ–‰ํ•œ๋‹ค. ์ด ๊ตฌ๋ฌธ์„ ํด๋ฆญํ•˜๋ฉด alert('XSS')๊ฐ€ ์‹คํ–‰๋œ๋‹ค.
  • javascript: ํ”„๋กœํ† ์ฝœ์€ URL์˜ ์ผ๋ถ€ํ†  ์ž๋ฐ”์Šคํฌ๋ฆฝํŠธ๋ฅผ ์ง์ ‘ ์‹คํ–‰ํ•  ์ˆ˜ ์žˆ๊ฒŒ ํ•œ๋‹ค.
  • ๊ณต๊ฒฉ์ž๋Š” ์ด๋ฅผ ์ด์šฉํ•ด ์•…์„ฑ ์ž๋ฐ”์Šคํฌ๋ฆฝํŠธ๋ฅผ ์ˆจ๊ฒจ๋†“๊ณ , ์‚ฌ์šฉ์ž๊ฐ€ ๋งํฌ๋ฅผ ํด๋ฆญํ•˜๋„๋ก ์œ ๋„ํ•˜์—ฌ ์Šคํฌ๋ฆฝํŠธ๊ฐ€ ์‹คํ–‰๋˜๋„๋ก ๋งŒ๋“ ๋‹ค.

 

<input onfocus="alert(document.cookie)">
  • ์ด ๊ตฌ๋ฌธ์€ HTML ์ž…๋ ฅ ํ•„๋“œ์—์„œ ์ž๋ฐ”์Šคํฌ๋ฆฝํŠธ๋ฅผ ์‹คํ–‰ํ•˜๊ธฐ ์œ„ํ•œ DOM ์ด๋ฒคํŠธ ํ•ธ๋“ค๋Ÿฌ๋ฅผ ์‚ฌ์šฉํ•˜๋Š” ๋ฐฉ๋ฒ•์ด๋‹ค.
  • onfocus๋Š” ์‚ฌ์šฉ์ž๊ฐ€ ์ž…๋ ฅ ํ•„๋“œ๋ฅผ ํด๋ฆญํ•˜๊ฑฐ๋‚˜ ํฌ์ปค์Šค๋ฅผ ๋งž์ถœ ๋•Œ ๋ฐœ์ƒํ•˜๋Š” ์ด๋ฒคํŠธ์ด๋‹ค.
  • ์ด ๊ตฌ๋ฌธ์€ ์ž…๋ ฅ ํ•„๋“œ๋ฅผ ํด๋ฆญํ•˜๋ฉด document.cookie ๊ฐ’์„ ์•Œ๋ฆผ์œผ๋กœ ํ‘œ์‹œํ•˜๊ฒŒ ๋œ๋‹ค.
  • DOM ๊ธฐ๋ฐ˜ XSS๋Š” ์›น ํŽ˜์ด์ง€์˜ DOM(Document Object Model)์„ ํ†ตํ•ด ์ง์ ‘ ์ž๋ฐ”์Šคํฌ๋ฆฝํŠธ๋ฅผ ์‹คํ–‰ํ•˜๋Š” ๋ฐฉ์‹์ด๋‹ค.
  • ๊ณต๊ฒฉ์ž๋Š” ์ด๋Ÿฐ ์ด๋ฒคํŠธ ํ•ธ๋“ค๋Ÿฌ๋ฅผ ํ†ตํ•ด ๋ธŒ๋ผ์šฐ์ €์—์„œ ์ž์ฃผ ์‚ฌ์šฉํ•˜๋Š” ๋ฐ์ดํ„ฐ(ex. ์ฟ ํ‚ค, ์„ธ์…˜ ID)๋ฅผ ํ›”์น  ์ˆ˜ ์žˆ๊ฒŒ ๋œ๋‹ค.

 

<iframe src="javascript:alert('XSS')"></iframe>
  • <iframe> ํƒœ๊ทธ๋Š” ์›น ํŽ˜์ด์ง€ ์•ˆ์— ๋˜ ๋‹ค๋ฅธ ์›น ํŽ˜์ด์ง€๋ฅผ ์‚ฝ์ž…ํ•  ์ˆ˜ ์žˆ๋Š” HTML ํƒœ๊ทธ์ด๋‹ค.
  • ์ด ๊ตฌ๋ฌธ์—์„œ๋Š” src ์†์„ฑ์— javascript: ํ”„๋กœ์ฝœ์„ ์‚ฌ์šฉํ•˜์—ฌ ์ž๋ฐ”์Šคํฌ๋ฆฝํŠธ๋ฅผ ์‹คํ–‰ํ•˜๋„๋ก ์„ค์ •๋˜์–ด ์žˆ๋‹ค.
  • iframe ํƒœ๊ทธ๋Š” ์ผ๋ฐ˜์ ์œผ๋กœ ์™ธ๋ถ€ ์ฝ˜ํ…์ธ ๋ฅผ ๋ถˆ๋Ÿฌ์˜ค๋Š” ์šฉ๋„๋กœ ์‚ฌ์šฉ๋œ๋‹ค.
  • ํ•˜์ง€๋งŒ, ๊ณต๊ฒฉ์ž๋Š” javascript: ํ”„๋กœํ† ์ฝœ์„ ํ†ตํ•ด ์Šคํฌ๋ฆฝํŠธ๋ฅผ ์‹คํ–‰ํ•  ์ˆ˜ ์žˆ์œผ๋ฉฐ, ์›น ํŽ˜์ด์ง€ ๋‚ด์— ์•…์„ฑ ์Šคํฌ๋ฆฝํŠธ๋ฅผ ์ˆจ๊ฒจ ์‹คํ–‰ํ•˜๋„๋ก ํ•  ์ˆ˜ ์žˆ๋‹ค.

3. Write-Up ์ž‘์„ฑํ•˜๊ธฐ

https://dreamhack.io/wargame/challenges/28

 

xss-1

์—ฌ๋Ÿฌ ๊ธฐ๋Šฅ๊ณผ ์ž…๋ ฅ๋ฐ›์€ URL์„ ํ™•์ธํ•˜๋Š” ๋ด‡์ด ๊ตฌํ˜„๋œ ์„œ๋น„์Šค์ž…๋‹ˆ๋‹ค. XSS ์ทจ์•ฝ์ ์„ ์ด์šฉํ•ด ํ”Œ๋ž˜๊ทธ๋ฅผ ํš๋“ํ•˜์„ธ์š”. ํ”Œ๋ž˜๊ทธ๋Š” flag.txt, FLAG ๋ณ€์ˆ˜์— ์žˆ์Šต๋‹ˆ๋‹ค. ํ”Œ๋ž˜๊ทธ ํ˜•์‹์€ DH{...} ์ž…๋‹ˆ๋‹ค. ๋ฌธ์ œ ์ˆ˜์ • ๋‚ด์—ญ

dreamhack.io

#!/usr/bin/python3
from flask import Flask, request, render_template
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
import urllib
import os

app = Flask(__name__)
app.secret_key = os.urandom(32)

try:
    FLAG = open("./flag.txt", "r").read()
except:
    FLAG = "[**FLAG**]"


def read_url(url, cookie={"name": "name", "value": "value"}):
    cookie.update({"domain": "127.0.0.1"})
    try:
        service = Service(executable_path="/chromedriver")
        options = webdriver.ChromeOptions()
        for _ in [
            "headless",
            "window-size=1920x1080",
            "disable-gpu",
            "no-sandbox",
            "disable-dev-shm-usage",
        ]:
            options.add_argument(_)
        driver = webdriver.Chrome(service=service, options=options)
        driver.implicitly_wait(3)
        driver.set_page_load_timeout(3)
        driver.get("http://127.0.0.1:8000/")
        driver.add_cookie(cookie)
        driver.get(url)
    except Exception as e:
        driver.quit()
        # return str(e)
        return False
    driver.quit()
    return True


def check_xss(param, cookie={"name": "name", "value": "value"}):
    url = f"http://127.0.0.1:8000/vuln?param={urllib.parse.quote(param)}"
    return read_url(url, cookie)


@app.route("/")
def index():
    return render_template("index.html")


@app.route("/vuln")
def vuln():
    param = request.args.get("param", "")
    return param


@app.route("/flag", methods=["GET", "POST"])
def flag():
    if request.method == "GET":
        return render_template("flag.html")
    elif request.method == "POST":
        param = request.form.get("param")
        if not check_xss(param, {"name": "flag", "value": FLAG.strip()}):
            return '<script>alert("wrong??");history.go(-1);</script>'

        return '<script>alert("good");history.go(-1);</script>'


memo_text = ""


@app.route("/memo")
def memo():
    global memo_text
    text = request.args.get("memo", "")
    memo_text += text + "\n"
    return render_template("memo.html", memo=memo_text)


app.run(host="0.0.0.0", port=8000)

๋ฌธ์ œ ๋ถ„์„

/flag ํŽ˜์ด์ง€

  • /flag ํŽ˜์ด์ง€์—์„œ ๊ฐ’์„ ์ž…๋ ฅํ•ด POST ์š”์ฒญ์„ ๋ณด๋‚ด๋ฉด, ์ž…๋ ฅ๋œ ๊ฐ’์ด param ๋ณ€์ˆ˜๋กœ ์„ค์ •๋ฉ๋‹ˆ๋‹ค.
  • ์ดํ›„, ์ด param ๊ฐ’๊ณผ ์ฟ ํ‚ค๊ฐ€ ๋‹ด๊ธด flag ๊ฐ’์ด check_xss ํ•จ์ˆ˜๋กœ ์ „๋‹ฌ๋ฉ๋‹ˆ๋‹ค.
def check_xss(param, cookie={"name": "name", "value": "value"}): 
	url = f"http://127.0.0.1:8000/vuln?param={urllib.parse.quote(param)}" 
    return read_url(url, cookie)
  • check_xss ํ•จ์ˆ˜๋Š” ์ž…๋ ฅ๋œ param ๊ฐ’์„ http://127.0.0.1:8000/vuln?param=[์ž…๋ ฅ๋œ ๊ฐ’] URL์— ์‚ฝ์ž…ํ•˜๊ณ , ์ฟ ํ‚ค์—๋Š” ํ”Œ๋ž˜๊ทธ๊ฐ€ ํฌํ•จ๋œ cookie ๊ฐ’์„ ์ „๋‹ฌํ•ฉ๋‹ˆ๋‹ค.
  • ์ด URL์„ read_url ํ•จ์ˆ˜์— ๋„˜๊ฒจ, ๋ธŒ๋ผ์šฐ์ €๊ฐ€ ํ•ด๋‹น URL์„ ๋กœ๋“œํ•˜๋„๋ก ํ•˜๋Š”๋ฐ, ์ด๋•Œ ํ”Œ๋ž˜๊ทธ๊ฐ€ ์ฟ ํ‚ค๋กœ ์„ค์ •๋ฉ๋‹ˆ๋‹ค.

read_url ํ•จ์ˆ˜

def read_url(url, cookie={"name": "name", "value": "value"}):
    cookie.update({"domain": "127.0.0.1"})
    driver.get("http://127.0.0.1:8000/")
    driver.add_cookie(cookie)
    driver.get(url)
  • ์ด ํ•จ์ˆ˜๋Š” ๋กœ์ปฌ ํ˜ธ์ŠคํŠธ์— ์ ‘์†ํ•œ ๋’ค, ํ”Œ๋ž˜๊ทธ๋ฅผ ๋‹ด์€ ์ฟ ํ‚ค๋ฅผ ์„ค์ •ํ•˜๊ณ , /vuln ํŽ˜์ด์ง€๋กœ ์ ‘์†ํ•ฉ๋‹ˆ๋‹ค.
  • ๊ฒฐ๊ณผ์ ์œผ๋กœ, ์ฟ ํ‚ค ๊ฐ’์ด ํ”Œ๋ž˜๊ทธ๋ฅผ ํฌํ•จํ•˜๊ฒŒ ๋ฉ๋‹ˆ๋‹ค.

/vuln ํŽ˜์ด์ง€

  • /vuln ํŽ˜์ด์ง€๋Š” ์ „๋‹ฌ๋œ param ๊ฐ’์„ ๊ทธ๋Œ€๋กœ ๋ฐ˜ํ™˜ํ•˜๋Š”๋ฐ, ์—ฌ๊ธฐ์„œ ์ž…๋ ฅ๋œ ๊ฐ’์ด ์›น ํŽ˜์ด์ง€์— ๊ทธ๋Œ€๋กœ ์ถœ๋ ฅ๋˜๊ธฐ ๋•Œ๋ฌธ์— XSS ์ทจ์•ฝ์ ์ด ์กด์žฌํ•ฉ๋‹ˆ๋‹ค.
  • ์ฆ‰, ์‚ฌ์šฉ์ž๊ฐ€ ์ž๋ฐ”์Šคํฌ๋ฆฝํŠธ ์ฝ”๋“œ๋ฅผ ์ž…๋ ฅํ•˜๋ฉด ์ด ์ฝ”๋“œ๊ฐ€ ์‹คํ–‰๋  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

 

/memo ํŽ˜์ด์ง€

  • /memo?memo=๊ฐ’์˜ ํ˜•ํƒœ๋กœ ์ ‘๊ทผํ•˜๋ฉด, memo์— ์ „๋‹ฌ๋œ ๊ฐ’์ด ์›น ํŽ˜์ด์ง€์— ๊ทธ๋Œ€๋กœ ํ‘œ์‹œ๋ฉ๋‹ˆ๋‹ค.
  • ์ด ํŽ˜์ด์ง€๋ฅผ ํ†ตํ•ด ์ฟ ํ‚ค ๊ฐ’์„ ์ถœ๋ ฅํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

๋ชฉํ‘œ๋Š” /flag ํŽ˜์ด์ง€์— ๊ฐ’์„ ์ž…๋ ฅํ•ด XSS ๊ณต๊ฒฉ์„ ์‹คํ–‰ํ•˜๊ณ , ํ”Œ๋ž˜๊ทธ๊ฐ€ ๋‹ด๊ธด ์ฟ ํ‚ค๋ฅผ /memo ํŽ˜์ด์ง€๋ฅผ ํ†ตํ•ด ์ถœ๋ ฅํ•˜๋Š” ๊ฒƒ์ž…๋‹ˆ๋‹ค. ์ด๋ฅผ ์œ„ํ•ด, XSS ์Šคํฌ๋ฆฝํŠธ๋ฅผ /vuln?param= ๋’ค์— ์ž…๋ ฅํ•ด ์‹คํ–‰ํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.

<script>
    location.href="http://127.0.0.1:8000/memo?memo=" + document.cookie;
</script>

 

์ด ์Šคํฌ๋ฆฝํŠธ๋Š” ์‹คํ–‰๋˜๋ฉด document.cookie (ํ˜„์žฌ ํŽ˜์ด์ง€์˜ ์ฟ ํ‚ค, ์ฆ‰ ํ”Œ๋ž˜๊ทธ๊ฐ€ ํฌํ•จ๋œ ์ฟ ํ‚ค)๋ฅผ ์ฝ๊ณ , ์ด๋ฅผ /memo ํŽ˜์ด์ง€๋กœ ์ „๋‹ฌํ•˜์—ฌ ํ•ด๋‹น ๊ฐ’์„ ์ถœ๋ ฅํ•˜๊ฒŒ ๋  ๊ฒƒ์ด๋‹ค.

์ œ์ถœ์„ ํ•˜๊ณ  memo ํŽ˜์ด์ง€์— ๊ฐ€๋ฉด ํ”Œ๋ž˜๊ทธ๋ฅผ ํš๋“ํ•  ์ˆ˜ ์žˆ๊ฒŒ ๋œ๋‹ค.


๋ฌธ์ œ ํ•ด๊ฒฐ ์š”์•ฝ

  1. /flag ํŽ˜์ด์ง€์—์„œ ๊ฐ’์„ ์ž…๋ ฅํ•˜๋ฉด, ์ด ๊ฐ’์ด /vuln?param=์ž…๋ ฅํ•œ ๊ฐ’ URL๋กœ ์ „๋‹ฌ๋ฉ๋‹ˆ๋‹ค.
  2. /vuln ํŽ˜์ด์ง€๋Š” param ๊ฐ’์„ ๊ทธ๋Œ€๋กœ ์ถœ๋ ฅํ•˜๊ธฐ ๋•Œ๋ฌธ์—, XSS ์ทจ์•ฝ์ ์ด ์กด์žฌํ•ฉ๋‹ˆ๋‹ค.
  3. XSS ๊ณต๊ฒฉ์„ ํ†ตํ•ด, ์•…์„ฑ ์ž๋ฐ”์Šคํฌ๋ฆฝํŠธ๋ฅผ ์‹คํ–‰ํ•˜์—ฌ ์ฟ ํ‚ค(ํ”Œ๋ž˜๊ทธ)๋ฅผ ํƒˆ์ทจํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
  4. ์ž๋ฐ”์Šคํฌ๋ฆฝํŠธ๋ฅผ ์ด์šฉํ•ด document.cookie ๊ฐ’์„ /memo ํŽ˜์ด์ง€๋กœ ์ „๋‹ฌํ•˜๋ฉด, ํ”Œ๋ž˜๊ทธ๋ฅผ ์ถœ๋ ฅํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

'EVI$ION > 7th' ์นดํ…Œ๊ณ ๋ฆฌ์˜ ๋‹ค๋ฅธ ๊ธ€

[EVI$ION] Pwnable  (2) 2024.11.21
[EVI$ION] #4 - Reversing 1  (0) 2024.11.07
[EVI$ION] #3 - Digital Forensic Assignment  (5) 2024.10.06
[EVI$ION] #2 - Web Hacking Assignment  (1) 2024.09.26

+ Recent posts