Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 15 of 20
  1. #1
    Member
    Join Date
    Apr 2003
    Location
    New Jersey, USA
    Posts
    414

    Default Hacked index pages with hidden keywords - Any idea?

    I've had a few clients on different servers where their index.html had html added to it but is only viewable if you view the page source. They aren't using any other script besides basic html. I have a hard set of mod_sec rules in place from gotroot.

    Any idea how this is being done or anyone have any suggestions?
    eMax Hosting, LLC - Providing Reliable Hosting Services for the past 3 years
    ¨€ cPanel, MySQL, 24/7 Support, Money Back Guarantee, *Free Website Builder*,
    ¨€ Shared Hosting, Reseller Hosting, Dedicated Management, Site Monitoring Services, 97% Client Rating
    ¨€ Have a Sales Questions? Call us toll free at 1-800-770-eMax!

  2. #2
    Member
    Join Date
    Jul 2002
    Location
    Canada
    Posts
    675

    Default

    Probably due to someone modifying user files. you probably have open_base protection off and phpsuexec off? Also what php versions are you running?
    Upload Guardian 2.0 - Sign up for our early beta
    ServerProgress - Server security, consulting and assistance

  3. #3
    Member
    Join Date
    Oct 2002
    Posts
    751

    Default

    Quote Originally Posted by ramprage
    Probably due to someone modifying user files. you probably have open_base protection off and phpsuexec off? Also what php versions are you running?
    Unless the index.html files have world write permissions or are owned by nobody how would one do that even without phpsuexec...

    I believe openbase_dir and safe_mode are easily disabled with the ini_restore exploit for which php hasn't released an update yet.

  4. #4
    Member
    Join Date
    Jan 2005
    Posts
    1,880

    Default

    Quote Originally Posted by XPerties
    I've had a few clients on different servers where their index.html had html added to it but is only viewable if you view the page source. They aren't using any other script besides basic html. I have a hard set of mod_sec rules in place from gotroot.

    Any idea how this is being done or anyone have any suggestions?
    Although I can't quite imagine how, the most likely cause to me would be some form of exploit.

    If the relevant files haven't been modified since they were abused, you might want to try the following:

    1) Check the file modification dates for the affected files
    2) Check your www logs for suspicious-looking requests around the same time

    This, at least, may help you in figuring out if an exploit was the cause.

  5. #5
    Member
    Join Date
    Apr 2003
    Location
    New Jersey, USA
    Posts
    414

    Default

    PHP Version 5.1.6 enabled with phpsuexec and open_basedir enabled for entire server.

    9 out of 10 times the orginal index page is renamed and the new index page has embedded html after the </body></html>.

    For example attached is what was placed in one client index.html file.

    What log files would I search in, domlogs or main apache access logs?
    eMax Hosting, LLC - Providing Reliable Hosting Services for the past 3 years
    ¨€ cPanel, MySQL, 24/7 Support, Money Back Guarantee, *Free Website Builder*,
    ¨€ Shared Hosting, Reseller Hosting, Dedicated Management, Site Monitoring Services, 97% Client Rating
    ¨€ Have a Sales Questions? Call us toll free at 1-800-770-eMax!

  6. #6
    Member
    Join Date
    Oct 2002
    Posts
    751

    Default

    I think you forgot the attachment Can you think of anything the affected accounts have in common? Frontpage extensions? Perhaps also check the cpanel access logs.

  7. #7
    Member
    Join Date
    Apr 2003
    Location
    New Jersey, USA
    Posts
    414

    Default

    Quote Originally Posted by jamesbond
    I think you forgot the attachment Can you think of anything the affected accounts have in common? Frontpage extensions? Perhaps also check the cpanel access logs.

    opps...

    I've tried to find a common between them and havn't so far.
    Attached Files
    eMax Hosting, LLC - Providing Reliable Hosting Services for the past 3 years
    ¨€ cPanel, MySQL, 24/7 Support, Money Back Guarantee, *Free Website Builder*,
    ¨€ Shared Hosting, Reseller Hosting, Dedicated Management, Site Monitoring Services, 97% Client Rating
    ¨€ Have a Sales Questions? Call us toll free at 1-800-770-eMax!

  8. #8
    Member
    Join Date
    Oct 2002
    Posts
    751

    Default

    Well that's a way to increase link popularity, unbelievable. That type of hidden link spamming seems pretty popular lately. I know people had that happen with drupal sites, but I haven't read about static pages being modified this way.

    Did you check the ftp logs also? If it is seemingly random there is a possibility that those clients' computers are infected with a trojan, which the spammers used to get into the account?

    Since those spammers renamed the index files it must show in one of the various logs.

  9. #9
    Super Moderator This forum account has been confirmed by cPanel staff to represent a vendor. chirpy's Avatar
    Join Date
    Jun 2002
    Location
    Go on, have a guess
    Posts
    13,495

    Default

    You should also ensure that you have disabled dynamic library loading in PHP which can be abused to produce the issue you're seeing, in php.ini:

    enable_dl = Off

    Then restart httpd. If you use ioncube you'll have to load that from the main php.ini instead of locally in user accounts.
    Jonathan Michaelson

    Need your cPanel servers secured and tuned?
    cPanel Server Configuration, Security, Recovery and Antivirus/AntiSpam Services
    Developers of the most effective (and free) Firewall & Security Solution for cPanel Servers - csf
    http://www.configserver.com

  10. #10
    Member
    Join Date
    Apr 2003
    Location
    New Jersey, USA
    Posts
    414

    Default

    Quote Originally Posted by chirpy
    You should also ensure that you have disabled dynamic library loading in PHP which can be abused to produce the issue you're seeing, in php.ini:

    enable_dl = Off

    Then restart httpd. If you use ioncube you'll have to load that from the main php.ini instead of locally in user accounts.

    Chirpy,

    We use zend with php and have ioncube off in whm but clients still need ioncube for some scripts which they load from their main account by uploading the encoders. Will I need to load the encoders for clients to use if this is off and I thought zend and ioncube were incompatible to be both loaded at the same time from the server side?
    eMax Hosting, LLC - Providing Reliable Hosting Services for the past 3 years
    ¨€ cPanel, MySQL, 24/7 Support, Money Back Guarantee, *Free Website Builder*,
    ¨€ Shared Hosting, Reseller Hosting, Dedicated Management, Site Monitoring Services, 97% Client Rating
    ¨€ Have a Sales Questions? Call us toll free at 1-800-770-eMax!

  11. #11
    Member
    Join Date
    Jul 2004
    Posts
    102

    Default

    Same happened to me once. I wrote a perl script to automatically scan all html files and remove the content that was inserted by the hacker... I`ll see if I can find it.

  12. #12
    Super Moderator This forum account has been confirmed by cPanel staff to represent a vendor. chirpy's Avatar
    Join Date
    Jun 2002
    Location
    Go on, have a guess
    Posts
    13,495

    Default

    Quote Originally Posted by XPerties
    Chirpy,

    We use zend with php and have ioncube off in whm but clients still need ioncube for some scripts which they load from their main account by uploading the encoders. Will I need to load the encoders for clients to use if this is off and I thought zend and ioncube were incompatible to be both loaded at the same time from the server side?
    The ioncube loader in WHM isn't relevant - that's only for the cPanel PHP, not end-users.

    You will need to install ioncube (it works perfectly find with zend opt) centrally. I use this method:

    Code:
    cd /usr/local/apache
    wget http://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86.tar.gz
    tar -xzf ioncube_loaders_lin_x86.tar.gz
    rm -fv ioncube_loaders_lin_x86.tar.gz
    ls -la ioncube
    pico -w /usr/local/lib/php.ini

    Scroll down to the Dynamic Extensions section and add the line:

    zend_extension="/usr/local/apache/ioncube/xxx"

    Where xxx corresponds to your version of PHP that is installed from the ls output above. For example, for PHP v4.4.* use:

    zend_extension="/usr/local/apache/ioncube/ioncube_loader_lin_4.4.so"

    Exit and save and then check php is showing ioncube in:

    php -v

    Then restart httpd:

    /scripts/restartsrv_httpd
    Jonathan Michaelson

    Need your cPanel servers secured and tuned?
    cPanel Server Configuration, Security, Recovery and Antivirus/AntiSpam Services
    Developers of the most effective (and free) Firewall & Security Solution for cPanel Servers - csf
    http://www.configserver.com

  13. #13
    Member
    Join Date
    Sep 2006
    Posts
    32

    Default

    I have ioincube loaded from main php.ini and client's software still complaining that dynamic loading libraries is turned off.

    Any workaround for dl?

  14. #14
    Super Moderator This forum account has been confirmed by cPanel staff to represent a vendor. chirpy's Avatar
    Join Date
    Jun 2002
    Location
    Go on, have a guess
    Posts
    13,495

    Default

    Make sure they don't have a local php.ini trying to load ioncube in their web tree.
    Jonathan Michaelson

    Need your cPanel servers secured and tuned?
    cPanel Server Configuration, Security, Recovery and Antivirus/AntiSpam Services
    Developers of the most effective (and free) Firewall & Security Solution for cPanel Servers - csf
    http://www.configserver.com

  15. #15
    Member
    Join Date
    May 2006
    Location
    Johannesburg, South Africa
    Posts
    944
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    enabling open_basedir seems to break mod_usersdir (I think it's called)

    Exmaple:

    If you access say http://yourdomain.com/~username1 - you can see his folders, but the moment you enable open_basedir, you get permissions errors.

    So, how does one work around this scenario?
    • cPanel :: Fantastico :: RVSkin :: WHM :: ModernBill
    • Reseller Hosting :: SSL Certificates :: Domain Registrations :: Affiliate Program
    • Blog Hosting :: CMS Hosting :: Forum Hosting :: E-Commerce Hosting
    SoftDux- The Leaders in Software
    Use the coupon: cpanel-06 to get 20% off our packages

Similar Threads & Tags
Similar threads

  1. Got hacked? I have no idea what is going on :/
    By student in forum cPanel and WHM Discussions
    Replies: 6
    Last Post: 06-17-2008, 10:26 AM
  2. Index pages
    By odessa in forum New User Questions
    Replies: 2
    Last Post: 10-02-2007, 01:09 PM
  3. Replies: 4
    Last Post: 05-15-2004, 05:32 AM
  4. Hidden process : hacked???
    By visiondream3 in forum cPanel and WHM Discussions
    Replies: 10
    Last Post: 12-22-2003, 02:15 AM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube