The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Perl Shel

Discussion in 'Security' started by petaglx, Jul 6, 2012.

  1. petaglx

    petaglx Member

    Joined:
    Aug 3, 2011
    Messages:
    16
    Likes Received:
    0
    Trophy Points:
    1
    Hello there,

    I have a security question.

    All we disable some dangerous function in PHP ti avoid running of PHP shells. As cPanel uses perl for all its tasks and al of PHP's dangeros functions have equivalents in perl, so someone can easily port a pho shell to perl and simply run it on the server. Disabling any function in perl will result in cPanel's many parts to stop working.

    How do you manage this security issue? Is it possible to restrict use of these functions in perl to specific users or user groups?

    All the best.
     
  2. nospa

    nospa Well-Known Member

    Joined:
    Apr 23, 2012
    Messages:
    110
    Likes Received:
    0
    Trophy Points:
    16
    cPanel Access Level:
    Reseller Owner
    disable cgi for users, only enable it per request for limited group of users.
     
  3. petaglx

    petaglx Member

    Joined:
    Aug 3, 2011
    Messages:
    16
    Likes Received:
    0
    Trophy Points:
    1
    Hi.

    Isn't it possible to just enable specific functions for specific system users and user groups and keep them disabled for all other users and groups?
     
  4. nospa

    nospa Well-Known Member

    Joined:
    Apr 23, 2012
    Messages:
    110
    Likes Received:
    0
    Trophy Points:
    16
    cPanel Access Level:
    Reseller Owner
    afaik - no. you need to disable cgi. We have done this , because only less than 1% of our users (we manage over 10000 users) need cgi. Other users even did not know what is cgi.
     
  5. d'argo

    d'argo Active Member

    Joined:
    Jul 4, 2012
    Messages:
    36
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    Root Administrator
    Same here. Very few customers use cgi or perl these days, most of the popular applications are php based. So we just disable cgi and restrict the perl binary. So far no one has asked us to enable either.
     
  6. qwerty

    qwerty Well-Known Member

    Joined:
    Jan 21, 2003
    Messages:
    213
    Likes Received:
    0
    Trophy Points:
    16
    how did you disable CGI ? I tried the whm -> modify an account and then uncheck the 'CGI Privilege' option and I am stll able to access a simple test.cgi or test.pl on this account (contents of which just prints hello)
     
  7. nospa

    nospa Well-Known Member

    Joined:
    Apr 23, 2012
    Messages:
    110
    Likes Received:
    0
    Trophy Points:
    16
    cPanel Access Level:
    Reseller Owner
    remove option to create cgi-bin alias in basic settings, then rebuild apache config.
     
  8. qwerty

    qwerty Well-Known Member

    Joined:
    Jan 21, 2003
    Messages:
    213
    Likes Received:
    0
    Trophy Points:
    16
    Thanks I just did those 2 things but now when I visit a .pl it prompts me to download the perl file and allows me to see the full source code which could be a problem if any customer uploads a perl (.pl) script that contains any sensitive details
     
  9. nospa

    nospa Well-Known Member

    Joined:
    Apr 23, 2012
    Messages:
    110
    Likes Received:
    0
    Trophy Points:
    16
    cPanel Access Level:
    Reseller Owner
    Ok, so you need to enable cgi for certain accounts. If your user need perl, just enable it and add custom virtualhost include for only this one user.
     
  10. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    You cannot modify a file trying to download if it has no mime type set or method for the script to execute (when the Apache option to parse the file is removed). If a customer is silly enough to add any script that has sensitive information without checking if the file works and removing it if it doesn't, then that customer probably shouldn't be putting such information online to begin with.
     
Loading...

Share This Page