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.

How do I replace all the index pages?

Discussion in 'General Discussion' started by saver0, Nov 9, 2006.

  1. saver0

    saver0 Member

    Joined:
    Jul 18, 2003
    Messages:
    18
    Likes Received:
    0
    Trophy Points:
    1
    Hi

    One of my servers got defaced today and the bad news is that the backup drive was attached to the server so the hacker also defaced the backup pages.

    I’m about to do a OS reload (and then secure it etc.) and move all the data from the old drive. Since I do not have any good backup files I was thinking about restoring the sites anyway with the hackers index pages and then replace all the index pages with a index page notifying the user.

    What I want to know is this. What commands do I have to enter to replace all the index.(html htm php) pages in the home directory with my page?

    By the way I use CPanel

    I greatly appreciate any help that you guys can provide.
     
  2. david510

    david510 Well-Known Member

    Joined:
    Aug 22, 2004
    Messages:
    473
    Likes Received:
    0
    Trophy Points:
    16
    I hope you need to replace all the index.html files on every public_html folder with a custon index,html file. For this do the following. Let your custom index.html be in path /home/index.html

    for i in ` cat /etc/userdomains | awk {'print $2'}` ; do cp -pf /home/index.html /home/$i/public_html/index.html ; chown $i.$i /home/$i/public_html/index.html ; done
     
  3. sandboks

    sandboks Registered

    Joined:
    Sep 19, 2003
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    script is still useful

    I used this, it is a brute force replace file for file script, but it also changes the permissions (which are usually taken over or rooted by the kiddie script hacker lowlife $%^&) so that the site user can correct the index page.

    caution: If a site does not contain index.html this script will create it.
    If you want to know what will change, you should run
    `updatedb`
    then `locate index.html` to get a full directory listing of what files will be changed.

    for nonscripters, it works like this...
    you create a replacement page and put it in the /home/ dir - I had about 130 sites, so I made somthing less scary as my new index page,like a 404 page. then copy paste the script into the command line and the terror part of the hack is done.


    good luck
     
Loading...

Share This Page