Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    Member
    Join Date
    May 2004
    Posts
    10

    Default Preventing PHP Injection

    Yo dudes,

    Recently we've been having issues on our CPanel box with people running old or outdated versions of postnuke or similar php applications that have been found to have php injection exploits.

    Of course, I've done all the typical security stuff like mounting temp directories noexec nosuid, blocking user "nobody" from compiling and wgetting, etc, but that doesn't deter these foreign children from hacking these sites and just running perl scripts. Of course, I have a set up in place that checks all the processes running as nobody against a list of whitelisted procs (httpd proftpd, etc) but it still ends up alerting me, sometimes at midnight.

    Is there anything I've missed? I thought about making /usr/bin/perl unexecutable by nobody but I figure that will break all perl CGI on the box.

    Can anyone suggest anything? I can always clean this attack up, but only after it happens. I've taken to chmod 000'ing any vulnerable script as soon as it's exploited as well, so it can't be exploited again. This breaks the users script, of course, but as far as I'm concerned, that's not really my problem :-)


    I'm hoping there's something simple that I missed.

    My unending thanks go out to all of you.

  2. #2
    Member rhenderson's Avatar
    Join Date
    Apr 2005
    Location
    Oklahoma
    Posts
    742

    Default

    We have been using mod_security to stop php injection.
    Regards,
    Randy
    Affordable Web Hosting
    _________________________

  3. #3
    Member dave9000's Avatar
    Join Date
    Apr 2003
    Location
    arkansas
    Posts
    891
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    Mod_security will stop the injections if you set your rules up correctly. There are mutliple sites that have rule sets available for free to use. You just copy them into your mod_security rule set but you will need to check your sites closely to make sure you didnt break some of the pages.

    Here is a relative complete set, We use parts of them as the complete set breaks some of our sites.

    http://www.gotroot.com/tiki-index.ph...security+rules
    Dave Browning
    Intersite Technologies
    Greenbrier Ar
    dave@isitetech.com

Similar Threads & Tags
Similar threads

  1. Code Injection
    By rajguru in forum cPanel and WHM Discussions
    Replies: 6
    Last Post: 07-21-2011, 10:39 AM
  2. Preventing .php.jpg files from being executed
    By canfone in forum Security
    Replies: 1
    Last Post: 04-04-2011, 02:21 PM
  3. SQL Injection
    By nitaish in forum Security
    Replies: 3
    Last Post: 10-03-2008, 06:37 PM
  4. SQL Injection
    By nitaish in forum cPanel and WHM Discussions
    Replies: 3
    Last Post: 10-03-2008, 06:37 PM
  5. javascript injection
    By madan.cpanelnet in forum cPanel and WHM Discussions
    Replies: 3
    Last Post: 03-07-2007, 03:09 PM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube