๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ

webhacking3

[Dreamhack] ex-reg-ex ๋“œ๋ฆผํ•ต ์›Œ๊ฒŒ์ž„ ๋ฌธ์ œ ํ’€์ด ๐Ÿคธ‍โ™€๏ธ ex-reg-ex ๋“œ๋ฆผํ•ต ์›Œ๊ฒŒ์ž„ ๋ฌธ์ œ ํ’€์ด 1. ๋ฌธ์ œ ์„ค๋ช… ํ™•์ธ ํ›„ ์„œ๋ฒ„ ์ƒ์„ฑ 2. ์ƒ์„ฑํ•œ ์„œ๋ฒ„๋กœ ์ ‘์†ํ•œ ๋’ค ์ž„์˜์˜ ๊ฐ’ ์ž…๋ ฅ --> Input ๊ฐ’์ด ๊ทธ๋Œ€๋กœ ์ถœ๋ ฅ๋จ์„ ํ™•์ธ 3. ๋ฌธ์ œ ํŒŒ์ผ ๋‹ค์šด๋กœ๋“œ ํ›„ app.py ์˜คํ”ˆ #!/usr/bin/python3 from flask import Flask, request, render_template import re app = Flask(__name__) try: ใ…คใ…คFLAG = open("./flag.txt", "r").read() # flag is here! except: ใ…คใ…คFLAG = "[**FLAG**]" @app.route("/", methods = ["GET", "POST"]) def index(): ใ…คใ…คinput_val = "" ใ…คใ…คif re.. 2023. 11. 24.
[Webhacking.kr] old-20 ์›Œ๊ฒŒ์ž„ ๋ฌธ์ œ ํ’€์ด ๐ŸŽข old-20 ์›Œ๊ฒŒ์ž„ ๋ฌธ์ œ ํ’€์ด 1. ๋ฌธ์ œ ํ™”๋ฉด์˜ ์ž…๋ ฅ๋ž€์„ ๋ชจ๋‘ ์ž‘์„ฑํ•œ ํ›„ Submit ํด๋ฆญ --> Too Slow ๋ผ๋Š” ํŽ˜์ด์ง€๋กœ ์ด๋™ 2. F12 ๋‹จ์ถ•ํ‚ค๋ฅผ ๋ˆŒ๋Ÿฌ ๊ฐœ๋ฐœ์ž ๋„๊ตฌ ์˜คํ”ˆ 3. Elements ํƒญ์œผ๋กœ ์ด๋™ํ•˜์—ฌ ์ฝ”๋“œ ์—ด๋žŒ ++ ๋‹จ์ˆœํžˆ ์œ„ ์ž…๋ ฅ๋ž€์˜ ๋นˆ์นธ์„ 2์ดˆ ์•ˆ์— ์ฑ„์šฐ๋ฉด ๋˜๋Š” ๋“ฏ ํ•จ 4. Console ํƒญ์œผ๋กœ ์ด๋™ํ•˜์—ฌ ์•„๋ž˜์™€ ๊ฐ™์ด ์ž‘์„ฑ lv5frm.id.value=2023; lv5frm.cmt.value=2023; lv5frm.captcha.value=lv5frm.captcha_.value; lv5frm.submit(); ์ฝ”๋“œ ์„ค๋ช… lv5frm.id.value=2023; id ์ž…๋ ฅ ํ•„๋“œ์— "2023" ๋Œ€์ž… lv5frm.cmt.value=2023; cmt ์ž…๋ ฅ ํ•„๋“œ์— "2023" ๋Œ€์ž… lv5frm.. 2023. 8. 24.
[Webhacking.kr] old-26 ์›Œ๊ฒŒ์ž„ ๋ฌธ์ œ ํ’€์ด โ˜„๏ธ old-26 ์›Œ๊ฒŒ์ž„ ๋ฌธ์ œ ํ’€์ด 1. ๋ฌธ์ œ ํ™”๋ฉด์œผ๋กœ ๋“ค์–ด๊ฐ„ ํ›„ view-source ์„ ํƒํ•˜์—ฌ ์ฝ”๋“œ ์—ด๋žŒ view-source ++ GET ๋ฐฉ์‹์œผ๋กœ ์ž…๋ ฅ๋ฐ›์€ id๊ฐ’์ด admin ์ด๋ผ๋ฉด, ๋ฌธ์ œ ํ•ด๊ฒฐ 2. preg_match() ํ•จ์ˆ˜ ์šฐํšŒ๋ฅผ ์œ„ํ•ด, URL ์ธ์ฝ”๋”ฉ ํ‘œ์ค€์— ๋”ฐ๋ผ ์•„๋ž˜ ์ž‘์—… ์ˆ˜ํ–‰ Not - Encoded Encoded - Once Encoded - Twice admin %61%64%6D%69%6E %2561%2564%256D%2569%256E ++ ์‚ฌ์šฉํ•œ URL ์ธ์ฝ”๋” & ๋””์ฝ”๋” --> https://heavenly-appear.tistory.com/176 [URL ์ธ์ฝ”๋”, ๋””์ฝ”๋”] url์ธ์ฝ”๋”ฉ, url๋””์ฝ”๋”ฉ - ๋ฐ”๋กœ ๋ณ€ํ™˜ํ•ด๋“œ๋ ค์š”! Encoding Decoding ๋ณต์‚ฌ๋ฒ„ํŠผ์€ ํ˜„์žฌ ํฌ๋กฌ์—์„œ๋งŒ ์ง€์›.. 2023. 8. 21.