rosieblue
article thumbnail
[ARM] MTE (Memory Tagging Extension)
๐Ÿ” Security 2024. 2. 26. 21:31

MTE ์ผ๋‹จ MTE๋Š” ๋ฉ”๋ชจ๋ฆฌ ์ž์ฒด๋ฅผ 'ํƒœ๊น…'ํ•˜๋Š” ๊ธฐ๋ฒ•์ด๋‹ค. ๊ทธ๋ ‡๋‹ค๋ฉด ํƒœ๊น…์ด๋ผ๋Š”๊ฒŒ ์ •ํ™•ํ•˜๊ฒŒ ๋ญ˜๊นŒ? Address Tag (Key) : 4bit๋กœ ๋˜์–ด์žˆ๊ณ , virtual address์˜ ์ƒ์œ„ ๋น„ํŠธ์— ์ €์žฅ๋œ๋‹ค! ์ƒ์œ„ ๋น„ํŠธ์— ์ €์žฅ๋  ์ˆ˜ ์žˆ๋Š” ์ด์œ ๋Š”, AArch64์˜ TBI(Top-Byte-Ignore' ํŠน์ง• ๋•Œ๋ฌธ์ด๋‹ค Memory Tag (Lock) : ๋˜‘๊ฐ™์ด 4bit๋กœ ๊ตฌ์„ฑ๋˜์–ด์žˆ๊ณ , memory storage์— ์ €์žฅ๋œ๋‹ค. ๋ฌผ๋ฆฌ ๋ฉ”๋ชจ๋ฆฌ ๊ณต๊ฐ„์—์„œ 16byte๋กœ ์ •๋ ฌ๋œ ๋ชจ๋“  region์— ๋งํฌ๋˜์–ด์žˆ๋‹ค! ์ฐธ๊ณ ) TBI๊ฐ€ ํ™œ์„ฑํ™”๋˜๋ฉด virtual address์˜ top byte๋Š” ์ฃผ์†Œ ํ•ด์„์—์„œ ๋ฌด์‹œ๋œ๋‹ค! ๊ทธ๋ž˜์„œ top byte๋ฅผ metadata๋ฅผ ์ €์žฅํ•˜๋Š”๋ฐ ์“ธ ์ˆ˜ ์žˆ๋Š” ๊ฒƒ์ด๋‹ค ์ผ๋‹จ ์ด๋ ‡๊ฒŒ 'ํƒœ๊น…๋œ'๋ฉ”๋ชจ๋ฆฌ์— ์ ‘๊ทผ/์ €์žฅํ•˜..

๋ณดํ˜ธ๋˜์–ด ์žˆ๋Š” ๊ธ€์ž…๋‹ˆ๋‹ค. ๋‚ด์šฉ์„ ๋ณด์‹œ๋ ค๋ฉด ๋น„๋ฐ€๋ฒˆํ˜ธ๋ฅผ ์ž…๋ ฅํ•ด์ฃผ์„ธ์š”.
article thumbnail
[๋“œ๋ฆผํ•ต(Dreamhack) random-test
๐Ÿ” Security/Web 2023. 9. 26. 19:07

์ด๋Ÿฐ์‹์œผ๋กœ ์‚ฌ๋ฌผํ•จ์ด๋ž‘ ์ž๋ฌผ์‡  ๋น„๋ฒˆ์„ ๋งž์ถฐ์•ผํ•˜๋Š” ๋ฌธ์ œ์ด๋‹ค ์‚ฌ๋ฌผํ•จ ๋ฒˆํ˜ธ๋Š” ์•ŒํŒŒ๋ฒณ ์†Œ๋ฌธ์ž ํ˜น์€ ์ˆซ์ž๋ฅผ ํฌํ•จํ•˜๋Š” 4์ž๋ฆฌ ๋žœ๋ค ๋ฌธ์ž์—ด์ด๊ณ , ๋น„๋ฐ€๋ฒˆํ˜ธ๋Š” 100 ์ด์ƒ 200 ์ดํ•˜์˜ ๋žœ๋ค ์ •์ˆ˜๋ผ๊ณ  ํ•œ๋‹ค #!/usr/bin/python3 from flask import Flask, request, render_template import string import random app = Flask(__name__) try: FLAG = open("./flag.txt", "r").read() # flag is here! except: FLAG = "[**FLAG**]" rand_str = "" alphanumeric = string.ascii_lowercase + string.digits #์†Œ๋ฌธ์ž or ์ˆซ์ž for i in..

article thumbnail
[๋“œ๋ฆผํ•ต(Dreamhack)] file-download-1
๐Ÿ” Security/Web 2023. 9. 26. 17:34

์Šคํฌ๋ฆฝํŠธ ํŒŒ์ผ์„ ์ž…๋ ฅ์„ ํ–ˆ๋”๋‹ˆ ์‹คํ–‰์ด ๋˜์ง€ ์•Š์•˜๋‹ค. ์ด์™€ ๊ฐ™์€ ํƒœ๊ทธ๋Š” ์šฐํšŒํ•˜๊ณ  ์žˆ๋‚˜๋ณด๋‹ค ์ด๋Ÿฐ์‹์œผ๋กœ path traversal์„ ์‹œ๋„ํ•ด๋ณด์•˜๋Š”๋ฐ ์•ˆ๋˜์—ˆ๋‹ค ์ฝ”๋“œ๊ฐ€ ์–ด๋–ป๊ฒŒ ์ด๋ฃจ์–ด์ ธ์žˆ๋Š”์ง€ ์ด์ œ ๋œฏ์–ด๋ณด๋„๋ก ํ•˜๊ฒ ๋‹ค #!/usr/bin/env python3 import os import shutil from flask import Flask, request, render_template, redirect from flag import FLAG APP = Flask(__name__) UPLOAD_DIR = 'uploads' @APP.route('/') def index(): files = os.listdir(UPLOAD_DIR) return render_template('index.html', files=files) @..

article thumbnail
[Web Hacking/Python] Request ๋ชจ๋“ˆ ์‚ฌ์šฉ๋ฒ•
๐Ÿ” Security 2023. 9. 24. 17:09

Request ๋ชจ๋“ˆ ์›นํ•ดํ‚น์„ ํ’€ ๋•Œ ์—ฌํƒœ๊ป ๋ฐ˜๋ณต๋œ ์š”์ฒญ์„ ๋ณด๋‚ผ ๋•Œ์—๋Š” burpsuit๋ฅผ ์‚ฌ์šฉํ–ˆ๋Š”๋ฐ, python์˜ request ๋ชจ๋“ˆ์„ ํ†ตํ•ด์„œ๋„ ์ข‹์€ ๊ฒฐ๊ณผ๋ฅผ ๋‚ผ ์ˆ˜ ์žˆ๋‹ค๋Š” ๊ฒƒ์„ ์•Œ์•˜๋‹ค. ๋‘˜์„ ์„ž์–ด์„œ ์‚ฌ์šฉํ•˜๋ฉด ์ข‹์„ ๊ฒƒ ๊ฐ™์•„์„œ request ๋ชจ๋“ˆ์—๋„ ์ต์ˆ™ํ•ด์ง€๋ ค๊ณ  ํ•œ๋‹ค. request ๋ชจ๋“ˆ์„ ์ด์šฉํ•˜๋ฉด GET ์š”์ฒญ์ด๋‚˜ POST ์š”์ฒญ๋“ฑ์„ ๋ณด๋‚ผ ์ˆ˜ ์žˆ๋‹ค(๋ฌผ๋ก  ๋‹ค๋ฅธ ๋ฉ”์†Œ๋“œ๋„ ๊ฐ€๋Šฅํ•˜๋‹ค!) ๋จผ์ € GET ์š”์ฒญ์„ ์–ด๋–ป๊ฒŒ ๋ณด๋‚ด๋Š”์ง€ ์ฝ”๋“œ๋ฅผ ๋ณด์ž. c=request.get(url,header,params..)์ด๋Ÿฐ์‹์œผ๋กœ ๋ณด๋‚ด๋ฉด get ์š”์ฒญ์ด ๊ฐ€์ง„๋‹ค! ์ด๋•Œ ์‘๋‹ต๊ฐ’ c๋Š” response๋ฅผ ๋ฐ›๊ธฐ ๋•Œ๋ฌธ์— c.raw, c.status_code.. ์ด๋Ÿฐ ์‹์œผ๋กœ ์‘๋‹ต์— ๋Œ€ํ•œ ์ •๋ณด๋„ ๋ฐ›์„ ์ˆ˜ ์žˆ๋‹ค. import requests #Reqeust ..