본문 바로가기

Web Hacking

(128)
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 계정을 삭..
Insecure deserialization 해당 포스팅은 아래 포트스위거의 web-security를 기반으로 진행되었습니다.▶ https://portswigger.net/web-security/deserialization Serialization vs deserialization  직렬화는 객체와 같은 복잡한 데이터 구조를 순차적인 바이트 스트림으로 변환하는 과정이다. 이를 통해 데이터를 파일로 저장하거나 네트워크를 통해 전송할 수 있다. 역직렬화는 직렬화된 바이트 스트림을 원래의 객체로 복원하는 과정이다. 즉, 직렬화의 반대 과정이며, 이 과정을 통해 원래의 데이터 구조와 상태를 되찾을 수 있다. What is insecure deserialization? Insecure deserialization 이란 웹사이트에서 사용자가 제어할 수 있는 ..
Prototype pollution 대응 방안 해당 포스팅은 학습목적이며, PortSwigger의 web-security 를 기반으로 작성되었습니다. ▶https://portswigger.net/web-security/prototype-pollution/preventing  Preventing prototype pollution vulnerabilities exploit 가능한 가젯과 결합되어 있는지 여부에 관계 없이 웹 사이트에서 발견된 프로토타입 오염 취약점은 모두 패치를 적용하는 것이 좋다. 취약점을 놓치지 않았다고 확신하더라도 향후 코드나 사용하는 라이브러리의 업데이트가 새로운 가젯을 도입하여 실행 가능한 익스플로잇의 가능성을 주지 않을 것이라는 보장은 없다. ( 그동안 prototype pollution Lab을 통해 학습한 기법에 대한 조..
Server-side prototype pollution 지난번까지는 Client-side prototype pollution에 대해 학습을 진행했었다. 이번에는 Server-side prototype pollution에 대해 학습해 보도록 한다.  먼저, 해당 포스팅은 아래 포트스위거의 web-security를 기반으로 진행된다.▶ https://portswigger.net/web-security/prototype-pollution/server-side JavaScript는 원래 브라우저에서 실행되도록 설계된 클라이언트 측 언어였지만, Node.js 와 같은 서버 측 런타임의 출현으로 인해 이제 JavScript는 서버,API 및 기타 백엔드 애플리케이션을 구축하는데 널리 사용된다. 논리적으로 이는 프로토타입 오염 취약성이 서버 측 컨텍스트에서 발생될 수도 ..
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라..