May 12, 2019

WebGoat write up(Without account)

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

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

Can you still vote?
투표하기.

The callenge of WebGoat write up(Without account)

The clue of WebGoat write up(Without account)

And there is a hint obtained through HTML source code, script, request message tampering, etc. As you can see in the above image, if you send a request message by writing "OPTIONS" in the HTTP method, you can see the methods allowed by the server side. The server supports "GET" and "HEAD" methods.

그리고 HTML 소스코드, 스크립트, 요청 메시지 변조 등을 통하여 한 가지 얻게 된 힌트가 있는데, 위 그림처럼 HTTP 메소드로 "OPTIONS"를 적어 요청 메시지를 전송하면 서버 측에서 허용하는 메소드들을 확인할 수 있다는 점이다. 서버는 "GET"과 "HEAD" 메소드를 지원하고 있다.

The result of WebGoat write up(Without account)

WebGoat write up(Admin password reset)

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

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

Try to reset the password for admin.
"admin" 계정의 패스워드를 초기화하라.

The callenge of WebGoat write up(Admin password reset)

$ git reset --hard f94■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
HEAD의 현재 위치는 f94■■■■입니다 First version of WebGoat Cloud website

$ ls
 Challenge_7.adoc   git   'MD5$MD5State.class' 
 PasswordResetLink.class   Challenge7.html   …

In order to check the changed contents of the file, restore the state of the commit to the past place that the commit that the key was removed. So, you will see that the "PasswordResetLink.class" file used at that time is created.

해당 파일의 변경된 내용을 확인하기 위해, 키가 지워졌다는 커밋보다 한칸 이전의 커밋의 상태로 복원한다. 그러면 당시 사용된 "PasswordResetLink.class" 파일이 생성되는 것을 볼 수 있다.

The result of WebGoat write up(Admin password reset)

WebGoat write up(Creating a new account)

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

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

Can you login as Tom? It may be a little harder than it was for Larry.
"tom" 계정으로 로그인하라. 이전의 "Larry"보다는 조금 더 어려울 수 있다.

the clue of WebGoat write up(Creating a new account)

It assumes that a blind SQL injection attack will take place. Remember the response if the condition is true or false. When the condition is true, the answer "already exists ~" comes. On the other hand, when the condition is false, the answer is "created ~".

블라인드 SQL 인젝션 공격이 통할 것이라고 가정하고, 조건이 참이 되는 경우와 거짓이 되는 경우의 응답을 기억한다. 조건이 참일 때 "already exists ~"라는 답변이 돌아온다. 반대로 조건이 거짓일 때는 "created ~"라는 답변이 돌아온다.

the result of WebGoat write up(Creating a new account)

WebGoat write up(Without password)

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

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

Can you login as Larry? "Larry"
계정으로 로그인하라.

the clue of WebGoat write up(Without password)

It is a challenge related to SQL injection. The simplest way to check this is to enter only single quotes(') or double quotes(") in every field you can enter. If this character is treated as a special character on the server side, you may get an error message like the above image, depending on the environment.

SQL 인젝션과 관련된 챌린지이다. 이를 확인할 수 있는 제일 간단한 방법은, 입력할 수 있는 모든 필드에 작은따옴표(')나 큰따옴표(")만을 입력해보는 것이다. 이것이 서버 측에서 특수문자로 처리되는 경우, 상황에 따라서 위 이미지와 같이 오류 메시지를 받을 수 있을 것이다.

the result of WebGoat write up(Without password)

WebGoat write up(Admin lost password)

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

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

the callenge of WebGoat write up(Admin lost password)

the clue of WebGoat write up(Admin lost password)

Download the picture. And when you open it with Notepad, you can see that the password is recorded in the middle of the bits of images as shown in the picture above. This is a challenge that requires more sensation than specific vulnerability inspection techniques.

이 그림을 다운로드 받는다. 그리고 메모장으로 열어보면 위 그림과 같이 이미지들의 비트들 중간에 패스워드가 기록되어 있는 것을 알 수 있다. 이는 특별한 취약점 점검 기술보다는 센스가 요구되는 챌린지에 해당한다.

the result of WebGoat write up(Admin lost password)

WebGoat write up(HTML tampering 2 Try it yourself)

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

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

(2) Try it yourself
In an online store you ordered a new TV, try to buy one or more TVs for a lower price.

(2) 도전.
어떤 온라인 매장에서 당신은 TV를 주문했다. 1개 이상의 TV를 주문하지만, 그 가격보다 저렴하게 구입해보라.

the clue of WebGoat write up(HTML tampering 2 Try it yourself)

When you check the source code using the developer tool, you can see the above part right below the order form.

개발자 도구를 이용하여 소스코드를 확인하다보면, 주문서 폼 바로 아래에서 위와 같은 부분을 확인할 수 있다.

the result of WebGoat write up(HTML tampering 2 Try it yourself)

WebGoat write up(Client side filtering 3 No need to pay)

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

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

(3) No need to pay if you know the code
(3) 코드의 메커니즘을 이해한다면 지불할 필요가 없다.

the clue of WebGoat write up(Client side filtering 3 No need to pay)

Among these two request messages, the GET method shows that there is a word "coupons" in the destination address to be sent, and the code is at the after.

이 두 개의 요청 메시지 중 GET 방식으로 전송된 것을 보면, 전송되는 목적지 주소에 "coupons"이란 단어가 있고 그 이후에 입력한 코드가 붙어서 전송되는 것을 확인할 수 있다.

the result of WebGoat write up(Client side filtering 3 No need to pay)

WebGoat write up(Client side filtering 2 Salary manager)

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

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

(2) Salary manager
You are logged in as Moe Stooge, CSO of Goat Hills Financial. You have access to everyone in the company’s information, except the CEO, Neville Bartholomew. Or at least you shouldn’t have access to the CEO’s information. For this assignment, examine the contents of the page to see what extra information you can find.

(2) 급여 관리자.
당신은 Goat Hils Financial사의 CSO인 Moe Stooge의 계정에 로그인되어있다. CEO인 Neville Bartholomew를 제외하고 사내 모든 인원의 정보를 열람할 수 있다. 적어도 CEO의 정보에는 접근할 수 없어야 한다. 아래의 페이지를 확인하여 어떤 추가 정보가 있는지 확인하라.

the clue of WebGoat write up(Client side filtering 2 Salary manager)

It can be indirectly known that the data transmitted from the first server contains data of all the employees because the HTTP message is not generated separately when the personal information of each employee is read. It is thought that the information stored somewhere has been moved according to the script operation.

각 직원의 개인정보를 열람 시마다 별도 HTTP 메시지가 발생하지 않는 것으로 보아, 최초 서버에서 전송받은 데이터에 모든 직원의 데이터가 담겨있었음을 간접적으로 알 수 있다. 어딘가 저장되어 있던 정보가 스크립트 동작에 따라 이동되었을 것으로 생각된다.

the result of WebGoat write up(Client side filtering 2 Salary manager)

WebGoat write up(Bypass front-end restrictions 3 Validation)

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

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

(3) Validation
Often, there is some mechanism in place to prevent users from sending altered field values to server, such as validation before sending. Most of popular browsers such as Chrome don’t allow editing scripts during runtime. We will have to circumvent the validation some other way.

(3) 검증.
종종 사용자가 변경한 값은, 전송 전 검증을 통해, 서버 측으로 보내지 못하도록 하는 메커니즘이 탑재된 경우가 있다. 크롬과 같은 유명한 브라우저는 런타임 중에는 스크립트를 수정할 수 없다. 그러므로 우리는 다른 방식으로 검증을 우회해야 할 것이다.

Task    도전.
Send a request that does not fit the regular expression above the field in all fields.

모든 필드에서 각 정규표현식(제한사항)을 우회한 값을 입력하여 전송한다.

the clue of WebGoat write up(Bypass front-end restrictions 3 Validation)

When you click the "Submit" button, you will see that the "validate ()" function, written in JavaScript, is executed to be checked by the restrictions of all the regular expression types. Delete the square part of the form tag. Then you do not need to be validated.

"Submit"버튼을 누르면 자바스크립트로 작성된 "validate()" 함수가 실행되어, 갖가지 정규표현식 형태의 제한사항으로부터 점검을 받게 된다는 것을 알 수 있다.이 form 태그의 네모 친 부분을 지워주도록 한다. 그러면 검증받지 않아도 된다.

the result of the clue of WebGoat write up(Bypass front-end restrictions 3 Validation)

WebGoat write up(Bypass front-end restrictions 2 Field Restrictions)

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

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

(2) Field Restrictions
In most browsers, client has complete or almost complete control over HTML part of the webpage. They can alter values or restrictions to fit their preference.

(2) 필드 제한.
몇몇 브라우저에서, 클라이언트는 웹 페이지의 HTML을 완벽하게 혹은 거의 모든 부분을 제어할 수 있다. 그들은 기호에 맞게 값이나 제한 여부를 변경할 수도 있다.

Task    도전.
Send a request that bypasses restrictions of all four of these fields
4개의 필드에서의 각 제한을 우회하여 요청 메시지를 전송하라.

the clue of WebGoat write up(Bypass front-end restrictions 2 Field Restrictions)

Finally, for text input elements with character limits, override the existing character limits by changing or removing the value of the "maxlength" attribute, which restricts characters.

마지막, 글자 제한이 걸린 text 타입의 input 엘리먼트에서는, 글자 제한을 거는 어트리뷰트인 "maxlength"의 값을 변경하거나 제거하여 기존의 글자 제한을 극복한다.

the result of WebGoat write up(Bypass front-end restrictions 2 Field Restrictions)

WebGoat write up(Vulnerable Components 12 Exploiting CVE-2013-7285 (XStream))

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

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

(12) Exploiting CVE-2013-7285 (XStream)
WebGoat Sends an XML document to add contacts to a contacts database.

(12) CVE-2013-7285(XStream) 취약점 공격.
WebGoat는, 데이터베이스에 연락처 정보를 추가하기 위해, 해당 정보를 XML 문서형태로 전송한다.

<contact>
    <id>1</id>
    <firstName>Bruce</firstName>
    <lastName>Mayhew</lastName>
    <email>webgoat@owasp.org</email>
</contact>

For this example, we will let you enter the xml directly versus intercepting the request and modifying the data. You provide the XML representation of a contact and WebGoat will convert it a Contact object using XStream.fromXML(xml).

이번 챌린지에서는, 요청 메시지를 인터셉트하여 수정하기보다는, XML을 직접 입력하도록 구성하였다. 당신이 입력한 XML 형식의 연락처는 WebGoat에서 "XStream.fromXML(xml)"을 통해 "Contact" 객체로 변환될 것이다.

$ git clone https://github.com/pwntester/XStreamPOC.git
'XStreamPOC'에 복제합니다...
remote: Enumerating objects: 61, done.
remote: Counting objects: 100% (61/61), done.
remote: Compressing objects: 100% (29/29), done.
remote: Total 61 (delta 10), reused 61 (delta 10), pack-reused 0
오브젝트 묶음 푸는 중: 100% (61/61), 완료.

This challenge has its own flaws that can not be cleared. After downloading the POC separately, you can practice by modifying the source code.

이번 챌린지는 클리어할 수 없는 자체적인 결함이 있다. POC를 별도로 다운로드 받은 후 소스코드를 일부 수정하면 실습할 수 있다.

the clue of WebGoat write up(Vulnerable Components 12 Exploiting CVE-2013-7285 (XStream))

Run the compiled Java program. Similarly, you must specify the classpath, and you must also correctly reflect the package path for that class. When executed, the program registered in the event handler is executed.

컴파일 완료된 자바 프로그램을 실행시켜본다. 마찬가지로 클래스 패스를 지정해주어야 하고, 추가로 해당 클래스의 패키지 경로를 정확히 반영해야 한다는 점을 주의하면 된다. 실행 시 이벤트 핸들러에 등록한 프로그램이 실행된다.

WebGoat write up(Cross-Site Request Forgeries 8 Login CSRF attack)

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

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

(8) Login CSRF attack
(8) 로그인 CSRF 공격.

In a login CSRF attack, the attacker forges a login request to an honest site using the attacker's username and password at that site. If the forgery succeeds, the honest server responds with a Set-Cookie header that instructs the browser to mutate its state by storing a session cookie, logging the user into the honest site as the attacker. This session cookie is used to bind subsequent requests to the user's session and hence to the attacker's authentication credentials. Login CSRF attacks can have serious consequences, for example see the picture below where an attacker created an account at google.com the victim visits the malicious website and the user is logged in as the attacker. The attacker could then later on gather information about the activities of the user.

로그인 CSRF 공격 시, 공격자는 자신의 ID/PW를 이용하여 희생자로 하여금 로그인 요청 메시지를 전송하게 만든다. 만약 공격이 성공하면, 서버는 헤더에 "Set-Cookie" 항목을 포함하여 희생자에게 응답하는데, 이것은 브라우저가 세션 쿠키를 저장하도록 지시하는 역할을 한다. 그러면 희생자는 공격자의 계정으로 로그인 되는 것이다. 이 세션 쿠키는, 이후의 요청 메시지를 대상으로, 희생자의 세션과 공격자의 인증 정보를 묶을 때 사용된다. 로그인 CSRF 공격은 심각한 결과를 초래할 수 있다. 예를 들어, 아래 그림과 같이 공격자는 google.com에서 계정을 만들었다고 가정한다. 이어서 희생자는 악성 사이트를 방문하고, 공격자의 계정으로 로그인하게 된다. 그러면 공격자는 희생자의 활동 이력을 수집할 수 있게 된다.

For more information read the following paper.
세부 정보는 아래 링크를 참조하라.

http://seclab.stanford.edu/websec/csrf/csrf.pdf

In this assignment try to see if WebGoat is also vulnerable for a login CSRF attack. Leave this tab open and in another tab create a user based on your own username prefixed with csrf-. So if your username is tom you must create a new user called csrf-tom.

WebGoat가 로그인 CSRF 공격에 취약한지 확인하라. 이 탭은 그대로 두고 새 탭을 연 뒤, "csrf-" 접두어가 붙은 새로운 계정을 생성한다. 만약 계정명이 "tom" 이라면 "csrf-tom"이 될 것이다.

Login as the new user. This is what an attacker would do using CSRF. Then click the button in the original tab. Because you are logged in as a different user, the attacker learns that you clicked the button.

새로 생성한 계정으로 희생자가 로그인 하도록 만들어라. 이것은 공격자가 CSRF를 수행하는 방식이다. 그리고 기존의 열어두었던 탭으로 돌아와 아래의 버튼을 클릭하라. 새 계정으로 로그인되었다면 공격자는 아래 버튼의 클릭 여부를 확인할 수 있다.

the clue of WebGoat write up(Cross-Site Request Forgeries 8 Login CSRF attack)

Now we need to create a malicious page that the victim will visit. Create an HTML file on the desktop and enter the above source code. The main point is to send a request to the login page with the POST method, which contains the newly created account name and password. The JavaScript code below means sending the information written in the form to the server.

이제 희생자가 방문하게 될 악성 페이지를 만들어야 한다. 바탕화면 등에 HTML 파일을 하나 만들어 위의 소스코드를 입력한다. 주요 내용은 POST 메소드로 로그인 페이지에 요청을 전송하는 것인데, 여기에는 공격자자 새로 생성한 계정명과 비밀번호가 심어져 있다. 그 아래 자바스크립트 코드는, 위 폼에 입력된 정보를 서버로 전송한다는 내용이다.

the result of WebGoat write up(Cross-Site Request Forgeries 8 Login CSRF attack)

WebGoat write up(Cross-Site Request Forgeries 7 CSRF and content-type)

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

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

(7) CSRF and content-type
(7) CSRF와 content-type

In the previous section we saw how relying on the content-type is not a protection against CSRF. In this section we will look into another way we can perform a CSRF attack against a APIs which are not protected against CSRF.

우리는 이전 섹션에서, content-type에 의존하는 방식은 CSRF에 대한 보호대책이 될 수 없음을 확인하였다. 이번 섹션에서는 CSRF 공격으로부터 보호되지 않는 API가 이용된, 다른 방식의 CSRF 공격에 대해 알아볼 것이다.

In this assignment you need to achieve to POST the following JSON message to our endpoints:

이번 챌린지에서 당신은 아래의 JSON 메시지를 POST 방식으로 엔드포인트(서버)에 전송해야 한다.

POST /csrf/feedback/message HTTP/1.1
{
  "name"    : "WebGoat",
  "email"   : "webgoat@webgoat.org",
  "content" : "WebGoat is the best!!"
}


More information can be found here
이와 관련된 정보는 여기서 확인할 수 있다.

http://pentestmonkey.net/blog/csrf-xml-post-request

Remember you need to make the call from another origin (WebWolf can help here) and you need to be logged in into WebGoat.

주의할 사항이 있는데, 당신은 WebGoat 밖의 영역에서 요청 메시지를 발생시켜야 한다는 점(WebWolf가 도움이 될 수 있음.)과 그리고 WebGoat에는 로그인 중인 상태여야 한다는 점이다.

the clue of WebGoat write up(Cross-Site Request Forgeries 7 CSRF and content-type)

I used a commercial email for presentation. Add 'enctype="text/plain"' and insert JSON data in the "name" attribute part as above. Then, send it to the opponent, so you will see the "Connect" button. Clicking on it will generate a request message.

연출을 위해 상용 이메일을 사용하였다. 위와 같이 'enctype="text/plain"'을 추가하고 "name" 어트리뷰트 부분에는 JSON 데이터를 넣는다. 그리고 상대에게 보내면 "접속" 버튼이 보이게 되는데, 이를 클릭하면 요청 메시지가 발생한다.

the result of WebGoat write up(Cross-Site Request Forgeries 7 CSRF and content-type)

WebGoat write up(Cross-Site Request Forgeries 4 Post a review on someone else’s behalf)

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

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

(4) Post a review on someone else’s behalf
(4) 타인을 대신하여 리뷰 등록하기.

The page below simulates a comment/review page. The difference here is that you have to initiate the submission elsewhere as you might with a CSRF attack and like the previous exercise. It’s easier than you think. In most cases, the trickier part is finding somewhere that you want to execute the CSRF attack. The classic example is account/wire transfers in someone’s bank account.

아래는 댓글을 통한 리뷰 페이지를 시뮬레이션 하는 애플리케이션이다. 다만 이전 챌린지에서와 마찬가지로 다른 위치에서 요청을 제출해야 한다. 생각보다 쉬울 수 있다. CSRF 공격에서 까다로운 부분은 공격 대상으로 삼을 표적을 찾는 것이다. 이 공격의 고전적인의 예시로는 타인 계좌에서 자금을 이체하는 것이 있다.

But we’re keeping it simple here. In this case, you just need to trigger a review submission on behalf of the currently logged in user.

하지만 여기서는 공격 원리를 간단한 수준에서만 다루고 있다. 당신은 현재 계정을 이용하여 별도의 위치에서 리뷰를 제출하면 된다.

the clue of WebGoat write up(Cross-Site Request Forgeries 4 Post a review on someone else’s behalf)

When sending e-mail, you can switch to HTML format and configure the contents as shown above. One thing to note is that you should include the "type='hidden'" attribute to hide its appearance and pre-populate the "value" attribute with the content you want to send. Then, when the victim sees it, the part that writing area cannot be seen but the button is visible.

이메일 전송 시 HTML 형식으로 전환하여 위 그림처럼 내용을 구성하면 된다. 주의할 사항은, "type='hidden'" 어트리뷰트를 포함하여 그 모습을 숨기고 "value" 어트리뷰트에 전송할 내용을 미리 채워놓는다는 점이다. 그러면 희생자가 보았을 때 글자 입력 부분은 보이지 않고 버튼만 보이게 된다.

the result of WebGoat write up(Cross-Site Request Forgeries 4 Post a review on someone else’s behalf)

WebGoat write up(Cross-Site Request Forgeries 3 Basic Get CSRF Exercise)

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

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

(3) Basic Get CSRF Exercise
Trigger the form below from an external source while logged in. The response will include a 'flag' (a numeric value).

로그인한 상태에서, 아래의 전송 폼을 외부에서 동작시켜보라. 서버의 응답에는 flag(숫자 정보)가 포함되어 있을 것이다.

the clue of WebGoat write up(Cross-Site Request Forgeries 3 Basic Get CSRF Exercise)

When you check the form "Submit" using the developer tool, you can see where the request is sent(action) and what content is sent along with the parameter(csrf, false) when clicking.

개발자 도구를 이용하여 "Submit"이란 글자의 폼(form)을 확인해보면, 클릭 시 어디로 요청이 전송되는지(action) 그리고 전송 시 어떤 내용이 파라미터로 함께 전송되는지(csrf, false)를 확인할 수 있다.

the result of WebGoat write up(Cross-Site Request Forgeries 3 Basic Get CSRF Exercise)

WebGoat write up(Insecure Deserialization 5 Let’s try)

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

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

(5) Let’s try
The following input box receives a serialized object (a string) and it deserialzes it.

(5) 도전.
아래의 input 박스는 직렬화된 객체(문자열)를 수신 후 그것을 역직렬화한다.

rO0ABXQAVklmIHlvdSBkZXNlcmlhbGl6ZSBtZSBkb3duLCBJIHNoYWxsIGJlY29tZSBtb3JlIHBvd2VyZnVsIHRoYW4geW91IGNhbiBwb3NzaWJseSBpbWFnaW5l


Try to change this serialized object in order to delay the page response for exactly 5 seconds.

정확히 5초 후 서버가 응답하게 만들기 위해 위의 직렬화된 객체를 변경하라.

ysoserial\src\main\java\ysoserial\payloads\util\Gadgets.java
the clue of WebGoat write up(Insecure Deserialization 5 Let’s try)

Instead of calling the method "exec()", I used the way of calling the sleep method that waits for 5 seconds. The system commands entered by the user are ignored, but it is the most obvious way. So, as shown in the picture above, I commented on the existing code and wrote the new code below. One thing to note is that you have to cast "(long)" to the left of the number "5000 (1 millisecond x 5000 = 5 seconds)". The "sleep" method requires a "long" type number of milliseconds as the wait time. And save.

"exec()"라는 메소드를 호출하지 말고, 애초에 5초간 대기하는 메소드를 호출하는 방법을 사용했다. 사용자가 입력한 시스템 명령어는 무시되지만 가장 확실한 방법이다. 그래서 위 그림과 같이 기존의 코드는 주석으로 가리고, 그 아래 새 코드를 입력했다. 주의할 점은 "5000(1/1000초 x 5000 = 5초)"이라는 숫자 좌측에 "(long)"으로 형 변환을 해주어야 한다. "sleep" 메소드는 대기 시간을 long 타입의 밀리 초 숫자만 받기 때문이다. 그리고 저장한다.

the result of WebGoat write up(Insecure Deserialization 5 Let’s try)

May 01, 2019

WebGoat write up(Insecure Login 2 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
Click the "log in" button to send a request containing login credentials of another user. Then, write these credentials into the appropriate fields and submit to confirm. Try using a packet sniffer to intercept the request.

도전
"log in" 버튼을 클릭하여 타인의 로그인 정보가 전송되도록 하라. 그리고 계정 정보를 획득하여 제출하라. 요청 메시지를 인터셉트하기 위해 패킷 스니퍼를 사용하도록 한다.

the clue of WebGoat write up(Insecure Login 2 Let’s try)

The paragraph uses the term like packet sniffer, but it means any software that can collect traffic on the network. Therefore, the developer tool's network tap and burp suite we've been using so far are also in this category.

지문에서는 거창하게 패킷 스니퍼라는 말을 사용하는데, 네트워크상의 트래픽을 수집할 수 있는 소프트웨어라면 모두 포함된다. 그러므로 지금까지 사용해왔던 개발자 도구의 네트워크 탭이나 버프 스위트도 이 범주에 들어간다고 볼 수 있다.

the result of WebGoat write up(Insecure Login 2 Let’s try)

April 20, 2019

WebGoat write up(Missing Function Level Access Control 3 Just Try It)

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

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

Just Try It
As the previous page noted, sometimes apps rely on client controls to control access (obscurity). If you can find items that don’t have visible links, just try them, see what happens. Yes, it can be that simple!

도전.
이전 페이지에서 언급했듯이, 애플리케이션들은 종종 접근통제를 위해 클라이언트 측의 기능에 의존한다(이런 것이 앞서 언급한 모호함). 최선을 다하여 보이지 않는 항목을 찾아보라.

Gathering User Info
Often times, data dumps from vulnerabilities such as sql injection, but they can also come from poor or lacking access control.

유저 정보 수집.
보통은 SQL 인젝션 같은 취약점을 통해 데이터가 유출되지만, 접근통제 미약으로 인해서 유발되기도 한다.

It will likely take multiple steps and multiple attempts to get this one. Pay attention to the comments, leaked info. and you’ll need to guess some. You may need to use another browser/account along the way. Start with the info. you already gathered (hidden menu items) to see if you can pull the list of users and then provide the 'Hash' for your own user account.

정보 탈취에는 많은 단계가 있으며 많은 시도가 요구된다. 주석과 노출된 정보에 집중하다보면 무언가 유추할 수 있을 것이다. 다른 브라우저나 계정을 사용해야할 수도 있다. 이러한 정보를 참고하라. 당신은 숨겨진 메뉴를 찾아봄으로써 정보를 수집했던 경험이 있다. 이제, 당신 계정의 해시 값을 제출하라.

The challenge is to find a hidden function that lacks access control according to the challenge theme. Then I stumbled upon the hidden function like the image below. Assuming one scenario in this regard, The fact that a specific answer arrives after sending without the body contents means that different JSON data are transmitted when each button is clicked, but it is now ambiguous because there is no need to distinguish between different functions because there is no additional function added yet.

챌린지 주제에 맞게 접근통제가 허술한 숨겨진 기능을 찾는 것이 관건이다. 그러다 위 우연히 아래 이미지와 같은 숨겨진 기능을 발견했다. 이와 관련하여 한 가지 시나리오를 추측하자면, 바디 내용을 전송하지 않아도 특정 답변이 온다는 것은, 각 버튼을 클릭 시에 서로 다른 JSON 자료가 전송되는 되는 것을 계획하였으나, 아직 다른 기능이 추가되지 않아서 구분할 필요가 없기에 이러한 애매한 모습이 되었을 수 있다.

the clue of Missing Function Level Access Control 3 Just Try It

the result of Missing Function Level Access Control 3 Just Try It

WebGoat write up(Missing Function Level Access Control 2 Relying on Obscurity)

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

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

Relying on Obscurity
If you are relying on HTML, CSS or javascript to hide links that users don’t normally access. It’s a little older, but there was a case of a network router trying to protect (hide) admin functions with javascript in the UI https://www.wired.com/2009/10/routers-still-vulnerable

모호함에 의존한다는 것.
만약 HTML, CSS, 자바스크립트를 사용하여 사용자가 접근하지 않는(사용자를 위한 메뉴가 아닌 것들) 링크를 숨기고 있다면, 이는 좀 구식이다. 관련하여, 공유기에 기반의 자바스크립트를 이용한 관리자 기능을 숨기려는 사례가 있었다. 하단 링크 참조.

https://www.wired.com/2009/10/routers-still-vulnerable

Finding Hidden Items
There are usually hints to finding functionality the UI does not openly expose in …​
  · HTML or javascript comments
  · Commented out elements
  · Items hidden via css controls/classes

숨겨진 정보 찾기.
UI가 공개하지 않는 기능을 찾기 위해 참고 가능한 힌트.
  · HTML/자바스크립트의 주석.
  · 주석 처리된 엘리먼트.
  · CSS나 클래스를 통해 숨겨졌는지 여부.

Your Mission
Find two menu items not visible in menu below that are or would be of interest to an attacker/malicious user and put the labels for those menu items (there are no links right now in the menus).

도전.
아래에서 두 개의 숨겨진 메뉴를 찾아라. 숨겨진 메뉴들은 공격자가 좋아할만한 것이다. 찾은 후엔 그 결과를 제출하라.

the clue of Missing Function Level Access Control 2 Relying on Obscurity

The hidden menu "Admin" was not displayed by the CSS codes. If you press "Ctrl + Shift + c", you can select the element with the mouse. If you select "Messages" menu, the element is selected.

숨겨진 메뉴 "Admin"은 CSS 설정에 의해 표시되지만 않고 있었다. "Ctrl + Shift + c"를 누르면, 마우스로 엘리먼트를 고를 수 있는데, "Messages"메뉴를 선택하면 해당 엘리먼트가 선택된다.

the result of Missing Function Level Access Control 2 Relying on Obscurity

April 19, 2019

WebGoat write up(Insecure direct object references 5 Playing with the Patterns)

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

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

Playing with the Patterns
이 패턴 가지고 놀기.

View Another Profile
View someone else’s profile by using the alternate path you already used to view your own profile. Use the 'View Profile' button and intercept/modify the request to view another profile. Alternatively, you may also just be able to use a manual GET request with your browser.

타인 프로필 열람.
이전 챌린지에서 직접 객체 참조를 통해 본인의 프로필을 보았던 것처럼, 타인의 프로필을 열람해보라. 이를 위해, 아래의 "View Profile" 버튼을 클릭 후 해당 요청을 인터셉트 및 변조하는 방식을 사용한다. 또는 브라우저에서 수동으로 GET 요청을 보내도 된다.

Edit Another Profile
Older apps may follow different patterns, but RESTful apps (which is what’s going on here) often just change methods (and include a body or not) to perform different functions.

타 계정 프로필 수정.
과거 애플리케이션은 다른 패턴을 따를 것이다. 그러나 RESTful 애플리케이션들(WebGoat 포함)은 단지 메소드만 변경하는 경우가 종종 있다.

Use that knowledge to take the same base request, change its method, path and body (payload) to modify another user’s (Buffalo Bill’s) profile. Change the role to something lower (since higher privilege roles and users are ususally lower numbers). Also change the user’s color to 'red'.

이러한 지식을 활용하여, 동일한 요청 메시지를 바탕으로, 메소드와 경로 그리고 바디를 변경하여 타인(Buffalo Bill)의 프로필을 변경하라. 권한을 더 낮은 등급으로 변경하고(높은 권한으로 변경하면 발각되기 쉽다는 의미로 생각됨.), 해당 계정의 색상을 "red"로 변경하라.

clue of Insecure direct object references 5 Playing with the Patterns

Since the type of data that the server responds to when viewing the profile was JSON, I thought that the server can handle JSON. So I changed the "Content-Type" in the header part to "application/json". And I changed the body part data to JSON type after bringing the names that can be viewed from the data (output) received at the time of accessing the account.

프로필 열람 시 서버가 응답하는 데이터의 형태가 JSON이기에, 이를 취급할 수 있다고 생각하여 헤더 부분의 "Content-Type"을 "application/json"으로 변경하였고, 바디 부분의 데이터는 계정 열람 시 전달 받은 데이터(output)에서 확인할 수 있는 이름들을 그대로 가져와 JSON 형태로 변경하였다.

result of Insecure direct object references 5 Playing with the Patterns