Contact

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

페이지 정보

작성자 Elvis 작성일24-01-14 18:31 조회551회 댓글0건

본문


2000x2000.8.jpgWe now have found two use-after-free vulnerabilities in PHP’s rubbish collection algorithm. Those vulnerabilities have been remotely exploitable over PHP’s unserialize function. We had been additionally awarded with $2,000 by the Internet Bug Bounty committee (c.f. Many thanks exit to cutz for co-authoring this article. Pornhub’s bug bounty program and its comparatively high rewards on Hackerone caught our attention. That’s why we've taken the attitude of an advanced attacker with the total intent to get as deep as attainable into the system, focusing on one major 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 shortly detected the utilization of unserialize on the website. In all instances a parameter named "cookie" bought unserialized from Post information and afterwards reflected via Set-Cookie headers. Standard exploitation methods require so called Property-Oriented-Programming (POP) that involve abusing already current lessons with specifically defined "magic methods" with a view to set off undesirable and malicious code paths.



sense8_204_unit_04032_r2.jpgUnfortunately, it was troublesome for us to assemble any details about Pornhub’s used frameworks and PHP objects typically. Multiple courses from common frameworks have been tested - all without success. The core unserializer alone is relatively complex because it entails greater than 1200 traces of code in PHP 5.6. Further, many inner PHP courses have their own unserialize strategies. By supporting constructions like objects, arrays, integers, strings and even references it is no surprise that PHP’s track record reveals a tendency for bugs and memory corruption vulnerabilities. Sadly, there have been no identified vulnerabilities of such type for newer PHP variations like PHP 5.6 or PHP 7, especially because unserialize already obtained a whole lot of attention prior to now (e.g. phpcodz). Hence, auditing it can be compared to squeezing an already tightly squeezed lemon. Finally, after a lot consideration and so many safety fixes its vulnerability potential ought to have been drained out and it needs to be secure, shouldn’t it? To seek out an answer Dario carried out a fuzzer crafted specifically for fuzzing serialized strings which had been handed to unserialize.



Running the fuzzer with PHP 7 instantly result in unexpected habits. This conduct was not reproducible when tested towards Pornhub’s server though. Thus, we assumed a PHP 5 model. However, operating the fuzzer towards 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 once more. Several questions needed to be answered: is the issue safety associated? If that's the case can we only exploit it locally or additionally remotely? To additional complicate this situation the fuzzer did generate non-printable data blobs with sizes of greater than 200 KB. An incredible amount of time was essential to investigate potential issues. In any case, we might extract a concise proof of concept of a working reminiscence corruption bug - a so referred to as use-after-free vulnerability! Upon additional investigation we discovered that the foundation trigger may very well be found in PHP’s garbage collection algorithm, a component of PHP that is totally unrelated to unserialize.



However, the interaction of both components occurred only after unserialize had completed its job. Consequently, it was not nicely fitted to remote exploitation. After additional evaluation, gaining a deeper understanding for the problem’s root causes and a variety of laborious work an analogous use-after-free vulnerability was discovered that seemed to be promising for xhamster remote exploitation. The high sophistication of the found PHP bugs and their discovery made it needed to jot down separate articles. You can read extra details in Dario’s fuzzing unserialize write-up. In addition, we have now written an article about Breaking PHP’s Garbage Collection and Unserialize. Even this promising use-after-free vulnerability was significantly troublesome to exploit. Specifically, it concerned a number of exploitation phases. 1. The stack and heap (which additionally embrace any potential person-enter) as well as some other writable segments are flagged non-executable (c.f. 2. Even in case you are ready to regulate the instruction pointer you need to know what you want to execute i.e. you want to have a legitimate handle of an executable memory phase.

댓글목록

등록된 댓글이 없습니다.