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

페이지 정보

profile_image
작성자
댓글 0건 조회 31회 작성일 24-05-31 00:44

본문

2000x2000.8.jpgWe've got found two use-after-free vulnerabilities in PHP’s garbage assortment algorithm. Those vulnerabilities were remotely exploitable over PHP’s unserialize perform. We have been 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 consideration. That’s why we've taken the attitude of an advanced attacker with the full intent to get as deep as attainable into the system, specializing in one primary aim: gaining distant 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 usage of unserialize on the website. In all instances a parameter named "cookie" acquired unserialized from Post knowledge and afterwards reflected by way of Set-Cookie headers. Standard exploitation techniques require so called Property-Oriented-Programming (POP) that involve abusing already existing lessons with particularly outlined "magic methods" as a way to trigger undesirable and malicious code paths.



2000x2000.7.jpgUnfortunately, it was troublesome for us to gather any information about Pornhub’s used frameworks and PHP objects in general. Multiple classes from common frameworks have been tested - all without success. The core unserializer alone is relatively complex as it entails more than 1200 lines of code in PHP 5.6. Further, many internal PHP lessons have their very own unserialize methods. By supporting buildings like objects, arrays, integers, strings or even references it is not any surprise that PHP’s track record shows a tendency for bugs and memory corruption vulnerabilities. Sadly, there have been no identified vulnerabilities of such sort for newer PHP variations like PHP 5.6 or PHP 7, especially because unserialize already obtained lots of attention in the past (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 security fixes its vulnerability potential ought to have been drained out and it should be secure, shouldn’t it? To search out a solution Dario applied a fuzzer crafted specifically for fuzzing serialized strings which had been handed to unserialize.



Running the fuzzer with PHP 7 immediately result in unexpected behavior. This habits was not reproducible when tested in opposition to Pornhub’s server although. Thus, we assumed a PHP 5 model. However, xhamster working the fuzzer in opposition to a newer version of PHP 5 just generated more than 1 TB of logs without any success. Eventually, after putting increasingly effort into fuzzing we’ve stumbled upon unexpected behavior again. Several questions had to be answered: is the problem security associated? If that's the case can we solely exploit it regionally or also remotely? To further complicate this example the fuzzer did generate non-printable information blobs with sizes of greater than 200 KB. A tremendous amount of time was necessary to research potential issues. In any case, we could extract a concise proof of idea of a working memory corruption bug - a so called use-after-free vulnerability! Upon further investigation we discovered that the basis cause may very well be found in PHP’s garbage assortment algorithm, a part of PHP that is totally unrelated to unserialize.



However, the interplay of each elements occurred only after unserialize had finished its job. Consequently, it was not well suited to distant exploitation. After additional evaluation, gaining a deeper understanding for the problem’s root causes and a whole lot of hard work an identical use-after-free vulnerability was discovered that seemed to be promising for remote exploitation. The high sophistication of the found PHP bugs and their discovery made it crucial to write down separate articles. You can learn extra particulars in Dario’s fuzzing unserialize write-up. As well as, we have written an article about Breaking PHP’s Garbage Collection and Unserialize. Even this promising use-after-free vulnerability was considerably troublesome to exploit. In particular, it involved a number of exploitation levels. 1. The stack and heap (which additionally embrace any potential user-input) in addition to some other writable segments are flagged non-executable (c.f. 2. Even if you're in a position to control the instruction pointer you should know what you want to execute i.e. it is advisable have a legitimate deal with of an executable reminiscence phase.

un-video-rubato-di-fallout-appare-su-pornhub-234863-1280x720.jpg

댓글목록

등록된 댓글이 없습니다.

회원로그인

회원가입