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

페이지 정보

profile_image
작성자 Drusilla
댓글 0건 조회 22회 작성일 24-05-30 17:27

본문

360_F_314700448_Ckh3uDxLuKEwPNGHIKF1ZgRwuVStqSft.jpgWe have discovered two use-after-free vulnerabilities in PHP’s garbage collection algorithm. Those vulnerabilities had been remotely exploitable over PHP’s unserialize function. 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 text. Pornhub’s bug bounty program and its relatively excessive rewards on Hackerone caught our attention. That’s why we've taken the angle of an advanced attacker with the complete intent to get as deep as possible into the system, focusing on one principal goal: gaining remote code execution capabilities. Thus, we left no stone unturned and attacked what Pornhub is built upon: PHP. After analyzing the platform we rapidly detected the utilization of unserialize on the website. In all circumstances a parameter named "cookie" got unserialized from Post information and afterwards reflected via Set-Cookie headers. Standard exploitation methods require so called Property-Oriented-Programming (POP) that contain abusing already current courses with specifically defined "magic methods" with the intention to set off undesirable and malicious code paths.



abdc4e842cb024ef5fe07b124f65cc3b.1.jpgUnfortunately, it was difficult for us to assemble any details about Pornhub’s used frameworks and PHP objects generally. Multiple lessons from frequent frameworks have been examined - all with out success. The core unserializer alone is comparatively complicated as it involves greater than 1200 strains of code in PHP 5.6. Further, many internal PHP lessons have their very own unserialize methods. By supporting constructions like objects, arrays, integers, strings or even references it is not any surprise that PHP’s observe record exhibits a tendency for bugs and memory corruption vulnerabilities. Sadly, there were no known vulnerabilities of such type for newer PHP variations like PHP 5.6 or PHP 7, particularly because unserialize already bought plenty of attention previously (e.g. phpcodz). Hence, auditing it may be in comparison with squeezing an already tightly squeezed lemon. Finally, after so much consideration and so many safety fixes its vulnerability potential ought to have been drained out and it should be secure, shouldn’t it? To search out a solution Dario implemented a fuzzer crafted specifically for fuzzing serialized strings which were passed to unserialize.



Running the fuzzer with PHP 7 immediately result in unexpected behavior. This habits was not reproducible when tested against Pornhub’s server although. Thus, we assumed a PHP 5 model. However, operating the fuzzer against a newer version of PHP 5 just generated more than 1 TB of logs without any success. Eventually, after placing increasingly effort into fuzzing we’ve stumbled upon unexpected behavior again. Several questions needed to be answered: is the problem security associated? If so can we only exploit it locally or additionally remotely? To further complicate this example the fuzzer did generate non-printable knowledge blobs with sizes of greater than 200 KB. An amazing period of time was needed to analyze potential points. In any case, we may extract a concise proof of idea of a working memory corruption bug - a so known as use-after-free vulnerability! Upon additional investigation we discovered that the foundation trigger could be found in PHP’s garbage assortment algorithm, a part of PHP that is completely unrelated to unserialize.



However, xnxx the interaction of each parts occurred only after unserialize had completed its job. Consequently, it was not nicely fitted to distant exploitation. After additional analysis, gaining a deeper understanding for the problem’s root causes and plenty of laborious work an analogous use-after-free vulnerability was found that seemed to be promising for distant exploitation. The high sophistication of the discovered PHP bugs and their discovery made it essential to put in writing separate articles. You'll be able to read more particulars in Dario’s fuzzing unserialize write-up. As well as, we've written an article about Breaking PHP’s Garbage Collection and Unserialize. Even this promising use-after-free vulnerability was significantly difficult to use. In particular, it involved a number of exploitation phases. 1. The stack and heap (which also include any potential user-enter) as well as any other writable segments are flagged non-executable (c.f. 2. Even in case you are ready to manage the instruction pointer you have to know what you need to execute i.e. it's worthwhile to have a legitimate address of an executable memory phase.

댓글목록

등록된 댓글이 없습니다.