Rapid7 Vulnerability & Exploit Database

PlaySMS index.php Unauthenticated Template Injection Code Execution

Back to Search

PlaySMS index.php Unauthenticated Template Injection Code Execution

Disclosed
02/05/2020
Created
04/03/2020

Description

This module exploits a preauth Server-Side Template Injection vulnerability that leads to remote code execution in PlaySMS before version 1.4.3. This issue is caused by double processing a server-side template with a custom PHP template system called 'TPL' which is used in the PlaySMS template engine at `src/Playsms/Tpl.php:_compile()`. The vulnerability is triggered when an attacker supplied username with a malicious payload is submitted. This malicious payload is then stored in a TPL template which when rendered a second time, results in code execution. The TPL(https://github.com/antonraharja/tpl) template language is vulnerable to PHP code injection. This module was tested against PlaySMS 1.4 on HackTheBox's Forlic Machine.

Author(s)

  • Touhid M.Shaikh <touhidshaikh22@gmail.com>
  • Lucas Rosevear

Platform

PHP

Architectures

php

Development

Module Options

To display the available options, load the module within the Metasploit console and run the commands 'show options' or 'show advanced':

msf > use exploit/multi/http/playsms_template_injection
msf exploit(playsms_template_injection) > show targets
    ...targets...
msf exploit(playsms_template_injection) > set TARGET < target-id >
msf exploit(playsms_template_injection) > show options
    ...show and set options...
msf exploit(playsms_template_injection) > exploit

Time is precious, so I don’t want to do something manually that I can automate. Leveraging the Metasploit Framework when automating any task keeps us from having to re-create the wheel as we can use the existing libraries and focus our efforts where it matters.

– Jim O’Gorman | President, Offensive Security

;