전체 글
-
[A03:2021 – Injection] SSTI (Server Side Template Injection) 취약점 분석Development/개념 및 이론 2025. 5. 25. 01:32
[Web Hacking] picoCTF WebShell SSTI1평소 궁금했던 해킹을 공부하기 위해 OverTheWire Bandit 문제들을 끝내고, “그럼 이제 진짜 CTF를 한번 풀어보자” 싶어서 맨땅에 헤딩하듯 도전했습니다.1. 시작일단 문제를 열었더니 무슨 폼이 하jangto.tistory.com해당 CTF를 풀 때 사용했던 SSTI (Server Side Template Injection)에 대해 제대로 알아보겠습니다.SSTI 취약점은 특히 동적 HTML 응답을 생성하는 서버 측 템플릿 기술에서 자주 발견됩니다.해당 문제는 RCE (Remote Code Execution) 문제로 이어질 수 있기 때문에 강력한 취약점입니다. 아래에 설명한 예시는 CTF에서 사용했을 것이라고 예상되는 Jinja2..
-
[Heap Dump Exposure] picoCTF WebShell head-dumpDevelopment/CTF 문제 풀이 2025. 5. 23. 18:51
1. 탐색이번 사이트는 뭔가 이쁘다.태그들도 다양하고 뭐 블로그 같은건가 보다.일단 사진과 태그들을 클릭하며 뭐 이동 되는게 있나 보자.뭐 왠만한건 다 그냥 HOME 처럼 메인 화면만 나온다.그러다 #API Documentation 태그를 클릭하니 아래와 같은 사이트가 나왔다.이건 개발 업무 할때 자주 보던 API 문서다.이렇게 다양한 End Point가 존재한다.뭐 /, /about, /service는 위에서 이미 클릭하며 봤던거다.문제를 보면 서버 메모리를 담고 있는 파일에 플래그가 숨겨져 있다.2. 풀이바로 /heapdump를 확인해 보자.$ file heapdump-1747991919012.heapsnapshot heapdump-1747991919012.heapsnapshot: ASCII text..
-
[Web Hacking] picoCTF WebShell n0s4n1ty 1Development/CTF 문제 풀이 2025. 5. 23. 02:11
1. 시작이번 문제는 첨부파일로 WebShell 공격을 하는 문제인거 같다.이거 첫문제 풀때 미리 좀 공부 해놨었는데 잘 풀렸으면 좋겠다.2. 분석파일 선택을 누르게 되면 지금 모든 파일이라고 나와 있는걸 볼 수 있다.이게 취약점이라고 할 수 있다고 봤다.upload profile 버튼 클릭시 이렇게 새로운 화면으로 이동한다.network를 보게 되면 지금 해당 웹사이트에 기본적인 정보를 확인할 수 있다.내가 중요하게 본건 Debian이다.이건 Linux 배포판 중에 하나라고 알고 있어서 Linux 명령어가 통할거 같다. 일단 파일을 한번 업로드 해봐야겠다.문구가 바뀌었고 지금 Path가 나오는걸 알 수 있다.이제 이 Path로 접속해보자.내가 올린 파일을 그대로 확인이 가능하다.Spring Framew..
-
[Buffer Overflow] picoCTF WebShell PIE TIMEDevelopment/CTF 문제 풀이 2025. 5. 22. 22:44
1. 시작 및 분석이번 문제의 유일한 힌트를 보고 나름 정리를 해봤다.이거랑 바이너리 파일 하나를 준다.#include #include #include #include void segfault_handler() { printf("Segfault Occurred, incorrect address.\n"); exit(0);}// 뭔가 이거 실행되면 되는거 같다.int win() { FILE *fptr; char c; printf("You won!\n"); // Open file fptr = fopen("flag.txt", "r"); if (fptr == NULL) { printf("Cannot open file.\n"); exit(0); } // Read contents..
-
[A03:2021 – Injection] picoCTF WebShell SSTI1Development/CTF 문제 풀이 2025. 5. 22. 10:25
평소 궁금했던 해킹을 공부하기 위해 OverTheWire Bandit 문제들을 끝내고, “그럼 이제 진짜 CTF를 한번 풀어보자” 싶어서 맨땅에 헤딩하듯 도전했습니다.1. 시작일단 문제를 열었더니 무슨 폼이 하나 있고 버튼이 있다.습관적으로 일단 폼에 아무거나 적고 버튼을 누르니깐 그냥 큰 글씨로 내가 적은 그대로 보여주는 기능인가 보다.overthewire bandit 풀던 습관인지 모르나 ls 먼저 적어봤다.2. 분석 ( 1 )숫자든 영어든 한글이든 특수문자든 다 똑같다.뭐 아는 게 없으니 일단 소스코드에 뭐라도 있을까 싶어 F12로 확인해 봤지만 아무것도 없다.뭐 POST 요청이다라는 거 빼곤 알 수 있는 게 없다. 일단 머리를 굴려보자.DB 들락거리는 건 아닌 거 같고 내가 작성한 글자를 가지고 ..
-
[Linux 공부] Bandit wargames 32~33 단계 login shell & $0Development/Linux 2025. 5. 20. 23:25
Level Goal After all this git stuff, it’s time for another escape. Good luck! Commands you may need to solve this level sh, man" data-og-host="overthewire.org" data-og-source-url="https://overthewire.org/wargames/bandit/bandit33.html" data-og-url="https://overthewire.org/wargames/bandit/bandit33.html" data-og-image=""> OverTheWire: Level GoalWe're hackers, and we are good-looking. We are the 1%...
-
[Linux 공부] Bandit wargames 31~32 단계 gitDevelopment/Linux 2025. 5. 20. 23:11
Level Goal There is a git repository at ssh://bandit31-git@localhost/home/bandit31-git/repo via the port 2220. The password for the user bandit31-git is the s" data-og-host="overthewire.org" data-og-source-url="https://overthewire.org/wargames/bandit/bandit32.html" data-og-url="https://overthewire.org/wargames/bandit/bandit32.html" data-og-image=""> OverTheWire: Level GoalWe're hackers, and we a..
-
[Linux 공부] Bandit wargames 30~31 단계 gitDevelopment/Linux 2025. 5. 20. 22:56
Level Goal There is a git repository at ssh://bandit30-git@localhost/home/bandit30-git/repo via the port 2220. The password for the user bandit30-git is the s" data-og-host="overthewire.org" data-og-source-url="https://overthewire.org/wargames/bandit/bandit31.html" data-og-url="https://overthewire.org/wargames/bandit/bandit31.html" data-og-image=""> OverTheWire: Level GoalWe're hackers, and we a..