전체 글(140)
-
[CTF] CCE2023 final
14 - 방송국 [WEB, 233point] jsp로 작성된 웹 서비스가 주어진다. admin 폴더를 확인하니 adminPage에서 사용하는 기능을 확인 할 수있었다. 이후, /admin/ImgUpload로 이동해보니 loginPage가 떴고 login 로직을 확인하기 위해서 login.jsp와 함수를 확인해보았다. 이후 xml 파일을 확인해보니 어드민의 id와 pwd로 추정되는 문자열을 확인 할 수 있었는데, 이때 pwd가 해싱된 문자열인줄 알고 로그인 시도 안하고 있다가, 다른 경로에서는 도저히 admin계정을 알아낼 수 있는 방법이 없어서 위 문자열을 대입했더니 admin으로 로그인 되었다. admin ROLE을 얻게 되어서 /admin 하위 경로로 들어갈 수 있는 권한을 얻게 되었다. 따라서 /a..
2023.07.13 -
백준 [ALGORITHM] - 카드 놓기 (5568)
from itertools import permutations n = int(input()) k = int(input()) lst = [] num = [] for i in range(n): x = int(input()) num.append(x) permutations = permutations(num, k) for permutation in permutations: number = int(''.join(map(str, permutation))) lst.append(number) print(len(set(lst))) 파이썬의 itertools에 조합으로 정수를 만들어주는 함수가 있는 걸 알게 되었다. 근데 시간 생기면 직접 만들어볼 예정
2023.06.12 -
백준 [ALGORITHM] - 명령 프롬프트 (1032)
n = int(input()) lst = [] passlist = [] place = [] for i in range(n): text = input() lst.append(text) if n == 1: print(text) exit() else: for i in range(len(lst)-1): for j in range(len(lst[i])): if lst[i][j] != lst[i+1][j]: temp = list(lst[i]) temp.pop(j) temp.insert(j,'?') passlist.append(temp) for i in range(len(passlist)): if '?' in passlist[i]: place.append(str(passlist[i]).index('?')) else:..
2023.06.11 -
[CTF] SECCON Beginners 2023
Forbidden - web var express = require("express"); var app = express(); const HOST = process.env.CTF4B_HOST; const PORT = process.env.CTF4B_PORT; const FLAG = process.env.CTF4B_FLAG; app.get("/", (req, res, next) => { return res.send('FLAG はこちら: /flag'); }); const block = (req, res, next) => { if (req.path.includes('/flag')) { return res.send(403, 'Forbidden :('); } next(); } app.get("/flag", blo..
2023.06.04 -
백준 [ALGORITHM] - 인사성 밝은 곰곰이 (25192)
n = int(input()) count = {} tmp = 0 tmp2 = 0 for i in range(n): inner = input() if inner not in count: count[inner] = 1 if inner == 'ENTER': tmp2 += 1 tmp += len(count) count.clear() tmp += len(count) print(tmp - tmp2) 처음엔 list로 만들었는데 list로 하면 값들이 많아졌을때 카운트를 하게 되면 시간 복잡도가 너무 커져서 시간초과가 발생함 따라서 dict를 이용해서 카운트 해주었다.
2023.05.29 -
[CTF] DEFCON31 Quals
Welcome to Quals This challenge is probably a mic check. In the beginning, there was an issue where the server didn't work properly due to a high influx of users. Anyway, I will explain this chall . . . You can access the server of the problem through the provided URL. The problem was simple. By using "ls /," it was possible to confirm the existence of "flag.txt" in the root directory, and readi..
2023.05.29