# Exploit Title: PlaySMS 1.4 Remote Code Execution using Phonebook import Function in import.php # Date: 21-05-2017 # Software Link: https://playsms.org/download/ # Version: 1.4 # Exploit Author: Touhid M.Shaikh # Contact: http://twitter.com/touhidshaikh22 # Website: http://touhidshaikh.com/ # Category: webapps 1. Description Code Execution using import.php We know import.php accept file and just read content not stored in server. But when we stored payload in our backdoor.csv and upload to phonebook. Its execute our payload and show on next page in field (in NAME,MOBILE,Email,Group COde,Tags) accordingly . In My case i stored my vulnerable code in my backdoor.csv files's Name field . But There is one problem in execution. Its only execute in built function and variable which is used in application. That why the server not execute our payload directly. Now i Use "" in name field and change our user agent to any command which u want to execute command. Bcz it not execute directly . Example of my backdoor.csv file content ----------------------MY FILE CONTENT------------------------------------ Name Mobile Email Group code Tags 22 --------------------MY FILE CONTENT END HERE------------------------------- For More Details : www.touhidshaikh.com/blog/ For Video Demo : https://www.youtube.com/watch?v=KIB9sKQdEwE 2. Proof of Concept Login as regular user (created user using index.php?app=main&inc=core_auth&route=register): Go to : http://127.0.0.1/playsms/index.php?app=main&inc=feature_phonebook&route=import&op=list And Upload my malicious File.(backdoor.csv) and change our User agent. This is Form For Upload Phonebook. ----------------------Form for upload CSV file ----------------------
------------------------------Form ends --------------------------- -------------Read Content and Display Content----------------------- case "import": $fnpb = $_FILES['fnpb']; $fnpb_tmpname = $_FILES['fnpb']['tmp_name']; $content = "* | " . _('Name') . " | " . _('Mobile') . " | " . _('Email') . " | " . _('Group code') . " | " . _('Tags') . " |
---|---|---|---|---|---|
$i. | $contact[0] | $contact[1] | $contact[2] | $contact[3] | $contact[4] |