关联漏洞
描述
Laravel RCE CVE-2021-3129
介绍
# CVE-2021-3129
Laravel RCE CVE-2021-3129
# 漏洞概述
当Laravel开启了Debug模式时,由于Laravel自带的Ignition 组件对file_get_contents()和file_put_contents()函数的不安全使用,攻击者可以通过发起恶意请求,构造恶意Log文件等方式触发Phar反序列化,最终造成远程代码执行。
# 影响版本
Laravel <= 8.4.2
# 漏洞验证
- 返回 500 证明存在漏洞
```
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¶meters[variableName]=cve20213129¶meters[viewFile]=null
```
# 利用脚本

# 参考
[[CVE-2021-3129]Laravel Debug mode RCE复现 | tyskillの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)
文件快照
[4.0K] /data/pocs/524c6bc7dd40e4df59bcd25f2bfed8568ddf3f24
├── [ 10K] CVE-2021-3129.py
├── [4.0K] gadgetchains
│ └── [4.0K] Laravel
│ └── [4.0K] RCE
│ ├── [4.0K] 1
│ │ ├── [ 509] chain.php
│ │ └── [ 476] gadgets.php
│ ├── [4.0K] 2
│ │ ├── [ 540] chain.php
│ │ └── [ 543] gadgets.php
│ ├── [4.0K] 3
│ │ ├── [ 624] chain.php
│ │ └── [ 585] gadgets.php
│ ├── [4.0K] 4
│ │ ├── [ 531] chain.php
│ │ └── [ 485] gadgets.php
│ ├── [4.0K] 5
│ │ ├── [ 559] chain.php
│ │ └── [1.1K] gadgets.php
│ ├── [4.0K] 6
│ │ ├── [ 709] chain.php
│ │ └── [1.4K] gadgets.php
│ └── [4.0K] 7
│ ├── [ 649] chain.php
│ └── [ 800] gadgets.php
├── [4.0K] img
│ └── [170K] Pasted image 20230311223255.png
├── [4.0K] lib
│ ├── [4.0K] PHPGGC
│ │ ├── [4.0K] Enhancement
│ │ │ ├── [2.0K] ASCIIStrings.php
│ │ │ ├── [ 290] Enhancement.php
│ │ │ ├── [ 513] Enhancements.php
│ │ │ ├── [2.3K] FastDestruct.php
│ │ │ ├── [ 802] PlusNumbers.php
│ │ │ └── [1.4K] Wrapper.php
│ │ ├── [ 69] Exception.php
│ │ ├── [4.0K] GadgetChain
│ │ │ ├── [ 199] FileDelete.php
│ │ │ ├── [ 197] FileRead.php
│ │ │ ├── [ 570] FileWrite.php
│ │ │ ├── [ 135] PHPInfo.php
│ │ │ ├── [4.0K] RCE
│ │ │ │ ├── [ 305] Command.php
│ │ │ │ ├── [ 352] FunctionCall.php
│ │ │ │ └── [ 288] PHPCode.php
│ │ │ ├── [ 190] RCE.php
│ │ │ ├── [ 196] SqlInjection.php
│ │ │ └── [ 201] SSRF.php
│ │ ├── [4.9K] GadgetChain.php
│ │ ├── [ 80] InvalidArgumentsException.php
│ │ └── [4.0K] Phar
│ │ ├── [2.9K] Format.php
│ │ ├── [ 325] Phar.php
│ │ ├── [4.1K] Tar.php
│ │ └── [ 155] Zip.php
│ ├── [ 24K] PHPGGC.php
│ └── [1.1K] test_payload.php
├── [ 212] phpggc
└── [1.2K] README.md
17 directories, 43 files
备注
1. 建议优先通过来源进行访问。
2. 如果因为来源失效或无法访问,请发送邮箱到 f.jinxu#gmail.com 索取本地快照(把 # 换成 @)。
3. 神龙已为您对POC代码进行快照,为了长期维护,请考虑为本地POC付费,感谢您的支持。