๋ฐ์ํ [Dreamhack]WebHacking32 [Dreamhack] CTF Season 5 Round #2 - php7cmp4re ๐๏ธ Access php 7.4๋ก ์์ฑ๋ ํ์ด์ง์ ๋๋ค. ์๋ง์ Input ๊ฐ์ ์ ๋ ฅํ๊ณ ํ๋๊ทธ๋ฅผ ํ๋ํ์ธ์. ํ๋๊ทธ ํ์์ DH{} ์ ๋๋ค. ๐พ Exploit Algorithm & Payload > index.php ๋๋ณด๊ธฐ php7cmp4re index page Enter the correct Input. > check.php ๋๋ณด๊ธฐ php7cmp4re Index page > flag.php ๋๋ณด๊ธฐ #1 : '/' ํ์ด์ง์์ ๋ค์๊ณผ ๊ฐ์ด input1๊ณผ input2์ ์ ๋ ฅ ํ ์ ์ถํ๋ฉด ๊ฐ์ ํ์ธํ ์ ์์ ๊ฒ์ผ๋ก ์์๋๋ค. : ๊ทธ๋ฌ๋ ์ด๋ค ๊ฐ์ ์ ๋ ฅํ์ฌ๋ "Try again."์ด๋ผ๋ ๊ฒฐ๊ณผ๊ฐ ์ถ๋ ฅ๋์ด์ ์ฝ๋๋ฅผ ๋ถ์ํ๋ค. #2 1) input_1๊ณผ input_2๋ ๊ณต๋ฐฑ์ด์ฌ์๋ ์๋๋ค 2) input_1์ ๋ฌธ์.. 2024. 1. 28. [Dreamhack] Level1: error based sql injection ๐๏ธ Access Simple Error Based SQL Injection ! ๐พ Exploit Algorithm & Payload > app.py ๋๋ณด๊ธฐ import os from flask import Flask, request from flask_mysqldb import MySQL app = Flask(__name__) app.config['MYSQL_HOST'] = os.environ.get('MYSQL_HOST', 'localhost') app.config['MYSQL_USER'] = os.environ.get('MYSQL_USER', 'user') app.config['MYSQL_PASSWORD'] = os.environ.get('MYSQL_PASSWORD', 'pass') app.conf.. 2024. 1. 26. [Dreamhack] Level3: CSP Bypass Advanced ๐๏ธAccess Exercise: CSP Bypass์ ํจ์น๋ ๋ฌธ์ ์ด๋ค. ๐พExploit Algorithm & Payload ๋๋ณด๊ธฐ #!/usr/bin/python3 from flask import Flask, request, render_template from selenium import webdriver import urllib import os app = Flask(__name__) app.secret_key = os.urandom(32) nonce = os.urandom(16).hex() try: FLAG = open("./flag.txt", "r").read() except: FLAG = "[**FLAG**]" def read_url(url, cookie={"name": "name", "val.. 2024. 1. 17. [Dreamhack] Level2: blind-command ๐๏ธAccess Read the flag file XD ๐พExploit Algorithm & Payload ๋๋ณด๊ธฐ #!/usr/bin/env python3 from flask import Flask, request import os app = Flask(__name__) @app.route('/' , methods=['GET']) def index(): cmd = request.args.get('cmd', '') if not cmd: return "?cmd=[cmd]" if request.method == 'GET': '' else: os.system(cmd) return cmd app.run(host='0.0.0.0', port=8000) #1 : '/' ํ์ด์ง์์ ?cmd=[cmd]๋ผ๋ ํ๋ฉด์ด ์ถ๋ ฅ๋จ.. 2024. 1. 5. ์ด์ 1 2 3 4 5 6 7 8 ๋ค์ ๋ฐ์ํ