How we Broke PHP, Hacked Pornhub and Earned $20,000 > 계단운반기

본문 바로가기

사이트 내 전체검색

뒤로가기 계단운반기

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

페이지 정보

작성자 Kathrin Horner 작성일 24-05-28 01:42 조회 21 댓글 0

본문

2000x2000.8.jpgWe've got discovered two use-after-free vulnerabilities in PHP’s garbage assortment algorithm. Those vulnerabilities were remotely exploitable over PHP’s unserialize function. We have 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 attitude of an advanced attacker with the total intent to get as deep as doable into the system, focusing on one essential 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 quickly detected the usage of unserialize on the web site. In all cases a parameter named "cookie" bought unserialized from Post information and afterwards mirrored by way of 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 view to trigger unwanted and malicious code paths.



sense8_204_unit_04032_r2.jpgUnfortunately, it was tough for us to collect any details about Pornhub’s used frameworks and PHP objects typically. Multiple courses from common frameworks have been examined - all without success. The core unserializer alone is relatively complex because it involves greater than 1200 strains of code in PHP 5.6. Further, many inner PHP classes have their very own unserialize strategies. By supporting buildings like objects, arrays, integers, strings and even references it is not any surprise that PHP’s monitor report exhibits a tendency for bugs and memory corruption vulnerabilities. Sadly, xhamster there have been no recognized vulnerabilities of such type for newer PHP variations like PHP 5.6 or PHP 7, particularly because unserialize already bought quite a lot of attention previously (e.g. phpcodz). Hence, auditing it may be compared to squeezing an already tightly squeezed lemon. Finally, after so much consideration and so many safety fixes its vulnerability potential ought to have been drained out and it should be secure, shouldn’t it? To find an answer Dario applied a fuzzer crafted specifically for fuzzing serialized strings which were handed to unserialize.



Running the fuzzer with PHP 7 immediately result in unexpected habits. This conduct was not reproducible when tested towards Pornhub’s server although. Thus, we assumed a PHP 5 version. However, working the fuzzer in opposition to a newer version of PHP 5 simply generated greater than 1 TB of logs with none success. Eventually, after putting increasingly effort into fuzzing we’ve stumbled upon unexpected conduct again. Several questions needed to be answered: is the difficulty security associated? In that case can we solely exploit it domestically or additionally remotely? To further complicate this example the fuzzer did generate non-printable knowledge blobs with sizes of greater than 200 KB. An amazing period of time was necessary to research potential issues. In any case, we might extract a concise proof of idea of a working reminiscence corruption bug - a so known as use-after-free vulnerability! Upon additional investigation we discovered that the root trigger may very well be found in PHP’s rubbish collection algorithm, a part of PHP that is totally unrelated to unserialize.



However, the interplay of each components occurred only after unserialize had finished its job. Consequently, it was not effectively suited for distant exploitation. After further analysis, gaining a deeper understanding for the problem’s root causes and plenty of hard work a similar use-after-free vulnerability was found that gave the impression to be promising for remote exploitation. The excessive sophistication of the found PHP bugs and their discovery made it mandatory to write separate articles. You can learn extra 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 troublesome to use. Specifically, it involved multiple exploitation stages. 1. The stack and heap (which also embody any potential consumer-input) as well as another writable segments are flagged non-executable (c.f. 2. Even if you're able to manage the instruction pointer you must know what you need to execute i.e. it's essential to have a sound deal with of an executable reminiscence section.

댓글목록 0

등록된 댓글이 없습니다.

Copyright © 소유하신 도메인. All rights reserved.

사이트 정보

회사명 : 회사명 / 대표 : 대표자명
주소 : OO도 OO시 OO구 OO동 123-45
사업자 등록번호 : 123-45-67890
전화 : 02-123-4567 팩스 : 02-123-4568
통신판매업신고번호 : 제 OO구 - 123호
개인정보관리책임자 : 정보책임자명

PC 버전으로 보기