Hacked!!! What to do next..... read on

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Hacked!!! What to do next..... read on

    Step-by-step site repair

    • Hopefullly, this detailed step-by-step procedure will help focus on the tasks and avoid panic.
    • The concepts apply to any server even though it is Linux, Apache, and cPanel methods that are described in detail.
    • The steps are in order of priority if the evidence you've found so far hasn't already given you a clear idea what things to focus on first.

    The reason these procedures are described in so much detail is so that people who have never done them don't have to go hunting around the web for specifics. If you already know the specifics, you'll see that the steps are much less complicated than they look at first glance, and you can skip the long explanations.
    If you just start at step 1, focus, and dive in, what you learn now will help you manage your site with a lot more confidence in the future. These are all useful things to know how to do. You might even wind up feeling like an expert.
    What not to do

    Don't just repair the damaged files and hope this experience doesn't happen again. That is not enough.
    Nobody is ever supposed to be able to add, delete, or change files in your website without your permission. It should never happen, and it usually doesn't. Most websites don't get hacked. If yours did, there is something wrong with it, or with the server, or with the webhost, or with the security on your PC. You have to figure out how this happened so you can prevent it from happening again.
    Ok, let's get started... The checkboxes don't do anything. You can check them to help keep your place as you go.

    1) Log into cPanel

    Most webhosts provide some kind of control panel such as cPanel or Plesk where you can manage your website's configuration and files. One reason for logging in now is to check for unauthorized logins as described below. The more important reason is to make sure you know how to do it, because several of the later steps are done in control panel.
    If you've never logged into your control panel before now, go to the home page of your webhost's website and look for a customer login box. If there isn't one, look for a FAQ page where they might describe how to access your control panel. If you still find nothing, file a support ticket and ask them.
    In cPanel (and possibly in Plesk), the line that says "Last login from:" should always be your IP address from the last time you logged in. If it isn't, write it down.
    If you don't know your IP address, it appears to be 49.180.121.239, but that could be incorrect if you are viewing an old copy of this page from your browser cache or a search engine cache. You can find your IP address in Windows XP by either of these two methods (you must be connected to the internet at the time you do this):
    • Click on the internet connection icon in your system tray (lower right of screen) . In the dialog box that opens, click the Details tab, and then read the line that says Client IP address.
    • Open a Command Prompt and run the ipconfig program:
      start > Run > cmd
      Type: ipconfig
      Read the line that says IP Address
      Type: exit

    With high-speed (broadband, DSL, cable) internet service, your IP is always the same. With dial-up, it's different each time you log on.
    If someone was able to log in to your control panel (like you do), they have your userID, password, and all the same access to your site that you have. They can probably also get FTP access, which is what they are more likely to use than cPanel. However, before you assume the worst, an unfamiliar IP could be legitimate if your site is at a webhosting company and you recently submitted a support ticket. A technician might have logged into your account while investigating.
    The three pieces of information you should keep from this step are:
    1. How to log in to your control panel.
    2. Your legitimate IP address, so you can recognize IP addresses that are not yours in places where only yours should be.
    3. Suspicious IP addresses you find reported in cPanel.

    Leave cPanel open for the next two steps.

    2) Enable log archiving in cPanel

    Your website access logs keep detailed records of who connects to your site by HTTP (normal visitors) and by FTP (file transfers such as when you publish pages). By default, those logs are deleted every day after the stats run (Webalizer, AWStats, ...). Log archiving forces the logs to be saved. If archiving was already on, the attack is most likely recorded, which will be useful. If it was off, the data is lost unless the daily stats run hasn't been done yet, but subsequent similar attacks, which are likely, will be logged.
    1. Go to cPanel > Raw Log Manager (the name varies in different cPanel versions).
    2. Check the "Archive Logs..." box.
    3. Uncheck the "Remove the previous month's archived logs..." box.
    4. Click Save


    3) Take your website offline

    If your pages have become infected with viruses that will attack your site visitors, which is usually the case, you should protect your visitors, and your reputation, by taking your site offline, which involves adding a few lines to your .htaccess and optionally uploading a file. If you do this right away, you might avoid getting the "This site may harm your computer" warning in Google search results and a similar warning at Yahoo.
    Are you hesitant to take your site offline? Consider this: a visitor who finds your site down will hardly notice the incident and will (or at least might) come back later. A visitor who gets attacked by a virus from your site will develop a strong memory of the incident and probably not come back, ever.
    In addition, it is possible that a script with a security hole was the reason the site got hacked. As long as that script is publicly accessible, the site remains vulnerable, which means it could get hacked again even while you're trying to repair it.
    Lastly, it is possible the attacker installed a backdoor script to let themselves back into the site. Closing the site at least has a chance of locking them out and making it impossible for them to use the backdoor, giving you time to find and delete it.

    4) Notify your web hosting company

    File a support ticket.
    • Tell them what has happened. Give them as much detail as you can about the evidence that the site is compromised.
    • If you have some idea when it happened, or when you first noticed it, tell them.
    • If you found an unknown IP address in cPanel, report it.
    • Give them a secondary email address that is not at your website so your host can still contact you if your site goes down or if the hacker is reading or deleting your website email.
    • Some webhosts will be willing to help you investigate and clean the site. Others won't, but it doesn't hurt to ask if they can help or give advice.
    • If you're on shared hosting, it is possible that the host is aware of other sites on your server that are affected. They probably won't publicize it and might not even tell you, but your report will help them, even if they don't admit it.
    • Also, only your webhost can clean up files outside your webspace that might have been affected.


    5) All site administrators do antivirus, antispyware scans on their PCs

    It is a new development in 2009 that the #1 cause of website hacking is the webmaster's personal computer being infected by malware that steals FTP login information and sends it to remote computers which then inject the victim website's pages with JavaScript or hidden iframes pointing to malicious websites such as gumblar.cn, martuz.cn, and a growing list of others.
    Make sure everyone who has password access to the website does at least one, and preferably two, antivirus and antispyware scans on their local computers, using two different scanners they don't normally use, to find threats that got past the AV scanner they were using. Some free scanners are at: Trend Micro Housecall, Kaspersky, Malwarebytes, Symantec (Norton), BitDefender, Windows Live OneCare, Computer Associates, McAfee, F-Secure.
    As long as the webmaster's PC is infected, changing the password is no use. The new one gets stolen, too.

    6) Change all passwords: cPanel, FTP, databases, email

    After the administrator PCs are free of viruses and spyware, change all the website passwords that you use for control panel, FTP, database connections, email, everything. Use strong passwords. If you have been using a single password for more than one purpose, take this opportunity to make every password different. The linked article explains why this is important.
    a) If the FrontPage Extensions are installed on the site, change your FrontPage password first:

    1. Open your local copy of your site in FrontPage
    2. Click the Remote Web Site tab and log in
    3. Click Open your Remote Web site in FrontPage (this will open a new copy of FrontPage with your remote site in it)
    4. Click Tools > Server > Change Password and follow the instructions. Whenever you get a password prompt during this procedure, it wants the old one. It doesn't want the new one until it asks for it.

    b) Log in to your webhosting account and change your cPanel / FTP passwords there

    In cPanel, look for a "Change Password" icon or link. If you find none, your webhost might provide a separate login location for making password changes, so search their FAQ, forum, or ask customer support.
    If you have scripts that use your cPanel userID/password to open database connections, the password change will cause those scripts to stop working, and you will get connection failure or "Could not connect" errors:
    • If the connection data is hard-coded into the scipts, go through the scripts and change the password in all of them.
    • If your scripts read the connection data from an include (or other) file, change it in that file.
    • Since you're editing the files anyway, a better and more permanent solution is to stop using your cPanel userID/password, create a different user/password just for database connections, put the connection data in one protected include file, and have all your scripts read the data from that file. The procedure for making that change is described below.

    c) Change the passwords you use for database connections

    If your scripts connect to your databases as a user that is not your cPanel userID, the password change will not break your scripts. However, the hacker could have read the connection data for all your MySQL users from your files, so change all those passwords, too:
    1. Go to cPanel > MySQL® Databases > Current Users.
    2. In the list, find the user you want to modify. In shared hosting (and maybe in other environments, too), the username is prefixed with YourUserID_.
    3. In Username: enter the name of the user, but do not enter the prefix or the underscore. Enter only the part after the underscore. If the user is userID_example, then you enter example.
    4. In Password: enter the new password.
    5. Click Create User.
    6. The confirmation screen will tell you that the user was created with the new password.
    7. When you return to the MySQL Account Maintenance screen, you'll see that you have not really added a user, but only replaced the old one's password, and that this user still has the same privileges in the same databases that it had previously. You will also see that cPanel has automatically added the userID_ prefix to the username.
    8. Now change all your scripts to use the new passwords. See the bullet points in section b) above.

    d) Change the passwords for all your email accounts

    1. Go to: cPanel > Mail > Add/Remove/Manage Accounts.
    2. Set a new password for each account.
    3. If you access your email with a POP or IMAP email client such as Microsoft Outlook, change its configuration settings so it knows the correct new password for each account.


    7) Upgrade all third party scripts to latest versions

    Make a list of all the scripts you use. For each, if you are not using the latest version, upgrade now.
    Follow links in the table below to find latest version information for some common scripts, and to view the latest security advisories at Secunia.com. The Secunia page often lists vulnerabilities found in plug-ins or add-ons. Check those, too. If there is a recent security advisory for a script you use that is outdated, there is a good chance you've found the reason your site was hacked.









    Dont Ask Me Dumb Questions.Or you'l get a Dumb Answer..
    Want A Profesional Logo or Theme For Your wap site Pm Me.If I Have The Time Ill Make It For Free

Working...
X