LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 05-01-2007, 01:37 PM   #1
crown_bd
LQ Newbie
 
Registered: Apr 2007
Posts: 6

Rep: Reputation: 0
Unhappy Breaking Linux Security


Dear All,
Good Day. I've a mail server with redhat linux,sendmail & openwebmail. It was running good. But from last few days in every night, somebody login to my server by hiding his user name and password. Only I can see his work from bash_histry. Every time he login, he make some folder, download some file from different web site and install it in my server and run it. Most of them are scanning script and some time he deletes my file and folder. I've already allow only my IP block in hosts.allow file for login. But no result. These situations make me very unsafe.

Is any body here to help me to protect my server from him? This is very urgent for me.

Thanking You all again

With regards,

M. Crown

 
Old 05-01-2007, 01:46 PM   #2
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,696

Rep: Reputation: 232Reputation: 232Reputation: 232
If it's a ssh login, block ssh remote access and use only local console. What means, turn off sshd. If you have more remote login methods, turn them all off. Then start looking into the possible holes. Start from checking user accounts (empty passwords?), then all the services you run.

No matter what, it will probably end with complete reinstall (with data copied to another media, of course).

For references, look into unSpawn's links: http://www.linuxquestions.org/questi...ad.php?t=45261
 
Old 05-01-2007, 02:54 PM   #3
rcase5
Member
 
Registered: Apr 2004
Distribution: Fedora & Debian
Posts: 38

Rep: Reputation: 15
Beefing up security

Sounds like someone's a little lax in their security policies.

Sounds like whoever is getting in is able to use the 'root' account. Start by changing the password to the 'root' account. Make this something not easy to guess. Actually, you should make it something impossible to guess. I would write down random characters, including symbols such as !, $, etc., and then change the password to that. Make it very long (at least 10 characters), and put it in a safe place, then destroy it when (or if) you memorize it.

Next, if you're using telnet to access the system, stop! Anyone can observe what you are doing, including entry of passwords. Use SSH. There is no reason why anyone should need to use Telnet, since there are lots of good SSH clients available, even if you are using Windows ('putty' is a good one, and it's free).

Next, check your sshd_config file. Check the following:
PermitEmptyPasswords no
PermitRootLogin no

NEVER EVER allow someone to directly login as root remotely.

It sounds like someone obviously knows one of your usernames and passwords. At a minimum, you should change the passwords to your user accounts. For extra measure, I would change the usernames as well. Make sure they all have passwords, and they should be passwords that are not easy to guess. Don't be shy about imposing standards on passwords for your users.

Also, make sure they don't have something running on your system that can observe these changes and report these changes to whomever is doing this. You could do all of this and it would all be for not. If you're not sure if something is a legit process, do a 'ps -ef' command and post it here. Someone here should be able to tell if a process if bogus. If something isn't legit, kill it ('kill -9 <processnumber>').

Hope this helps.
 
Old 05-01-2007, 07:56 PM   #4
Capt_Caveman
Senior Member
 
Registered: Mar 2003
Distribution: Fedora
Posts: 3,658

Rep: Reputation: 69
If he's able to delete your files, it's likely that he has gained root access (as pointed out above). Because he has gained root, the attacker has the ability to do whatever he/she likes including replacing system binaries with trojaned versions or putting other backdoors on the system that may be extremely difficult to detect. Unless you have some means of detecting *every* single change on the system (such as a tripwire footprint of the system taken before the compromise), then there is *NO* other way you can be sure that the system is secure. Simply changing the root password or shutting off SSH are absolutely not effective means of securing the system. You need to reformat and reinstall.

That being said, you may want to do some forensics on the system to determine how the attacker gained access to the system (e.g through SSH brute force, web application hole, unpatched service, etc). You may want to start by posting the bash_history info as that may help narrow things down, also could you give a list of the services that were run on the system (SSH, apache, PHP, FTp, etc). However in the end you will need to rebuild the server from trusted media.

Last edited by Capt_Caveman; 05-01-2007 at 07:57 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Securing Linux by breaking it with Damn Vulnerable Linux LXer Syndicated Linux News 0 02-28-2007 03:46 PM
LXer: The Real Point of Unbreakable Linux: Breaking Red Hat LXer Syndicated Linux News 0 02-07-2007 03:21 AM
Breaking up is hard to do... need advice moving to linux wedgea18 Linux - Distributions 11 01-06-2007 02:44 PM
LXer: Linux Users May Be Breaking U.S. Securities Laws LXer Syndicated Linux News 0 01-18-2006 04:16 PM
relocationg ld-linux.so without breaking programs? MaulingMonkey Linux - Software 8 11-16-2003 03:53 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 03:46 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration