Creative Solutions Creative Contact Form(原 Sexy Contact Form)<= 0.9.7 - 任意文件上传
| 字段 | 值 |
|---|---|
| CVE | CVE-2014-8739 |
| 严重程度 | 严重 |
| CVSS | 9.8 (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H),NVD 主要评分,NVD 发布于 2020-02-08;EPSS 0.91527(0.99812 百分位),已列入 VKEV |
| 修复版本 | Creative Contact Form for WordPress 1.0.0(更新日志 27/10/2014 “重要:修复安全漏洞!”);Creative Contact Form for Joomla! 2.0.1;捆绑的 jQuery File Upload Plugin PHP Class 为 6.4.4 |
| 类别 | 不受限制的文件上传导致代码执行(CWE-434) |
| 扫描器版本 | 1.0.0 |
| python | 3.8+ 仅标准库,无第三方依赖 |
如果你想要漏洞利用代码,请在此处查找:https://satoshidisk.com/pay/CT5TH9
免费版 Creative Contact Form 附带了原版 blueimp 上传端点,位于
/wp-content/plugins/sexy-contact-form/includes/fileupload/index.php,该端点
以 'accept_file_types' => '/.+$/i' 实例化 UploadHandler,即完全
没有扩展名过滤。因此,单个 multipart POST 请求即可将任意文件
原样写入 includes/fileupload/files/,而直接 GET 该路径
会使 PHP 解释器执行该文件。nuclei 模板通过
两个请求验证了这两部分(max-request: 2、flow: http(1) && http(2)):上传响应
必须返回 200,包含 files 和 delete_url 这两个词,携带
text/plain,并且存储的文件必须回显随机标记。
jQuery File Upload Plugin 6.4.4 for jQuery 中 server/php/UploadHandler.php 存在不受限制的文件上传漏洞,该插件被用于 Creative Solutions Creative Contact Form(原 Sexy Contact Form)1.0.0 之前的 WordPress 版本 和 2.0.1 之前的 Joomla! 版本,允许远程攻击者通过上传带有 PHP 扩展名的 PHP 文件,然后通过直接请求 files/ 中的该文件来执行任意 代码,该漏洞于 2014 年 10 月在野被利用。
0.9.7 的厂商源码(直接从发布的 zip 中读取):
includes/fileupload/index.php 是五行“jQuery File Upload Plugin PHP
Example 5.14”,仅执行 require('UploadHandler.php') 加上
new UploadHandler(),而 UploadHandler.php 是“jQuery File Upload Plugin
PHP Class 6.4.4”。其默认选项为 'param_name' => 'files'、
'upload_dir' => dirname(SCRIPT_FILENAME).'/files/'、
'upload_url' => script_url.'/files/'、'delete_type' => 'DELETE' 以及
宽松的 'accept_file_types' => '/.+$/i',这就是根本原因。
handle_file_upload() 调用 move_uploaded_file(),然后
set_additional_file_properties(),两个固定词即来源于此:
delete_url(script_url + ?file= + name)和 delete_type。
send_content_type_header() 仅在请求的
Accept 值字面包含 application/json 时才返回 application/json,否则返回 text/plain,
这就是模板为普通 Accept: */* 固定 text/plain 的原因。
1.0.0 版本是修复版本:在发布的
归档中,includes/fileupload/index.php 和
includes/fileupload/UploadHandler.php 均被裁剪为 0 字节,因此独立处理器消失,两个探测均不再匹配。
flow: http(1) && http(2) 和 max-request: 2 的行为一致。POST /wp-content/plugins/sexy-contact-form/includes/fileupload/index.php
搭配 Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW
以及一个部件 name="files[]"; filename="{fname}.php"、Content-Type: application/octet-stream,其中包含 <?php echo "{marker}"; ?>。status_code == 200、
contains_all(body, "files","delete_url")、contains(content_type, "text/plain")。fname 是一个 6 字符的小写十六进制名称,marker 是一个 8 字符的小写十六进制
字符串,分别代替 {{rand_base(6)}} 和 {{randstr}};该标记是
请求 2 中唯一的单词匹配器,GET /wp-content/plugins/sexy-contact-form/includes/fileupload/files/{fname}.php。fetch()/post_multipart() 返回 (text, status, content_type, reason),
同时读取 HTTPError 的响应体,以线性退避重试两次
(0.2s/0.4s),超时时间为 30s;响应体使用 errors="replace" 解码。Accept: application/json:否则处理程序会
切换到 Content-type: application/json,导致固定的匹配器
无法命中。无 scheme 的 tagger 主机会获得 http://;一个 12 字符的 md5 token
为每一行生成指纹。# scanner: streamed CSV + optional JSON sidecar
python scanner/CVE-2014-8739/scanner.py urls.txt 8 CVE-2014-8739.csv --json CVE-2014-8739.json
# exploit: result dict + optional CSV/JSON dumps
python exploit/CVE-2014-8739/exploit.py http://target:80 --csv CVE-2014-8739.csv --json CVE-2014-8739.json --verbose
urls.txt 是一个纯文本文件,每行一个目标,# 用于注释。
[*] Creative Contact Form (Sexy Contact Form) CVE-2014-8739 unrestricted file upload scanner
scanner : CVE-2014-8739 v1.0.0
threads : 2 | csv: .scratch/scf/scan.csv | json: .scratch/scf/scan.json
[*] Creative Contact Form (Sexy Contact Form) CVE-2014-8739 unrestricted file upload scanner
[2026-12-03 13:08:05] loaded 1 target(s) from .scratch/scf/urls.txt
[2026-12-03 13:08:05] [1/1] http://127.0.0.1:8140 -> VULNERABLE
[2026-12-03 13:08:05] json sidecar saved: .scratch/scf/scan.json
[2026-12-03 13:08:05] summary: total=1 vulnerable=1 not-vuln=0 errors=0
[2026-12-03 13:08:05] timing : avg=7ms max=7ms wall=0.01s
[2026-12-03 13:08:05] report saved: .scratch/scf/scan.csv
这两个请求对由真实处理器的形态来应答:请求 1 返回
{"files": [{"name": "47c8ae.php", "size": 25, "type": "application/octet-stream", "url": ".../includes/fileupload/files/47c8ae.php", "delete_url": ".../includes/fileupload/index.php?file=47c8ae.php", "delete_type": "DELETE"}]}
并带有 Content-Type: text/plain,请求 2 返回裸标记
b05118a4。在 1.0.0 安装上,两个请求都返回 0 字节文件,
词语匹配器失败,该行保持为未受漏洞影响。
| 列 | 含义 |
|---|---|
| n | 从 1 开始的行号 |
| url | 提供的目标 |
| status | ok(至少一个探测获得真实 HTTP 应答)/ error(没有任何探测获得传输层应答) |
| vulnerable | 判定结果 |
| elapsed_ms | 每个目标的耗时 |
| token | 基于行详情的 12 字符 md5 |
| result_b64 | base64(JSON) 完整详情 |
scanner.py - 仅检测,使用标准库,流式 CSV + JSON 附属文件。README.md - 本文件。DESCRIPTION.md - 更深入的技术说明。../../exploit/CVE-2014-8739/exploit.py - 双请求 POC。| 代码 | 含义 |
|---|---|
| 0 | 至少一个目标产生了真实 HTTP 应答(无论是否受漏洞影响) |
| 2 | 没有任何目标产生任何传输层应答,或 URL 列表为空 |