March 26, 2019

WebGoat write up(XXE 3 Let's try)

To comply with the rule, in this write up, some hints related to this challenge only will be mentioned.

룰을 준수하기 위해, 여기서는 챌린지와과 관련된 몇 가지 힌트만이 언급됩니다.

Let’s try
In this assignment you will add a comment to the photo, when submitting the form try to execute an XXE injection with the comments field. Try listing the root directory of the filesystem.

도전.
이번 챌린지에서는 어떤 이미지가 포함된 게시 글에 댓글을 달 것이다. 댓글 작성 시 XXE 인젝션을 시도해보라. 시스템의 최상위(root) 디렉토리에 있는 파일들의 이름을 나열해보라.

WebGoat writeup(XXE 3) solve

SYSTEM is a keyword for external references. When you call the entity "js", it means that you will list(SYSTEM) the file names existing on the C drive(file:///c:/). If you specify a specific file instead of a drive path, the contents of that file are read.

SYSTEM은 외부 참조를 위한 키워드다. 위 코드는 "js" 엔티티를 호출하면 C 드라이브(file:///c:/)에 존재하는 파일 명들을 열람(SYSTEM)하겠다는 의미를 갖는다. 드라이브 경로 대신 특정 파일을 지정한다면 해당 파일의 내용을 읽어온다.

One thing to keep in mind is that if the server being attacked is a Windows system, you should write the drive name after writing three slashes as above, and if there is a Linux system, you have to write three slashes to express the root directory. It is a part that needs to be taken care of because it causes errors even if only one letter is wrong.

한 가지 주의할 사항은, 공격당하는 서버가 윈도우 계열이라면 위와 같이 슬래시를 3개를 적은 이후에 드라이브 명을 적어야 오류가 발생하지 않고, 리눅스 계열이라면 루트 디렉토리를 표현하기 위해서는 슬래시를 3개(file:///) 적어야한다. 한 글자라도 틀리면 오류를 발생시키기에 생각 외로 신경써주어야 하는 부분이다.

WebGoat writeup(XXE 3) solve result