prevent host accounts from running (perl , python)

trover

Verified User
Joined
Nov 4, 2015
Messages
76
Hi,

How to prevent host accounts from running perl and python ?

and how to test that ?

Thanks
 
actually i do most of (Basic system security) before this and also i'm using CSF without problem. maybe CSF use perl in other way.

but i need to test online by self to sure our web host users can not use perl and python. (by some code or script or etc ...) is this possible?

Thanks
 
Try this, the last post is an example which you can use in a php script.
https://www.biostars.org/p/45776/

You might find something similar via Google like I did to test python.

Hi,

i test it by doman.com/test.php , and output just a blank page. but I'm not sure this was fine or not.

------
in other way i enable "SSH Access" for one of host accounts and then login to SSH by that user,
and run this test:
Code:
[TestAccount@server1 public_html]$ perl /home/TestAccount/domains/domain.com/public_html/foo.pl
[COLOR=#FF0000]output text ok[/COLOR]

so i change permission to 704 (old was 705) [ (read) instead of (read/execute) ]
and with 704 :
Code:
[TestAccount@server1 public_html]$ perl /home/TestAccount/domains/domain.com/public_html/foo.pl
[COLOR=#ff0000]-bash: /usr/bin/perl: Permission denied[/COLOR]

------

and now,
my main question in this post:
if i change the Permission of (perl, python, wget, curl) to 704
mean:
Code:
chmod 704 /usr/bin/perl /usr/bin/wget /usr/local/bin/wget /usr/local/bin/curl /usr/bin/curl /usr/bin/python
in this case which users affected ? like nginx, apache, clamav ,...
and this can cause any problem in hosting accounts? (for example: when uploading images on host , when downloading update for WordPress , ...)



and about #14 in : http://help.directadmin.com/item.php?id=247
if we use the "nginx_apache" as web-server, we have to run same code which you suggest for apache ? or ?
Code:
chgrp apache /usr/bin/perl /usr/bin/wget /usr/local/bin/wget /usr/local/bin/curl /usr/bin/curl /usr/bin/python
 
Back
Top