LinuxQuestions.org
Help answer threads with 0 replies.
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-04-2009, 10:06 AM   #1
arfon
Member
 
Registered: Apr 2004
Distribution: Slackware & RHEL
Posts: 382

Rep: Reputation: Disabled
Cleaning up after a root-kit


We have a remote Debian box that was root-kitted.

Is there anyway to remotely rebuild the base install with apt (and NOT use the packages in the archive directory)?

The kit has killed rm, ping and apache (and probably many more commands/apps).
 
Old 05-04-2009, 10:59 AM   #2
Dutch Master
Senior Member
 
Registered: Dec 2005
Posts: 1,686

Rep: Reputation: 124Reputation: 124
First you'd need to figure out how the rootkit entered your box. But the only way to be completely secure is a full re-install using trusted sources. That can't be done remotely I'm afraid, as the base install (net-cd) doesn't give you that option (no ssh or other remote access tools installed by default. Besides, you'd have to reboot anyway...)
 
Old 05-04-2009, 12:51 PM   #3
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,824

Rep: Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615
Nope. Get there physically and reinstall from scratch.
 
Old 05-04-2009, 12:53 PM   #4
XavierP
Moderator
 
Registered: Nov 2002
Location: Kent, England
Distribution: Debian Testing
Posts: 19,192
Blog Entries: 4

Rep: Reputation: 475Reputation: 475Reputation: 475Reputation: 475Reputation: 475
Moved: This thread is more suitable in Linux-Security and has been moved accordingly to help your thread/question get the exposure it deserves.
 
Old 05-06-2009, 10:22 PM   #5
JoeyB
LQ Newbie
 
Registered: Aug 2004
Posts: 20

Rep: Reputation: 0
I recommend a fresh install. Been there, and there are too many possibilities of hacks, holes etc that you won't be able to find and could be anywhere on the server. Plus your putting yourself at greater risk if they trash your stuff any more.
 
Old 05-07-2009, 09:17 AM   #6
sarajevo
Member
 
Registered: Apr 2005
Distribution: Debian, OpenBSD,Fedora,RedHat
Posts: 228
Blog Entries: 1

Rep: Reputation: 31
Quote:
Originally Posted by arfon View Post
We have a remote Debian box that was root-kitted.

Is there anyway to remotely rebuild the base install with apt (and NOT use the packages in the archive directory)?

The kit has killed rm, ping and apache (and probably many more commands/apps).
It depends but it is possible :

1. someone should be on site: to enter CD, choose advance installation, and then is option to continue installation using SSH---on site guy do that, send you username/password ( which are showed on screen ) and ip address...log in to machine and that is all

Link ; http://princessleia.com/journal/?p=1357


2. In case you have HP server, some G5 model then ( except some models of 100x series which has not iLO port ) you should have iLO interface...Somone connect you machine to net, in bios set up password for administarator ( or read one which sticked on server ) and you log in,mount your local CD from your laptop, and that is

I am just wondering what you have installed, which debian, which applications, it is unusual for debian server to be rootkit infected,it is possible, but debian is very good OS.
Pay attention on software you install, and how has access to system.

RE

Last edited by sarajevo; 05-07-2009 at 09:19 AM.
 
Old 05-07-2009, 04:40 PM   #7
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by sarajevo View Post
it is unusual for debian server to be rootkit infected,it is possible, but debian is very good OS.
This has nothing to do with Debian but with setup, configuration, maintenance and auditing.

In general anyone suggesting a fresh install without post-mortem is looking in the wrong direction.
 
Old 05-07-2009, 04:48 PM   #8
rweaver
Senior Member
 
Registered: Dec 2008
Location: Louisville, OH
Distribution: Debian, CentOS, Slackware, RHEL, Gentoo
Posts: 1,833

Rep: Reputation: 167Reputation: 167
Quote:
Originally Posted by arfon View Post
We have a remote Debian box that was root-kitted.

Is there anyway to remotely rebuild the base install with apt (and NOT use the packages in the archive directory)?

The kit has killed rm, ping and apache (and probably many more commands/apps).
My first suggestion is to get a clean dd of the entire drive to perform forensics on or you're just going to have another break in... you *need* to know how they got access.

You can do a apt-get clean && apt-get autoclean to wipe out the stuff in the local archive... then you could force a reinstall of each package... but personally I think you'd be far far far further ahead to do a clean reinstall... you can never really trust that server again until you do.

You could install a copy of what you need locally and rsync it over or you could force apt to reinstall packages it already has installed...

Code:
for i in `dpkg -l | cut -f3 -d' '`; do apt-get --force-yes --reinstall install $i; done
Dell, HP, IBM, etc... almost all have some kind of remote access card, you might wanna see if your server has one.

Last edited by rweaver; 05-07-2009 at 04:59 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
cleaning root directory? patolfo Debian 14 08-13-2014 08:36 PM
cannnot run package kit applications as root hakmn Linux - Newbie 5 01-22-2009 06:55 PM
Need Root Kit hunter help Golgo13 Linux - Networking 1 01-16-2008 01:23 PM
Chk Root Kit reported infection DotHQ Linux - Security 5 01-04-2008 03:55 AM
Showtee root kit jimrt Linux - Security 1 03-12-2003 10:34 PM

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

All times are GMT -5. The time now is 04:30 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