Vesta Control Panel - Forum

Community Forum

Skip to content

Advanced search
  • Quick links
    • Main site
    • Github repo
    • Google Search
  • FAQ
  • Login
  • Register
  • Board index Main Section General Discussion
  • Search

How To Secure from Backdoor Script?

General questions about VestaCP
Post Reply
  • Print view
Advanced search
13 posts
  • 1
  • 2
  • Next
sllz
Posts: 8
Joined: Wed Jan 28, 2015 11:01 pm

How To Secure from Backdoor Script?
  • Quote

Post by sllz » Fri Jan 30, 2015 9:43 pm

I test the hxxp://code.google.com/p/b374k-shell/ and it goes perfect to read all the data on the server. How to secure the server from the jumping directory caused by backdoor?
Top

cagatay
Posts: 119
Joined: Wed May 28, 2014 6:40 am

Re: How To Secure from Backdoor Script?
  • Quote

Post by cagatay » Sat Jan 31, 2015 5:07 am

what do you mean by all data?

can you browse other users folders?
Top

cagatay
Posts: 119
Joined: Wed May 28, 2014 6:40 am

Re: How To Secure from Backdoor Script?
  • Quote

Post by cagatay » Sat Jan 31, 2015 5:11 am

jesus christ monkey balls !!! yes it does browse whole server lol lol hahhahaha

https://code.google.com/p/b374k-shell/ give it a try
Top

cagatay
Posts: 119
Joined: Wed May 28, 2014 6:40 am

Re: How To Secure from Backdoor Script?
  • Quote

Post by cagatay » Sat Jan 31, 2015 5:55 am

I tested it in cpanel (latest version) the environment is isolated.

old version of cpanel is more vulnerable

but vesta opened all doors widely.

I am shocked. If one of my hosting clients want to f#£k me, my ass is wide open.
Top

sllz
Posts: 8
Joined: Wed Jan 28, 2015 11:01 pm

Re: How To Secure from Backdoor Script?
  • Quote

Post by sllz » Sat Jan 31, 2015 6:55 am

cagatay wrote:I tested it in cpanel (latest version) the environment is isolated.

old version of cpanel is more vulnerable

but vesta opened all doors widely.

I am shocked. If one of my hosting clients want to f#£k me, my ass is wide open.
Yes, it's like a ghost that overshadow.. I'm also thinking if I was wrong in editing the script and someone can upload this can be bad.

Please vestacp team action as soon as possible!
Top

skurudo
VestaCP Team
Posts: 8099
Joined: Fri Dec 26, 2014 2:23 pm
Contact:
Contact skurudo
Website Facebook Google+ Skype
Twitter

Re: How To Secure from Backdoor Script?
  • Quote

Post by skurudo » Sat Jan 31, 2015 10:19 am

There is a way. I just download and tested this shell. It's ordinary shell script, this script can't even win to openbasedir and mod_ruid. So, you understand, for security reason better use these apache2 settings. And simple logic one user = one site.

Apache Template - basedir
Nginx - hosting

Example of apache2 config for domain:

Code: Select all


<VirtualHost ip:8080>
    ServerName mydomain.su
    ServerAlias www.mydomain.su mydomain-su.erza.ru
    ServerAdmin [email protected]
    DocumentRoot /home/mydomain/web/mydomain.su/public_html
    ScriptAlias /cgi-bin/ /home/mydomain/web/mydomain.su/cgi-bin/
    Alias /vstats/ /home/mydomain/web/mydomain.su/stats/
    Alias /error/ /home/mydomain/web/mydomain.su/document_errors/
    #SuexecUserGroup mydomain mydomain
    CustomLog /var/log/apache2/domains/mydomain.su.bytes bytes
    CustomLog /var/log/apache2/domains/mydomain.su.log combined
    ErrorLog /var/log/apache2/domains/mydomain.su.error.log
    <Directory /home/mydomain/web/mydomain.su/public_html>
        AllowOverride All
        Options +Includes -Indexes +ExecCGI
php_admin_value open_basedir /home/mydomain/web/mydomain.su/public_html:/home/mydomain/tmp
php_admin_value upload_tmp_dir /home/mydomain/tmp
php_admin_value session.save_path /home/mydomain/tmp
    </Directory>
    <Directory /home/mydomain/web/mydomain.su/stats>
        AllowOverride All
    </Directory>

    <IfModule mod_ruid2.c>
        RMode config
        RUidGid mydomain mydomain
        RGroups www-data
    </IfModule>
    <IfModule itk.c>
        AssignUserID mydomain mydomain
    </IfModule>

    Include /home/mydomain/conf/web/apache2.mydomain.su.conf*

</VirtualHost>
Top

cagatay
Posts: 119
Joined: Wed May 28, 2014 6:40 am

Re: How To Secure from Backdoor Script?
  • Quote

Post by cagatay » Sat Jan 31, 2015 8:08 pm

skurudo wrote:There is a way. I just download and tested this shell. It's ordinary shell script, this script can't even win to openbasedir and mod_ruid. So, you understand, for security reason better use these apache2 settings. And simple logic one user = one site.

Apache Template - basedir
Nginx - hosting

Example of apache2 config for domain:

Code: Select all


<VirtualHost ip:8080>
    ServerName mydomain.su
    ServerAlias www.mydomain.su mydomain-su.erza.ru
    ServerAdmin [email protected]
    DocumentRoot /home/mydomain/web/mydomain.su/public_html
    ScriptAlias /cgi-bin/ /home/mydomain/web/mydomain.su/cgi-bin/
    Alias /vstats/ /home/mydomain/web/mydomain.su/stats/
    Alias /error/ /home/mydomain/web/mydomain.su/document_errors/
    #SuexecUserGroup mydomain mydomain
    CustomLog /var/log/apache2/domains/mydomain.su.bytes bytes
    CustomLog /var/log/apache2/domains/mydomain.su.log combined
    ErrorLog /var/log/apache2/domains/mydomain.su.error.log
    <Directory /home/mydomain/web/mydomain.su/public_html>
        AllowOverride All
        Options +Includes -Indexes +ExecCGI
php_admin_value open_basedir /home/mydomain/web/mydomain.su/public_html:/home/mydomain/tmp
php_admin_value upload_tmp_dir /home/mydomain/tmp
php_admin_value session.save_path /home/mydomain/tmp
    </Directory>
    <Directory /home/mydomain/web/mydomain.su/stats>
        AllowOverride All
    </Directory>

    <IfModule mod_ruid2.c>
        RMode config
        RUidGid mydomain mydomain
        RGroups www-data
    </IfModule>
    <IfModule itk.c>
        AssignUserID mydomain mydomain
    </IfModule>

    Include /home/mydomain/conf/web/apache2.mydomain.su.conf*

</VirtualHost>
I can browse other users' files, not just the user folders created under my account. whole server is open.

No response from vesta team...
Top

skurudo
VestaCP Team
Posts: 8099
Joined: Fri Dec 26, 2014 2:23 pm
Contact:
Contact skurudo
Website Facebook Google+ Skype
Twitter

Re: How To Secure from Backdoor Script?
  • Quote

Post by skurudo » Sat Jan 31, 2015 8:20 pm

Wait what? It's not correct open basedir.

Rewrite a bit templates and rebuild web:

Code: Select all

php_admin_value open_basedir %docroot%:%home%/%user%/tmp
php_admin_value upload_tmp_dir %home%/%user%/tmp
php_admin_value session.save_path %home%/%user%/tmp
http://forum.vestacp.com/viewtopic.php? ... dir#p20079
Top

SCelik

Re: How To Secure from Backdoor Script?
  • Quote

Post by SCelik » Sat Jan 31, 2015 10:35 pm

Why not just block some php functions like exec(), system()? http://php.net/manual/en/ini.core.php#i ... -functions
Top

sllz
Posts: 8
Joined: Wed Jan 28, 2015 11:01 pm

Re: How To Secure from Backdoor Script?
  • Quote

Post by sllz » Mon Feb 02, 2015 1:58 am

skurudo wrote:There is a way. I just download and tested this shell. It's ordinary shell script, this script can't even win to openbasedir and mod_ruid. So, you understand, for security reason better use these apache2 settings. And simple logic one user = one site.

Apache Template - basedir
Nginx - hosting

Example of apache2 config for domain:

Code: Select all


<VirtualHost ip:8080>
    ServerName mydomain.su
    ServerAlias www.mydomain.su mydomain-su.erza.ru
    ServerAdmin [email protected]
    DocumentRoot /home/mydomain/web/mydomain.su/public_html
    ScriptAlias /cgi-bin/ /home/mydomain/web/mydomain.su/cgi-bin/
    Alias /vstats/ /home/mydomain/web/mydomain.su/stats/
    Alias /error/ /home/mydomain/web/mydomain.su/document_errors/
    #SuexecUserGroup mydomain mydomain
    CustomLog /var/log/apache2/domains/mydomain.su.bytes bytes
    CustomLog /var/log/apache2/domains/mydomain.su.log combined
    ErrorLog /var/log/apache2/domains/mydomain.su.error.log
    <Directory /home/mydomain/web/mydomain.su/public_html>
        AllowOverride All
        Options +Includes -Indexes +ExecCGI
php_admin_value open_basedir /home/mydomain/web/mydomain.su/public_html:/home/mydomain/tmp
php_admin_value upload_tmp_dir /home/mydomain/tmp
php_admin_value session.save_path /home/mydomain/tmp
    </Directory>
    <Directory /home/mydomain/web/mydomain.su/stats>
        AllowOverride All
    </Directory>

    <IfModule mod_ruid2.c>
        RMode config
        RUidGid mydomain mydomain
        RGroups www-data
    </IfModule>
    <IfModule itk.c>
        AssignUserID mydomain mydomain
    </IfModule>

    Include /home/mydomain/conf/web/apache2.mydomain.su.conf*

</VirtualHost>
I'm using the default settings VestaCP. What should I change if it is to avoid evil script like this. Please explain more details on each step because I am very beginner.
Top


Post Reply
  • Print view

13 posts
  • 1
  • 2
  • Next

Return to “General Discussion”



  • Board index
  • All times are UTC
  • Delete all board cookies
  • The team
Powered by phpBB® Forum Software © phpBB Limited
*Original Author: Brad Veryard
*Updated to 3.2 by MannixMD
 

 

Login  •  Register

I forgot my password