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

페이지 정보

profile_image
작성자 Edmundo
댓글 0건 조회 23회 작성일 24-05-30 16:55

본문

xnxx-apk.jpg

1476741245_PEPPER-PORN_low-res-1200x628.jpgWe've discovered two use-after-free vulnerabilities in PHP’s garbage collection algorithm. Those vulnerabilities had been remotely exploitable over PHP’s unserialize function. We had been 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 comparatively excessive rewards on Hackerone caught our attention. That’s why we've taken the attitude of an advanced attacker with the complete intent to get as deep as potential into the system, specializing in one essential purpose: 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 usage of unserialize on the web site. In all cases a parameter named "cookie" received unserialized from Post information and afterwards reflected by way of Set-Cookie headers. Standard exploitation techniques require so referred to as Property-Oriented-Programming (POP) that contain abusing already current classes with specifically outlined "magic methods" with a purpose to set off unwanted and malicious code paths.



2sSjaI7.jpgUnfortunately, it was difficult for us to gather any details about Pornhub’s used frameworks and PHP objects usually. Multiple courses from common frameworks have been tested - all with out success. The core unserializer alone is relatively complicated as it involves greater than 1200 strains of code in PHP 5.6. Further, many inner PHP classes have their own unserialize strategies. By supporting structures like objects, arrays, integers, strings and even references it isn't any surprise that PHP’s observe report shows a tendency for bugs and reminiscence corruption vulnerabilities. Sadly, there were no recognized vulnerabilities of such kind for newer PHP versions like PHP 5.6 or PHP 7, especially as a result of unserialize already bought a lot of consideration prior to now (e.g. phpcodz). Hence, auditing it can be compared to 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 should be safe, shouldn’t it? To search out a solution Dario carried out a fuzzer crafted specifically for fuzzing serialized strings which were passed to unserialize.



Running the fuzzer with PHP 7 instantly lead to unexpected behavior. This habits was not reproducible when examined towards Pornhub’s server although. Thus, porn we assumed a PHP 5 version. However, working the fuzzer towards a newer version of PHP 5 simply generated greater than 1 TB of logs with none success. Eventually, after placing more and more effort into fuzzing we’ve stumbled upon unexpected behavior again. Several questions needed to be answered: is the difficulty security related? If that's the case can we solely exploit it regionally or additionally remotely? To additional complicate this example the fuzzer did generate non-printable data blobs with sizes of more than 200 KB. A tremendous amount of time was vital to analyze potential points. In spite of everything, we may extract a concise proof of concept of a working memory corruption bug - a so known as use-after-free vulnerability! Upon further investigation we found that the basis trigger could possibly be present in PHP’s rubbish assortment algorithm, a part of PHP that is totally unrelated to unserialize.



However, the interaction of each components occurred only after unserialize had completed its job. Consequently, it was not well suited to remote exploitation. After further analysis, gaining a deeper understanding for the problem’s root causes and loads of hard work the same use-after-free vulnerability was found that appeared to be promising for distant exploitation. The excessive sophistication of the discovered PHP bugs and their discovery made it needed to write down separate articles. You can read more details in Dario’s fuzzing unserialize write-up. As well as, we now have written an article about Breaking PHP’s Garbage Collection and Unserialize. Even this promising use-after-free vulnerability was considerably difficult to use. Particularly, it involved multiple exploitation stages. 1. The stack and heap (which additionally embrace any potential user-enter) in addition to any other writable segments are flagged non-executable (c.f. 2. Even if you're in a position to regulate the instruction pointer you might want to know what you need to execute i.e. you should have a sound tackle of an executable memory phase.

댓글목록

등록된 댓글이 없습니다.