본문 바로가기

전체 글237

[WaniCTF 2023] Extract Service 2 1. 개요 심볼릭 링크 문제 2. 분석 ExtractFile 함수에서 압축을 해제하고 있고, 이때 심볼링 링크가 걸려 있으면 /flag의 파일의 내용이 노출될 수 있습니다. package main import ( "net/http" "os" "os/exec" "path/filepath" "regexp" "github.com/gin-gonic/gin" "github.com/google/uuid" ) func main() { r := gin.Default() r.LoadHTMLGlob("templates/*") r.MaxMultipartMemory = 1 bytes: os.system('ln -s /flag word/document.xml') os.system('zip --symlinks -r sample.. 2023. 5. 6.
[WaniCTF 2023] Extract Service 1 1. 개요 LFI 문제 2. 분석 플래그는 /flag에 있다고 주어졌습니다. 코드를 보면, POST 로 파일 업로드 후 target 값의 파일을 로컬에서 읽어옵니다. targe값으로 flag를 읽어봅시다. package main import ( "net/http" "os" "os/exec" "path/filepath" "regexp" "github.com/gin-gonic/gin" "github.com/google/uuid" ) func main() { r := gin.Default() r.LoadHTMLGlob("templates/*") r.MaxMultipartMemory = 1 bytes: docx = open('./temp.docx', 'rb') return docx def get_flag(nu.. 2023. 5. 6.
[WaniCTF 2023] netcat 1. 개요 net cat 사용 문제 2. 분석 pwntools로 덧셈 문제 3개 계산 import os os.environ['PWNLIB_NOTERM'] = '1' from pwn import * # 1. connect p = remote('netcat-pwn.wanictf.org', 9001) p.connected() # 2. recv for i in range(3): score = p.recvlines(4) arith = p.recv().decode('utf-8') arith = arith.replace('[+=]', '') nums = [int(num) for num in re.sub(r'[+=\n]+', '', arith).split()] result = sum(nums) print('result.. 2023. 5. 6.
[Lord of sql injeciton] goblin 1. 개요 hex encoding, char() 문제 2. 분석 id=admin인 유저를 조회해야합니다. 2023. 5. 5.