write up(11)
-
[CTF write up] codegate CTF 2023 general - Mediocrity : Race Condtion in VM
취약점은 매우 간단한다. Thread를 생성할때, mem을 포인터째로 복사해서 mem에서 Race condition이 발생한다. The vulnerability is very simple. When creating a thread, mem is copied as a pointer, so a race condition occurs in mem. opcode 중 mem을 참조하여 read / write 하는 부분이 있는데, 기본적으로는 boundary check가 잘 되어있지만, Race condition을 이용하면 Boundary check 이후 mem 값을 변경하여 OOB read / write를 할 수 있다. There is a part of the opcode that reads/writes by r..
2023.06.18 -
[CTF write up] Just CTF 2023 - notabug2 : Exploitable Feature of sqlite3
굉장히 난이도 있고 Tricky한 문제였지만, 팀원들의 도움으로 풀 수 있었다. It was a very difficult and tricky challenge, but We were able to solve it with the help of my teammates. sqlite3 interactive 쉘을 열어주며, .system과 같은 dot 커맨드를 제한한다. Opens an sqlite3 interactive shell and restricts dot commands such as .system. select Load_extension('/lib/x86_64-linux-gnu/libc.so.6','puts'); sqlite3에는 위와 같이 Load_extension를 이용해서 외부 공유파일의 함..
2023.06.05 -
[CTF write up] Ricerca CTF 2023 - Challenges : I want to study crypto~
Pwnable 빼고 쉬운 문제 몇개를 풀어보았다. 처음으로 풀어보는 Crypto인 Rotated Secret analysis는 꽤 재밌었고, Web에서는 딱히 적당히 재밌는 문제가 없었다. 리버싱은 warm-up 문제를 빼고는 최소 7솔브부터 시작이라 딱히 건드릴 수 있는게 없었다. welcome RicSec{do_U_know_wh4t_Ricerca_means_btw?} crackme 그냥 디컴파일하면 나온다. RicSec{U_R_h1y0k0_cr4ck3r!} Reveolving Latters 반대로 하면 나온다. LOWER_ALPHABET = "abcdefghijklmnopqrstuvwxyz" def decrypt(secret, key): assert len(secret) > l*3) - ((n >> ..
2023.04.26 -
[CTF write up] LINE CTF 2023 - Hackatris : ncusre.h Tetris pwn
Dice CTF 2023의 zelda와 마찬가지로 ncurse.h 라이브러리로 제작된 테트리스 게임이다. zelda 처럼 ncusre.h FSOP Exploit이 필요한 문제는 아니었고, 단순 버퍼오버플로우 취약점이었지만 ncurse.h 라이브러리로 짜여진 프로그램들 특유의 괴상한 인풋 / 아웃풋 때문에 고생했다. Like zelda in Dice CTF 2023, it is a Tetris game made with the ncurse.h library. It was not a problem that required ncusre.h FSOP Exploit like zelda, it was a simple buffer overflow vulnerability, but I suffered from stra..
2023.03.26 -
[CTF write up] WACON CTF 2022 Qual - babystack : Begginer's Real-World Challenge
https://irrlicht.sourceforge.io/forum/viewtopic.php?f=7&t=52785&sid=82d189da1e8d466aea667d5958334975 [fixed]Stack buffer overflow in MD2 Parser - Irrlicht Engine You discovered a bug in the engine, and you are sure that it is not a problem of your code? Just post it in here. Please read the bug posting guidelines first. procfs Posts: 2 Joined: Thu Dec 09, 2021 11:12 am Post by procfs » Sun Dec 1..
2022.06.26 -
[CTF write up] DEF CON CTF 2022 Qual - smuggler's cove : Open-Source Exploitation
일반적인 포너블 문제와 달리 netcat이 아닌 웹을 통해 접속해야 한다. 웹에서 사용자로부터 Lua Script를 받고 이를 오픈소스 Lua 컴파일러인 LuaJIT으로 실행한다. 이때, LuaJIT은 공유 파일(so) 형태로 있으며, C로 코딩된 커스텀 바이너리에서 해당 공유 파일을 import 하고 사용자의 Lua Script를 실행한다. 바이너리를 분석해보면 일반적인 Lua 함수는 사용할 수 없으며, C로 구현된 print 함수와 Cargo 함수만을 Lua Script 내에서 이용할 수 있다. 취약점 역시 C로 구현된 함수에 존재하는데, Cargo 함수를 이용하면 사용자가 Lua Script에서 정의한 함수를 가리키는 포인터를 오염시킬 수 있다. 취약점 자체는, 커스텀 Lua 함수를 구현하는 바이너..
2022.05.30