How we Broke PHP, Hacked Pornhub and Earned $20,000

페이지 정보

profile_image
작성자
댓글 0건 조회 40회 작성일 24-05-31 02:36

본문

1HccP.jpgWe have now discovered two use-after-free vulnerabilities in PHP’s rubbish collection algorithm. Those vulnerabilities have been remotely exploitable over PHP’s unserialize perform. We were also awarded with $2,000 by the Internet Bug Bounty committee (c.f. Many thanks go out to cutz for co-authoring this article. Pornhub’s bug bounty program and its relatively excessive rewards on Hackerone caught our attention. That’s why we now have taken the perspective of an advanced attacker with the complete intent to get as deep as doable into the system, specializing in one principal objective: gaining remote code execution capabilities. Thus, we left no stone unturned and attacked what Pornhub is built upon: PHP. After analyzing the platform we shortly detected the utilization of unserialize on the website. In all cases a parameter named "cookie" obtained unserialized from Post knowledge and afterwards reflected through Set-Cookie headers. Standard exploitation techniques require so known as Property-Oriented-Programming (POP) that involve abusing already existing courses with specifically defined "magic methods" with a view to trigger undesirable and malicious code paths.



NFVTZ.jpgUnfortunately, it was tough for us to gather any information about Pornhub’s used frameworks and PHP objects typically. Multiple classes from frequent frameworks have been tested - all without success. The core unserializer alone is comparatively complicated as it entails greater than 1200 traces of code in PHP 5.6. Further, many internal PHP classes have their very own unserialize methods. By supporting constructions like objects, arrays, integers, strings or even references it is not any shock that PHP’s track document exhibits a tendency for bugs and reminiscence corruption vulnerabilities. Sadly, there were no recognized vulnerabilities of such kind for newer PHP variations like PHP 5.6 or PHP 7, especially because unserialize already acquired quite a lot of consideration prior to now (e.g. phpcodz). Hence, auditing it may be in comparison with squeezing an already tightly squeezed lemon. Finally, after so much attention and so many safety fixes its vulnerability potential ought to have been drained out and it must be safe, shouldn’t it? To seek out a solution Dario carried out a fuzzer crafted specifically for fuzzing serialized strings which had been passed to unserialize.



Running the fuzzer with PHP 7 immediately result in unexpected behavior. This behavior was not reproducible when examined against Pornhub’s server although. Thus, we assumed a PHP 5 version. However, working the fuzzer against a newer version of PHP 5 simply generated greater than 1 TB of logs with none success. Eventually, after putting increasingly more effort into fuzzing we’ve stumbled upon unexpected conduct once more. Several questions had to be answered: is the issue safety associated? In that case can we solely exploit it locally or additionally remotely? To additional complicate this example the fuzzer did generate non-printable knowledge blobs with sizes of more than 200 KB. A tremendous period of time was obligatory to investigate potential issues. In spite of everything, we may extract a concise proof of concept of a working reminiscence corruption bug - a so known as use-after-free vulnerability! Upon further investigation we found that the basis cause could possibly be present in PHP’s rubbish assortment algorithm, a part of PHP that is totally unrelated to unserialize.



However, the interplay of both parts occurred solely after unserialize had finished its job. Consequently, it was not properly suited for remote exploitation. After further analysis, gaining a deeper understanding for the problem’s root causes and loads of onerous work a similar use-after-free vulnerability was found that gave the impression to be promising for distant exploitation. The high sophistication of the discovered PHP bugs and their discovery made it needed to write separate articles. You'll be able to read extra particulars in Dario’s fuzzing unserialize write-up. In addition, we've written an article about Breaking PHP’s Garbage Collection and Unserialize. Even this promising use-after-free vulnerability was significantly difficult to take advantage of. Specifically, it concerned multiple exploitation levels. 1. The stack and heap (which also include any potential consumer-input) as well as another writable segments are flagged non-executable (c.f. 2. Even if you are able to regulate the instruction pointer you'll want to know what you need to execute i.e. you must have a sound deal with of an executable reminiscence phase.

xnxx-1_orig.jpg

댓글목록

등록된 댓글이 없습니다.

회원로그인

회원가입