Results 1 to 12 of 12
  1. #1

    Server is running a Dos attack

    Hi

    I have a client whose hosting company complain his server is running a DoS attack - the evidence given indicates a DoS on an IBM IP but presumably the target could change?

    (a) anyone aware of this specific DoS attack?
    (b) client had allowed root access via ssh and there are a number of attempts to access the root account over ssh. This has now been stopped.
    (c) client has not installed rkhunter, tripwire or any other intrusion detection software. I installed rkhunter and ran w/out initialising it's db to find out if any rootkits around but it didn't detect any.

    So I'm left with running wireshark on the interface.

    It's a Centos 5.5 box so what other methods can I use to detect what is controlling/initiating/running the DoS attack?

    Do I have to consider this server compromised and re-image?
    To me that's the safest bet but there's a lot on there and I would prefer to know where that attack is originating from on the server e.g. at least tie it down to a script or scripts.

    Looking forward to your replies.

    (Sorry if this is the wrong place to discuss this.)

    Kind regards

    Lesley

  2. #2
    This is in the wrong forum, should have been in dedicated I think, Mods will most likely move it.

    To answer your question, yes if the server was compromised enough to DoS then it's probably too damaged to fix so your safest bet is a reinstall and restore backups (inspect the backups for compromised files too) and then to secure the server with a proper firewall and security to prevent it happening again.

    SSH access in itself isn't bad if it's jailed properly, preferably cloud linux with cagefs and just keep an eye on who has access and what they are doing with it.
    Tara Roberts
    www.whmxtra.com

  3. #3
    Join Date
    Feb 2005
    Location
    Australia
    Posts
    5,842
    Moved to Hosting Security and Technology

    I wouldn't consider it a lost cause yet - from what you say it could be just a compromised website. Look for perl scripts in /tmp and any upload directories, or any changes to .php files.

    If you need expert help you may want to put in a request on the Systems Management Requests forum.

    Quote Originally Posted by lesley View Post
    there are a number of attempts to access the root account over ssh.
    That's normal for any machine running SSH on port 22. Provided they didn't use a weak password such attempts are unlikely to succeed.
    Chris

    "Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them." - Laurence J. Peter

  4. #4
    Join Date
    May 2012
    Location
    India
    Posts
    1,026
    yep, it should be a site (or multiple) hacked and being used as a source of DOS. You would need to check the network logs live (/var/log/messages if Cpanel and CSF) and the processes currently running to see which user causing that. Do a 'lsof <PID>' and find the folder/files responsible and check from there.

  5. #5
    Quote Originally Posted by kevincheri View Post
    yep, it should be a site (or multiple) hacked and being used as a source of DOS. You would need to check the network logs live (/var/log/messages if Cpanel and CSF) and the processes currently running to see which user causing that. Do a 'lsof <PID>' and find the folder/files responsible and check from there.

    that's lsof -p <PID> (i like -np though)

    but do follow what this guy is saying. it's literally as simple as just finding the process and any breadcrumbs it leaves behind. typically they will curl/wget a file and then delete it after it's launched as a proc. but it should give you some insight with timestamps and a case of the "well that just doesn't look right". match up the malicious content with timestamps in your access logs and of course check any outdated CMS software and assocaited plugins, themes, and other addons.

    kill the processes and directly follow it up with a ps faux to see if it continues to come back. usually you'll see the code used to download the content to your server. if not, there is always our good friend grep and digging through eval(base64_decode and {eval(stripslashes returns. these are what i typically see as for how DoS content makes it way onto your server. other than the obvious vulnerabilities or compromised accounts that allowed the initial files to make their way in. but those are typically easy enough to find unless the logs have been rotated or wiped.
    Last edited by grapenut; 01-15-2014 at 03:14 PM.

  6. #6
    Join Date
    May 2012
    Location
    India
    Posts
    1,026

  7. #7
    Join Date
    May 2008
    Location
    Cusco Perú
    Posts
    548
    Quote Originally Posted by lesley View Post
    Hi

    I have a client whose hosting company complain his server is running a DoS attack - the evidence given indicates a DoS on an IBM IP but presumably the target could change?

    (a) anyone aware of this specific DoS attack?
    (b) client had allowed root access via ssh and there are a number of attempts to access the root account over ssh. This has now been stopped.
    (c) client has not installed rkhunter, tripwire or any other intrusion detection software. I installed rkhunter and ran w/out initialising it's db to find out if any rootkits around but it didn't detect any.

    So I'm left with running wireshark on the interface.

    It's a Centos 5.5 box so what other methods can I use to detect what is controlling/initiating/running the DoS attack?

    Do I have to consider this server compromised and re-image?
    To me that's the safest bet but there's a lot on there and I would prefer to know where that attack is originating from on the server e.g. at least tie it down to a script or scripts.

    Looking forward to your replies.

    (Sorry if this is the wrong place to discuss this.)

    Kind regards

    Lesley
    Hi Lesley you can see this Thread:

    http://www.webhostingtalk.com/showth...stmenu_8973985

  8. #8
    Join Date
    Apr 2007
    Location
    US, UK, Europe, ME
    Posts
    258
    Can you make sure that their DNS server is configured properly and recursion is disabled or restricted? Any control panel being used on this server? What about kernel and php versions on this server? I would recommend to review the cronjob logs and search for all .bash_history files and review it all as well as checking all running processes.

  9. #9

    Some progress has been made

    Hi

    I've made *some* progress but I have yet to clear the system entirely.

    I found a screen running as root and a php script exploitx.php running testing for phpmyadmin vulnerabilities. I killed off all the exploitx.php processes and the screen.

    1. The screen was working in the homedir /var/html as root.
    2. The environment was modified to show a reduced history of a few lines.
    3. A file, pma5.tgz, has been uploaded and extracted to the homedir. This contains the exploitx.php script along with a script that modifies the cron on the system.
    4. A file update is called via the script a.
    update existed on the system in these places
    /etc/cron.hourly/update
    /usr/lib/mailman/bin/update
    /root/update
    /update

    of which only the mailman candidate looked okay.

    5. I've discovered that a number of system files have been altered via the script mcelog also existing in /etc/cron.hourly and I now believe the ssh environment to be compromised. The script mcelog isn't deletable and any attempts to chattr result in the word killed being displayed and the attributes not being changed at all.
    e.g.
    lsattr mcelog
    su--ia------- mcelog
    chattr -suia mcelog
    Killed
    lsattr mcelog
    su--ia------- mcelog

    chattr isn't one of the scripts shown as replaced in mcelog.

    There may be lots of compromises on this system and I really do not want to re-image.

    If anyone can comment on this exploit and particularly any advice in handling it I'd be glad to hear it.

    Kind regards

    lesley

  10. #10
    Join Date
    Feb 2005
    Location
    Australia
    Posts
    5,842
    Quote Originally Posted by lesley View Post
    There may be lots of compromises on this system and I really do not want to re-image.
    As you've now established that it's a full root compromise you really have no choice but to re-image. You've found several issues but there may be many more you haven't found. The only question is whether you want to continue investigations to try and find the original entry point.
    Chris

    "Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them." - Laurence J. Peter

  11. #11
    Best option would be reload your server and restore he accounts from backups. Other option is to find out the source of DDOS.

    I would suggest you to install iftop command which would list traffic through each interface and the amount of traffic inbound/outbound from/to specific IP's. Once you get a high traffic IP, you can check the logs to see how they are generated. If the connections are through specific ports, we can block that ports using firewall. Also it is good to scan your machine for any malwares or rootkits using maldet, chkrootkit or rkhunter.

  12. #12

    First of all thank you for the help

    Hi everyone

    Thank you for your help and all the suggestions.

    I have yet to hear back from the client since I told him the server was root compromised and it needed a re-image.

    The problem with using anything from that box at the moment is that it looks like he has changed chattr, ssh, scp, sftp, /bin/bash and /bin/sh and made his replacements undeletable.

    My only option would be to use a tsh or other shell scripting language and upload new copy of chattr to get everything else out the way. I still don't have a clue where the entry took place and I'm assuming in the minimum the hacker is now aware I am on the box.

    The client doesn't have any server maintenance schedule in place or backup schedule in place which doesn't help matters.

    I feel there would be so many security holes to fix a re-image is the only way out. An update might close most holes up but not if the hacker is still able to get in through anything he has put on the system.

    So I think a re-image, immediate intrusion detection and rootkit checks in place plus other hardenings and an extremely careful re-install of data from back-up is the only way of out this.

    Simon: thanks for the tips about iftop and maldet. I'll look at those shortly. I typically use firewalls via iptables, intrusion detection systems and rootkit hunters but wasn't aware of maldet or iftop.

    The hacker is using port 80, shutting that port off is a good idea if nothing more than to get the attention of the client, stop the attacks going out and protect anyone using the e-commerce on there.

    Thanks all once again.

    Kind Regards

    Lesley

Similar Threads

  1. DOS attack on Server
    By abaracadabara in forum Reseller Hosting
    Replies: 26
    Last Post: 10-24-2012, 01:27 PM
  2. Protect your server from DOS Attack.
    By Suvee_@_M6.net in forum Hosting Security and Technology
    Replies: 6
    Last Post: 09-01-2004, 04:30 AM
  3. dos attack from our server
    By sunshines in forum Hosting Security and Technology
    Replies: 3
    Last Post: 06-28-2004, 05:36 PM
  4. DoS attack from my server
    By mzg_z in forum Hosting Security and Technology
    Replies: 23
    Last Post: 03-21-2004, 08:45 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •