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

CTF3

[UWSP Pointer Overflow CTF 2023] Unquestioned and Unrestrained Write Up ๐Ÿ‘จ‍๐Ÿ’ผ Unquestioned and Unrestrained Write Up 1. ๋ฌธ์ œ ์ˆ™์ง€ ํ›„ ์•”ํ˜ธ๋ฌธ ํ™•์ธ + ์•”ํ˜ธํ™” ๋ฐฉ์‹๊ณผ ํ‰๋ฌธ์„ ์•Œ๋ ค์ฃผ์ง€ ์•Š์€ ์ƒํƒœ์—์„œ ์•”ํ˜ธ๋ฌธ๋งŒ์„ ๋ณด๊ณ  ํ‰๋ฌธ์„ ์œ ์ถ”ํ•˜๋Š” ๋ฌธ์ œ ++ ์œ ์ผํ•œ ํžŒํŠธ๋Š” ๋ณดํŽธ์ ์ธ ์•”ํ˜ธํ™” ๋ฐฉ์‹์ด๋ผ๋Š” ๊ฒƒ! 2. ๊ฐ ์•”ํ˜ธํ™” ๋ฐฉ์‹์— ๋”ฐ๋ผ ๋ณตํ˜ธํ™”ํ•˜๊ธฐ ์œ„ํ•œ Python ์Šคํฌ๋ฆฝํŠธ ์ž‘์„ฑ # Base64 import base64 def base64_decode(encoded_text): ใ…คใ…คdecoded_bytes = base64.b64decode(encoded_text) ใ…คใ…คdecoded_text = decoded_bytes.decode('utf-8') ใ…คใ…คreturn decoded_text # ์ฃผ์–ด์ง„ ์•”ํ˜ธ๋ฌธ์— ๋Œ€ํ•ด Base64 ๋””์ฝ”๋”ฉ ์‹œ๋„ ciphertext = "cG9j.. 2023. 11. 12.
[CSAW CTF 2023] Baby's First Write Up ๐Ÿ›น Baby's First Write Up 1. ๋ฌธ์ œ ํ™•์ธ ํ›„ ์ฒจ๋ถ€ ํŒŒ์ผ ๋‹ค์šด๋กœ๋“œ 2. ๋‹ค์šด๋ฐ›์€ babyfirst.py ํŒŒ์ผ์„ ์—ด์–ด ์ฝ”๋“œ ํ™•์ธ #!/usr/bin/env python3 # Reversing is hard. But....not always. # # Usually, you won't have access to source. # Usually, these days, programmers are also smart enough not to include sensitive data in what they send to customers.... # # But not always.... if input("What's the password? ") == "csawctf{w3_411_star7_5om3w.. 2023. 9. 16.
[Patriot CTF 2023] Python XOR Write Up ๐Ÿฆ„ Python XOR Write Up 1. ๋ฌธ์ œ ํ™•์ธ ํ›„ ์ฒจ๋ถ€ ํŒŒ์ผ ๋‹ค์šด๋กœ๋“œ 2. ๋‹ค์šด๋ฐ›์€ XOR.py ํŒŒ์ผ์„ ์—ด์–ด ์ฝ”๋“œ ๋ถ„์„ from string import punctuation # ํŠน์ˆ˜ ๋ฌธ์ž(punctuation)๋ฅผ ๊ฐ€์ ธ์™€ ์•ŒํŒŒ๋ฒณ๊ณผ ํŠน์ˆ˜ ๋ฌธ์ž์˜ ๋ฆฌ์ŠคํŠธ ์ƒ์„ฑ alphabet = list(punctuation) # ์•”ํ˜ธ๋ฌธ data = "bHEC_T]PLKJ{MW{AdW]Y" def main(): ใ…คใ…ค# ๋ณตํ˜ธํ™” ํ‚ค ์ •์˜ ใ…คใ…คkey = ('') ใ…คใ…ค# ๋ฐ์ดํ„ฐ๋ฅผ ๋ณตํ˜ธํ™”ํ•˜์—ฌ ํ‰๋ฌธ ์–ป๊ธฐ ใ…คใ…คdecrypted = ''.join([chr(ord(x) ^ ord(key)) for x in data]) ใ…คใ…ค# ๋ณตํ˜ธํ™”๋œ ๋ฉ”์‹œ์ง€ ์ถœ๋ ฅ ใ…คใ…คprint(decrypted) # main ํ•จ์ˆ˜๋ฅผ ์‹คํ–‰ํ•˜์—ฌ ๋ณตํ˜ธํ™” ์ˆ˜ํ–‰ main().. 2023. 9. 9.