본문 바로가기

Web Hacking/Wargame

(115)
portswigger : Modifying serialized data types 문제 링크https://portswigger.net/web-security/deserialization/exploiting/lab-deserialization-modifying-serialized-data-types Lab: Modifying serialized data types | Web Security AcademyThis lab uses a serialization-based session mechanism and is vulnerable to authentication bypass as a result. To solve the lab, edit the serialized object ...portswigger.net 풀이 이전 문제와 같이, wiener 계정으로 로그인 시, 세션이 생성되며, b..
portswigger : Modifying serialized objects 문제 링크https://portswigger.net/web-security/deserialization/exploiting/lab-deserialization-modifying-serialized-objects Lab: Modifying serialized objects | Web Security AcademyThis lab uses a serialization-based session mechanism and is vulnerable to privilege escalation as a result. To solve the lab, edit the serialized object in ...portswigger.net  풀이 wiener 계정으로 로그인 시, 위 그림 1과 같이 세션이 생성된다.   해당..
portswigger : Information disclosure in error messages 문제 링크https://portswigger.net/web-security/information-disclosure/exploiting/lab-infoleak-in-error-messages Lab: Information disclosure in error messages | Web Security AcademyThis lab's verbose error messages reveal that it is using a vulnerable version of a third-party framework. To solve the lab, obtain and submit the version ...portswigger.net  풀이  오류 메시지를 통해 프레임워크의 버전을 알아내는 문제이다.   원래 파라미터 p..
Lab: Modifying serialized objects Write Up → 해당 Lab에서는 직렬화 기반 세션 메커니즘을 사용하며, 권한 상승에 취약하다. 실습해결을 위해 세션 쿠키에서 직렬화된 객체를 편집하여 권리자 권한을 얻도록 한다.  주어진 wiener 계정으로 로그인 시, 아래 그림 1과 같은 세션쿠키를 갖게 된다.   해당 쿠키를 base64 디코딩하면, 직렬화된 객체가 어떤 속성을 가지는지 확인할 수 있다. 그 중 admin 속성에 대한 부울 값이 false( 0 ) 인것이 눈에 띈다. 그러므로 이를 1로 바꿔보도록 한다.  O:4:"User":2:{s:8:"username";s:6:"wiener";s:5:"admin";b:1;}%3d 위를 base64 encoding 적용하여, 세션 쿠키에 대입하면, admin의 권한으로 carlos 계정을 삭..
Lab : Remote code execution via server-side prototype pollution Write Up burp suite의 server side prototype pollution scanner를 사용해보았다. 그 결과는 아래와 같다.   위 메시지를 읽어보면, JSON Body에  prototype pollution source가 존재함을 알 수 있다. status override, json spaces를 이용해 prototype pollution 악용이 가능함을 확인한다.   위 그림 2와 같은 속성 추가를 통해 RCE가 가능함을 확인하도록 한다. 위 curl 뒤의 주소는 본인의 웹 주소를 하면 되나, 현재 Lab에서는 방화벽이 이를 막아 Burp Collaborator만을 사용해야 한다.  일반적으로 env 속성은 환경 변수를 저장하는데 사용된다. 위에서는 env 객체에 happy라..
Lab : Bypassing flawed input filters for server-side prototype pollution Write Up 취약한 엔드포인트는 아래와 같다. /my-account/change-address  __proto__ :{"foo":"bar"} 위와 같은 __proto__ 속성을 이용한 prototype pollution은 성공하지 못했다. 그래서 반응이 없는 경우도 있으니, 이전에 배운 반응이 없을 경우의 prototype pollution을 시도했으나 이 또한 실패하였다.  그래서 __proto__ 속성에 대한 filtering이 있을 것이라 생각하였고, 아래와 같은 Bypass들을 시도하였다.   위 그림 1과 같이 __proto__ 에 대한 난독화를 실시하여, Bypass를 시도해보았으나, 실패하였다.   constrcutor를 이용하여, __proto__ 속성을 사용하지 않고, prototyp..
Lab : Detecting server-side prototype pollution without polluted property reflection Write Up 이전 Lab 과 동일하게, 아래 엔드포인트에서 prototye pollution을 exploit할 수 있었다. /my-account/change-address 먼저, 아래와 같이 __proto__ 속성을 통해 객체를 삽입하려 했으나, 응답이 반환되지 않았다. "__proto__": { "foo1":"bar"} 그래서 Charset override 방법을 이용해 해당 Lab을 해결해나가고자 한다 . 위 그림 1과 같이 city property에 대한 값으로 UTF-7 인코딩 한 foo 를 대입해 request 하면, 응답으로 해당 인코딩 된 값이 그대로 반환된다. ( 응답에 foo: bar property가 보이는데, __proto__ 속성을 사용하지 않고 주입했더니 지속적으로 응답 ..
Lab : Privilege escalation via server-side prototype pollution Write Up 취약한 엔드포인트는 아래와 같다. /my-account/change-address  위 엔드 포인트로 요청 시 그림 1과 같이 필드의 데이터가 JSON으로 서버에 전송되어진다. 그리고 서버는 사용자를 나타내는 JSON 개체로 응답한다. prototype pollution에 대한 source를 식별하기위해서 임의 속성이 있는 객체를 __proto__를 통해 추가하였고, 응답으로 삽입된 임의 객체 속성이 프로토 타입 체인을 통해 상속되었음을 알 수 있다.  위 응답을 봤을 때, isAdmin 속성의 값을 변경시켜야 겠다는 추측을 할 수 있다.   위 그림 2와 같이 isAdmin에 대한 속성 값을 true로 변경하여, 프로토 타입 체인에 상속되게 만들어 준다. 이로써 isAdmin 속성의 값..