LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 04-07-2010, 07:23 AM   #16
Hangdog42
LQ Veteran
 
Registered: Feb 2003
Location: Maryland
Distribution: Slackware
Posts: 7,803
Blog Entries: 1

Rep: Reputation: 422Reputation: 422Reputation: 422Reputation: 422Reputation: 422

Quote:
If you really have no idea how they are getting in, you need to do a clean install and lock down the box as best you know how.
With all due respect, that is the wrong way to go about this. This apparently has already happened twice and unless the OP takes the time to figure out why, it will keep happening. A clean install might be helpful, but then again they might just be putting the same vulnerabilities in place. Without an investigation, they simply are guessing.
 
3 members found this post helpful.
Click here to see the post LQ members have rated as the most helpful post in this thread.
Old 04-07-2010, 07:53 AM   #17
nonamenobody
Member
 
Registered: Oct 2002
Posts: 138

Rep: Reputation: 22
Quote:
Originally Posted by Hangdog42 View Post
With all due respect, that is the wrong way to go about this. This apparently has already happened twice and unless the OP takes the time to figure out why, it will keep happening. A clean install might be helpful, but then again they might just be putting the same vulnerabilities in place. Without an investigation, they simply are guessing.
I see your point, I think I was being a little (or rather, extremely) optimistic. When I said 'lock down the box as best as you know how', I really should have said, 'learn as much as you possibly can about securing Linux and put it into practice'. He needs to take a pro-active approach to security, not just wait vulnerabilities to be exploited and then fix them.

That all said, you are right, the OP needs to find the vulnerability - although I fear that it may prove to be little like searching for a hole in a sieve. Hopefully, just the act of trying to find out how his server was exploited will demonstrate just how insecure it (almost certainly) is.
 
Old 04-07-2010, 10:49 AM   #18
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599
Quote:
Is it possible to elaborate on your actual problem you want to solve rather than asking about this particular solution?
Congratulations! That was the first sane question the thread has seen up to that point. I don't get why it needs to take five posts to get there. Anyone with practical knowledge of GNU/Linux should realize what the OP wants to achieve is not the goal but a symptom of something else.


Quote:
Originally Posted by Hangdog42 View Post
You're looking at the wrong problem. What you need to address is why your server gets cracked repeatedly. Until you start addressing that, everything else is likely useless.
Yes! One hundred percent on the mark! Kludges, changed permissions, in fact every other suggestion directly addressing the OP's question, is just plain wrong.


Quote:
Originally Posted by hansemmanuel View Post
My actual problem is one webserver is hacked..A malicious script ran on that server.
As Hangdog42 already suggested: read that link as it provides you with steps to perform and give us details we can work with.
In the meanwhile:
- verbosely list (and save) processes, open files, network connections and user login records,
- shut down your web stack (web server, database) and any other Internet-facing services you don't need to access the machine (you only need SSH),
- raise your firewall to only allow traffic between your server and your (home, management) IP (or range).
That should at least stabilize things while you get a grip on how to collect "evidence".

Last edited by unSpawn; 04-07-2010 at 10:49 AM. Reason: //more *is* more
 
Old 04-07-2010, 11:26 AM   #19
Simon Bridge
LQ Guru
 
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211

Rep: Reputation: 198Reputation: 198
+1
Hangdog is right.

If it is just that user affected, then you can probably just delete the user (if you are in a hurry) but you must address the security problem.

Note: - something is running rm as a specific user? Has that user installed/run the malware? Why is the whole server dependant on files with user write access?

Last edited by Simon Bridge; 04-07-2010 at 11:33 AM.
 
Old 04-08-2010, 05:34 PM   #20
custangro
Senior Member
 
Registered: Nov 2006
Location: California
Distribution: Fedora , CentOS , RHEL
Posts: 1,979
Blog Entries: 1

Rep: Reputation: 209Reputation: 209Reputation: 209
Quote:
Originally Posted by rhoekstra View Post
This is very tough to do, because this looks like security by obscurity...

say you revoke the rights to execute 'rm' by the chmod commands given.. what prevents me from copying the rm binary to my homedir, giving it execute permissions and then just use that one...
Just to play devils advocate...

But wouldn't root:root 750 perms stop you?

-C
 
Old 04-08-2010, 05:48 PM   #21
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 927Reputation: 927Reputation: 927Reputation: 927Reputation: 927Reputation: 927Reputation: 927Reputation: 927
Quote:
Originally Posted by custangro View Post
Just to play devils advocate...

But wouldn't root:root 750 perms stop you?

-C
But that would stop EVERYONE who's not root; not
what he asked for ;}
 
Old 04-08-2010, 06:11 PM   #22
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599
Let's focus on his cracked machine and what to do with it.

Quote:
Originally Posted by Tinkster View Post
But that would stop EVERYONE who's not root; not
what he asked for ;}
With all due respect but what he asked for, or any discussion that does not address helping him clean up his act, is only distraction at this point. Let's focus on his cracked machine and what to do with it. If anyone however feels it is worth discussing secondary issues I will happily prune off that part of the discussion to a spanking brand new thread. I hope y'all catch my drift wrt priorities and such.
 
Old 04-08-2010, 07:15 PM   #23
custangro
Senior Member
 
Registered: Nov 2006
Location: California
Distribution: Fedora , CentOS , RHEL
Posts: 1,979
Blog Entries: 1

Rep: Reputation: 209Reputation: 209Reputation: 209
Quote:
Originally Posted by unSpawn View Post
With all due respect but what he asked for, or any discussion that does not address helping him clean up his act, is only distraction at this point. Let's focus on his cracked machine and what to do with it. If anyone however feels it is worth discussing secondary issues I will happily prune off that part of the discussion to a spanking brand new thread. I hope y'all catch my drift wrt priorities and such.
It was just a side thought, no need for a new thread.

If it bothers you that much then remove the post.

Quote:
Originally Posted by Tinkster
But that would stop EVERYONE who's not root; not
what he asked for ;}
Ahh you're right

-C
 
Old 04-09-2010, 02:28 AM   #24
hansemmanuel
LQ Newbie
 
Registered: Feb 2010
Posts: 13

Original Poster
Rep: Reputation: 0
Actually now i am planning to improve my security by IDS or a logging s/m
which is the better one logwatch? for IDS snort?
 
Old 04-09-2010, 06:14 AM   #25
salasi
Senior Member
 
Registered: Jul 2007
Location: Directly above centre of the earth, UK
Distribution: SuSE, plus some hopping
Posts: 4,070

Rep: Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897
Quote:
Originally Posted by unSpawn View Post
If anyone however feels it is worth discussing secondary issues...
The problem is that the OP is the one that is directing the discussion towards secondary issues...

Quote:
Actually now i am planning to improve my security by IDS or a logging s/m
Probably a worthwhile additional measure, but its not investigating/fixing the basic security problem (or problems); why are you resisting working on the basic problem?
 
Old 04-09-2010, 07:02 AM   #26
Hangdog42
LQ Veteran
 
Registered: Feb 2003
Location: Maryland
Distribution: Slackware
Posts: 7,803
Blog Entries: 1

Rep: Reputation: 422Reputation: 422Reputation: 422Reputation: 422Reputation: 422
Quote:
Originally Posted by hansemmanuel View Post
Actually now i am planning to improve my security by IDS or a logging s/m
which is the better one logwatch? for IDS snort?
Salasi is right. Unless you're willing to start looking at how you were cracked in the first place, adding logwatch or Snort won't do you any good. Heck, it might even make the situation worse by giving you a false sense of security if you put them on a cracked machine .
 
Old 04-12-2010, 03:17 AM   #27
rhoekstra
Member
 
Registered: Aug 2004
Location: The Netherlands
Distribution: RedHat 2, 3, 4, 5, Fedora, SuSE, Gentoo
Posts: 372

Rep: Reputation: 42
True, on a cracked system your logfiles can't even be trusted..

Don't know what distro you're using, but is SELinux available? This cripples a hacker enormously for not being able to use binaries that are not meant for him to run.. I'd imagine that the 'apache' user is not allowed, within his (SELinux) domain, to remove any files. I would have to dig into the TEs for that, but it'd make sense.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
How to disable a user sasikumar123 Linux - Newbie 2 08-09-2009 01:59 AM
Been Hacked! May I get control of my Root user again? xpucto Linux - Security 4 11-14-2006 07:46 PM
dbx command for corrosponding commands disable or disable on gdb bshankha AIX 0 09-26-2006 09:38 AM
disable user login ust Linux - General 2 04-01-2004 12:06 PM
top command, being hacked? shanenin Linux - Software 4 10-30-2003 08:25 PM

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

All times are GMT -5. The time now is 12:24 PM.

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