How we Broke PHP, Hacked Pornhub and Earned $20,000 > 자유게시판

본문 바로가기

사이트 내 전체검색

한누비IT

닫기

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

작성일 24-06-01 23:30

페이지 정보

작성자Isidra 조회 15회 댓글 0건

본문

colorado-fall-autumn-colorful-foliage-mountains-landscape-valley-tourism-thumbnail.jpg

360_F_314700448_Ckh3uDxLuKEwPNGHIKF1ZgRwuVStqSft.jpgWe have now discovered two use-after-free vulnerabilities in PHP’s rubbish assortment algorithm. Those vulnerabilities were 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 exit 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've got taken the angle of a sophisticated attacker with the complete intent to get as deep as doable into the system, specializing in one major goal: 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 cases a parameter named "cookie" got unserialized from Post information and afterwards mirrored through Set-Cookie headers. Standard exploitation strategies require so referred to as Property-Oriented-Programming (POP) that contain abusing already current courses with particularly outlined "magic methods" with a purpose to trigger unwanted and malicious code paths.



abdc4e842cb024ef5fe07b124f65cc3b.1.jpgUnfortunately, it was difficult for us to assemble any details about Pornhub’s used frameworks and PHP objects in general. Multiple classes from common frameworks have been tested - all with out success. The core unserializer alone is relatively advanced as it entails more than 1200 traces of code in PHP 5.6. Further, many inside PHP lessons have their own unserialize methods. By supporting structures like objects, arrays, integers, strings and even references it isn't any surprise that PHP’s monitor document reveals a tendency for bugs and reminiscence corruption vulnerabilities. Sadly, there have been no recognized vulnerabilities of such type for newer PHP variations like PHP 5.6 or PHP 7, particularly as a result of unserialize already obtained a whole lot of consideration previously (e.g. phpcodz). Hence, auditing it may be compared to squeezing an already tightly squeezed lemon. Finally, after a lot attention and so many safety fixes its vulnerability potential ought to have been drained out and it needs to be safe, shouldn’t it? To find a solution Dario implemented a fuzzer crafted particularly for fuzzing serialized strings which had been handed to unserialize.



Running the fuzzer with PHP 7 instantly lead to unexpected habits. This conduct was not reproducible when examined towards Pornhub’s server although. Thus, we assumed a PHP 5 model. However, running the fuzzer towards a newer model of PHP 5 simply generated more than 1 TB of logs without any success. Eventually, after placing more and more effort into fuzzing we’ve stumbled upon unexpected habits once more. Several questions needed to be answered: is the difficulty security associated? If so can we only exploit it regionally or also remotely? To further complicate this case the fuzzer did generate non-printable knowledge blobs with sizes of more than 200 KB. An incredible amount of time was vital to research potential points. In spite of everything, we could extract a concise proof of concept of a working reminiscence corruption bug - a so referred to as use-after-free vulnerability! Upon further investigation we discovered that the root trigger could be present in PHP’s garbage assortment algorithm, a part of PHP that is totally unrelated to unserialize.



However, the interplay of both parts occurred only after unserialize had completed its job. Consequently, it was not effectively suited to distant exploitation. After further evaluation, gaining a deeper understanding for the problem’s root causes and a number of arduous work an identical use-after-free vulnerability was found that appeared to be promising for remote exploitation. The excessive sophistication of the discovered PHP bugs and their discovery made it essential to put in writing separate articles. You may read more particulars in Dario’s fuzzing unserialize write-up. In addition, we have now written an article about Breaking PHP’s Garbage Collection and xnxx Unserialize. Even this promising use-after-free vulnerability was significantly tough to exploit. In particular, it involved multiple exploitation phases. 1. The stack and heap (which additionally include any potential consumer-enter) as well as any other writable segments are flagged non-executable (c.f. 2. Even if you're ready to manage the instruction pointer it's essential to know what you wish to execute i.e. you could have a sound tackle of an executable reminiscence section.

댓글목록

등록된 댓글이 없습니다.

Copyright © 소유하신 도메인. All rights reserved.
상단으로