SWUFORCE/워게임

워게임 - Snowing!

hmyang444 2026. 3. 20. 17:22

문제 설명: 

드림이: 우와! 밖에 눈이 많이와요!

드림맘:  그렇네~

드림이:  거의 모두 하얀공간뿐이네요.

 

문제 파일 다운로드 받고 열어보니 2개의 파일이 존재함 - flag.txt랑 snowing!.jpeg

flag.txt는 그냥 fake.snow.....이러고

사진을 봤더니 귀여운 눈사람이 있었음^^

 

hxd로 열어봤음 - 시그니처(헤더,푸터)는 정상적으로 jpeg 시그니처가 보임

 

사진 한 장 덜렁 놓여져 있었기 때문에 스테가노그래피를 의심했음

그 전에 Aperi'solve는 zsteg, steghide, exiftool 등을 한 번에 실행해서 결과를 리포트로 보여준다고 하길래 사진을 넣어봤음

흠 다 뭐가 없다고 나옴

안에 숨겨진 압축 파일도 없고, steghide도 추출할게 없다고 뜸..

이건 아니다. 다시 살펴봐야겠음.

 


다시 처음부터 해봐야겠음

 

flag.txt를 메모장에서 열었을 때는 아무것도 없는 것 같았는데, hxd에 넣으니 진짜 눈이 내리는 것처럼 이렇게 표현되어 있음

헥스(Hex) 값을 확인해 보면 특정 패턴이 반복되고 있음

  • 20: 스페이스(Space)
  • 09: 탭(Tab)
  • 0A: 줄바꿈
이 세 가지 문자로만 구성된 데이터 형식은 보통 Whitespace(화이트스페이스) 프로그래밍 언어나, 단순히 **이진수(Binary)**를 은닉한 형태일 가능성이 매우 높습니다.

 

오,, Whitespace 프로그래밍 언어라는게 있는 줄 몰랐다. 찾아보니 이렇게 홈페이지도 존재함

의미가 나름 심오함. 현대 프로그래밍 언어는 공백을 좀 무시하는 경향이 있어, 이를 불공평하게 여기는 사람들이 보이지 않는 것의 중요함을 상기시키며 만든 언어같음ㅎ

이를 해석할 수 있는 툴도 있음, 근데 잘 열리지 않아서 다른 곳에서 찾아주었음

 

https://www.jdoodle.com/execute-whitespace-online

 

JDoodle - Online Compiler, Editor for Java, C/C++, etc

JDoodle is an Online Compiler, Editor, IDE for Java, C, C++, PHP, Perl, Python, Ruby and many more. You can run your programs on the fly online, and you can save and share them with others. Quick and Easy way to compile and run programs online.

www.jdoodle.com

이것은 소스코드를 컴파일해주는 도구인데 여기에 hxd값을 넣어주었더니,

Hello, world of spaces!가 나옴

 

....그래서 ㅇㅣ게 뭔데...

 

 

이건 whitespace 해독을 위한 온라인 컴파일 사이트인데..구분은 잘되는데 Runtime error가 뜨면서 딱히 숨겨진 문자열이나 키를 찾을 수 없는 것 같음. 

 

찾아보다가 whitespace steganography가 따로 있는 것을 확인했음. 이렇게 공백 스테가노그래피로, 숨겨진 무언가를 찾을 수 있다고 함.  툴을 깔아주니 SNOW.EXE랑 SNOW.DOC가 있음. 하나하나 확인해보자

 

 

DOC파일은 exe실행파일을 위한 옵션이나 예시를 정리해둔 파일이었음.

OPTIONS 

-C     Compress the data if concealing, or  uncompress  it
              if extracting.
 
       -Q     Quiet   mode.  If  not  set,  the  program  reports
              statistics  such  as  compression  percentages  and
              amount of available storage space used.
 
       -S     Report on the approximate amount of space available
              for hidden message in the text file. Line length is
              taken  into account, but other options are ignored.
 
       -p password
              If this is set, the data  will  be  encrypted  with
              this password during concealment, or decrypted dur-
              ing extraction.
 
       -l line-len
              When appending whitespace, snow will always produce
              lines shorter than this value. By default it is set
              to 80.
 
       -f message-file
              The contents of this file will be concealed in  the
              input text file.
 
       -m message-string
              The  contents  of  this string will be concealed in
              the input text file.  Note that, unless  a  newline
              is  somehow  included in the string, a newline will
              not be printed when the message is extracted.


EXAMPLES
       The following command  will  conceal  the  message  "I  am
       lying" in the file infile, with compression, and encrypted
       with the password "hello world". The resulting  text  will
       be stored in outfile.
 
              snow  -C  -m  "I  am lying" -p "hello world" infile
              outfile
 
       To extract the message, the command would be
 
              snow -C -p "hello world" outfile
 
       Note that the resulting message will not be terminated  by
       a newline.
 
       To  prevent line wrap if text with concealed whitespace is
       likely to be indented by mail  or  news  readers,  a  line
       length of 72 or less can be used.
 
              snow -C -l 72 -m "I am lying" infile outfile
 
       The  approximate  storage capacity of a file can be deter-
       mined with the -S option.
 
              snow -S -l 72 infile

오,,이해가 안돼서 gemini한테 이 옵션들 좀 해석해달라고 함. 근데 딱히 지금 필요한 옵션들은 아닌 것 같아서 예시를 바로 확인함

snow -C -p "hello world" outfile --> 이런식으로 하면 되지 않을까?

그래서 시도해봄. 근데 일단 터미널 자체가 좀 이상해서 그냥 EXE파일에서 하지 말고, 터미널에서 EXE파일로 들어가는게 맞을 것 같음.

해당 파일을 열어서 SNOW.EXE랑 flag.txt를 같은 곳에 놓고, 

snow -C flag.txt를 썼더니 flag가 나옴!!!

짠짠짠

하;;;;이미지는 그냥 귀엽기만 했음;;