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

본문 바로가기
자유게시판

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

페이지 정보

작성자 Odell Flinders 작성일24-05-29 06:20 조회3회 댓글0건

본문

360_F_314700448_Ckh3uDxLuKEwPNGHIKF1ZgRwuVStqSft.jpgWe have discovered two use-after-free vulnerabilities in PHP’s rubbish assortment algorithm. Those vulnerabilities were remotely exploitable over PHP’s unserialize operate. 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 high rewards on Hackerone caught our attention. That’s why we have taken the perspective of an advanced attacker with the full intent to get as deep as possible into the system, focusing on one important objective: 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 utilization of unserialize on the website. In all instances a parameter named "cookie" bought unserialized from Post knowledge and afterwards mirrored via Set-Cookie headers. Standard exploitation techniques require so referred to as Property-Oriented-Programming (POP) that contain abusing already current lessons with specifically outlined "magic methods" as a way to set off undesirable and malicious code paths.



abdc4e842cb024ef5fe07b124f65cc3b.1.jpgUnfortunately, it was troublesome for us to gather any details about Pornhub’s used frameworks and PHP objects basically. Multiple classes from widespread frameworks have been tested - all with out success. The core unserializer alone is relatively complex as it involves more than 1200 traces of code in PHP 5.6. Further, many inside PHP classes have their very own unserialize methods. By supporting buildings like objects, arrays, integers, strings and even references it is not any shock that PHP’s monitor report reveals a tendency for bugs and reminiscence corruption vulnerabilities. Sadly, there have been no known vulnerabilities of such kind for newer PHP variations like PHP 5.6 or PHP 7, especially as a result of unserialize already bought loads of attention prior to now (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 should have been drained out and it must be safe, shouldn’t it? To search out a solution Dario applied a fuzzer crafted particularly for fuzzing serialized strings which had been passed to unserialize.



Running the fuzzer with PHP 7 immediately result in unexpected habits. This behavior was not reproducible when tested against Pornhub’s server although. Thus, we assumed a PHP 5 model. However, working the fuzzer against a newer version of PHP 5 just generated more than 1 TB of logs with none success. Eventually, after putting increasingly effort into fuzzing we’ve stumbled upon unexpected habits once more. Several questions needed to be answered: is the problem security related? In that case can we solely exploit it domestically or additionally remotely? To further complicate this situation the fuzzer did generate non-printable data blobs with sizes of more than 200 KB. An amazing amount of time was necessary to analyze potential points. In any case, xnxx we may extract a concise proof of idea of a working memory corruption bug - a so known as use-after-free vulnerability! Upon further investigation we discovered that the basis cause could possibly be found in PHP’s garbage assortment algorithm, a component of PHP that is completely 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 additional analysis, gaining a deeper understanding for the problem’s root causes and a lot of exhausting work an identical use-after-free vulnerability was found that appeared to be promising for distant exploitation. The excessive sophistication of the found PHP bugs and their discovery made it necessary to write separate articles. You possibly can read extra particulars in Dario’s fuzzing unserialize write-up. In addition, we have written an article about Breaking PHP’s Garbage Collection and Unserialize. Even this promising use-after-free vulnerability was considerably troublesome to use. Specifically, it involved a number of exploitation stages. 1. The stack and heap (which additionally embody any potential user-enter) in addition to some other writable segments are flagged non-executable (c.f. 2. Even if you are ready to control the instruction pointer you must know what you wish to execute i.e. that you must have a legitimate deal with of an executable reminiscence phase.

pexels-photo-3311505.png?cs=srgbu0026dl=pexels-vazha-meladze-3311505.jpgu0026fm=jpg

댓글목록

등록된 댓글이 없습니다.

회사명 방산포장 주소 서울특별시 중구 을지로 27길 6, 1층
사업자 등록번호 204-26-86274 대표 고광현 전화 02-2264-1339 팩스 02-6442-1337
통신판매업신고번호 제 2014-서울중구-0548호 개인정보 보호책임자 고광현 E-mail bspojang@naver.com 호스팅 사업자카페24(주)
Copyright © 2001-2013 방산포장. All Rights Reserved.

상단으로