Bug 33632 - Found rootkit in /rk
Found rootkit in /rk
Status: CLOSED CURRENTRELEASE
Product: Red Hat Linux
Classification: Retired
Component: basesystem (Show other bugs)
6.2
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Bill Nottingham
Aaron Brown
: Security
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2001-03-28 12:36 EST by Tommy Watt
Modified: 2014-03-16 22:20 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2001-04-16 14:24:56 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
the "install" script found in /rk (4.12 KB, text/plain)
2001-03-29 09:05 EST, Tommy Watt
no flags Details
the "tar" file that was included in /rk (740.00 KB, application/octet-stream)
2001-03-29 09:07 EST, Tommy Watt
no flags Details
contents of /var/log (392.63 KB, application/octet-stream)
2001-03-30 09:12 EST, Tommy Watt
no flags Details

  None (edit)
Description Tommy Watt 2001-03-28 12:36:40 EST
From Bugzilla Helper:
User-Agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0; compaq)


I found a root kit in a folder /rk on my system.  My system was completely 
up to date with up2date/RHN.  the files in the folder where: install (a 
script) and ssh.tar.gz
 
I made the stupid mistake of running the install script.  Now my system 
does not accept incoming telnets.  I looked over the script and it looked 
like it replaced a lot of files, like ps and various other things that 
would prevent me from seeing evidence of this thing on my system.  Not 
sure the name of this, but looks like a worm.  
 
Kind of getting tired of reformatting due to a lot of recent worm attacks 
(Ramen worm), finally got that to stop but now this.  
 
Does RedHat have instructions about "hardening" your system to make it 
more secure?  
 
BTW, I was NOT running BIND.  
 
If you need more information, please e-mail me at tommylw@qwest.net
 
Thanks,

Tommy Watt

Reproducible: Didn't try
Comment 1 Bill Nottingham 2001-03-28 12:39:04 EST
If you still have the script around, do you want to attach it?

In any case, general hardening tips include:

- turn off *ALL* services you don't use
- install a firewall
- use encrypted services wherever possible (i.e., not telnet)
Comment 2 Tommy Watt 2001-03-28 13:40:38 EST
I will add attachment when I get home.

As far as hardening RedHat, I already turned off all unneeded services and was 
running a firewall.  As for telnet, this is unavoidable because the purpose of 
my system is to provide a public access BBS via telnet.  How does one break 
into a system via telnet?  I mean, what is it's vulnability? 

Thanks,

Tommy
Comment 3 Bill Nottingham 2001-03-28 15:34:44 EST
With telnet, all the passwords go over the network unencrypted.

Comment 4 Tommy Watt 2001-03-29 09:05:08 EST
Created attachment 14103 [details]
the "install" script found in /rk
Comment 5 Tommy Watt 2001-03-29 09:07:01 EST
Created attachment 14104 [details]
the "tar" file that was included in /rk
Comment 6 Tommy Watt 2001-03-29 09:07:49 EST
I have included the files found in the /rk directory.  

If you need anything else from my system, let me know.
I don't plan on formatting my system until I know I don't have to worry about 
this again.

Tommy
Comment 7 Bill Nottingham 2001-03-29 10:34:32 EST
Do you still have the logs?
Comment 8 Bill Nottingham 2001-03-29 10:35:59 EST
Also, I'm assuming you still have the machine off the net - if you
haven't reformatted it, leaving it public is certainly a bad idea.
Comment 9 Tommy Watt 2001-03-29 10:54:25 EST
I still have the logs but won't beable to get them to you until tommorow 
morning.  If there is anything else you can think of, I will get those too.

I did take my server off the internet, and have made no changes to it.
Comment 10 Tommy Watt 2001-03-29 11:06:48 EST
Also, which exact logs do you want?  Please specify exact filenames or 
directories that you want and I will put them all in a zip file.
Comment 11 Bill Nottingham 2001-03-29 11:11:11 EST
Everything in /var/log.
Comment 12 Tommy Watt 2001-03-30 09:12:52 EST
Created attachment 14224 [details]
contents of /var/log
Comment 13 Tommy Watt 2001-03-30 09:13:40 EST
I attached the /var/log zip file.  Please let me know what you find or if you 
need anything else.

Thanks,

Tommy
Comment 14 Pekka Savola 2001-03-31 11:17:28 EST
Well, someone certainly has been trying rpc.statd exploits on you, at least.
Comment 15 Bill Nottingham 2001-04-01 23:39:48 EDT
True. What is the timestamp on the rootkit and install scripts?

One thing to note is that up until you rebooted on March 21, you were
running the 2.2.14 kernel; there are *definite* local exploits for this
kernel, most involving sendmail. It's entirely possible that a local user
could have compromised the system that way. Was there any evidence of other
changes in the system before you ran the root kit install script (which could
have wiped out other traces...)
Comment 16 Tommy Watt 2001-04-02 09:31:34 EDT
I thought everything was OK before I noticed the /rk folder in root.  When I 
first saw this rk folder, I looked in it and saw "install" and "ssh.tar".  Well 
stupid me thought maybe that this was actually supposed to be there, as if I 
installed a openssh update from RHN, but it still needed to be installed.  So I 
ran it.  And then didn't notice that anything was wrong until I tried telneting 
into the system the next day.  Then I got to thinking that maybe that program I 
ran wasn't supposed to be there.  Looked at it more closely and sure enough it 
was not.  I did upgrade the kernel maybe a week or two earlier, but not after I 
saw this on my system.  If this was there before I uggraded the kernel, I had 
no idea it was.  

Does it look like that this happened before I upgraded kernels?  Is there 
anyway I could be more sure about this?  Is there any other information or 
files that you would need to be more sure?

Thanks,

Tommy
Comment 17 Tommy Watt 2001-04-02 09:37:21 EDT
Oh one other thing, when you said "local user".  What do you mean, a console 
user?  Or someone who has access to logon to a shell via telnet?
Comment 18 Bill Nottingham 2001-04-02 11:26:37 EDT
'local user' is anyone who has a local account.

Probably the best way to get a good guess as to when this happened
is to check the timestamps on the rk.tar and install.sh files.
Comment 19 Tommy Watt 2001-04-02 13:46:03 EDT
The dates are July 30th, 1998.
Comment 20 Bill Nottingham 2001-04-02 14:32:47 EDT
OK, what's the timestamp on the directory?
Comment 21 Tommy Watt 2001-04-02 16:14:10 EDT
Have to get back to you for that.  Do you have any idea what may of happened?  
I'm really hessitant to reformat and put a server back online without knowing 
what happened.
Comment 22 Tommy Watt 2001-04-03 11:30:15 EDT
Ok here are the dates for /rk and the files.  Apperently the date I gave you 
before was the date that came up in Windows.  (Strange that they're so 
different.)

FEB 28 16:04 /rk
JAN 9 06:56 ssh.tar
JAN 9 07:00 install

This tell you anything?
Comment 23 Tommy Watt 2001-04-05 09:56:56 EDT
Hello?
Comment 24 Bill Nottingham 2001-04-05 11:00:39 EDT
It's dated when you were still running the older kernel, so it's entirely
possible that the kernel exploit was used by a local user.

The only other relevant log entries from around then were FTP
connections listed in /var/log/secure; unfortunately, the /var/log/messages
posted don't go back far enough.
Comment 25 Tommy Watt 2001-04-05 11:09:05 EDT
As I said before, there are no local users.  Is there anything else I can give 
you that could tell you more?
Comment 26 Bill Nottingham 2001-04-05 11:16:10 EDT
There is *no one* that can run commands on the local system?

What version of wu-ftpd were you running on Feb. 28? (Yes, I know that's
not the easiest thing to answer.)  Do you have any older /var/log/messages*
files than the ones that were in the original tarball?
Comment 27 Tommy Watt 2001-04-05 11:26:42 EDT
i was running the current wu-ftp on that date.  i know this for sure because i 
made sure of it because i kept getting hit with the ramen worm

i didn't delete any log files since i reformatted.  i reformatted about a month 
ago and ran all available updates shortly after.  the only updates that i didnt 
run right away was the current kernel

the only person with shell access is myself
Comment 28 Tommy Watt 2001-04-06 13:26:45 EDT
I think I *MAY* of identified the rootkit.  I did a search on 
www.securityfocus.com, and found a reference to "Romanian rootkit".  The 
program chkrootkit (www.chkrootkit.org) says that it has the ability to detect 
the Romanian rootkit.  The reason why I think this may be it is because the 
install script says that it is made in Romania.  I however, after extensive 
searching, can not find any other information on the Romanian rootkit on the 
internet.  Do you know anything about this?
Comment 29 Tommy Watt 2001-04-09 10:07:46 EDT
I still have not identified this for sure.  The author of chkroot said I should 
talk to you about this.  <shrug>

Could you tell me if RedHat 7.1 is due to be out within the next month?  I 
really don't need to know exactly when, but it'd be nice to know if I should 
format my system now or just wait until 7.1 is out.

Any information would be appreciated!

Thanks,

Tommy
Comment 30 Bill Nottingham 2001-04-09 10:53:39 EDT
I don't know anything in particular about the 'romanian rootkit' you mention.

I'm sorry, but we really can't comment on release dates.
Comment 31 Tommy Watt 2001-04-09 11:08:32 EDT
OK.  Well do you have any other ideas?  Or should I just reformat and hope this 
doesn't happen again?
Comment 32 Pekka Savola 2001-04-09 12:04:58 EDT
These kind of rootkits are almost always known and fixed if recent security patches have been 
installed.  In this case the culprit has probably been rpc.statd.  

The Romanian rootkit isn't anything really new, as certain rootkit detectors notice it.

After reinstalling and cutting down the services, I'm rather sure this won't happen again.  Unless security
patches are forgotten to be applied..

As for the next release, in the past there has been a rather strong correlation between different release
dates.
Comment 33 Tommy Watt 2001-04-09 12:32:51 EDT
What do you mean by "correlation between different release
dates". Do you mean they are released in nearly the same amount of time from 
each other?  

When was 6.1 and 6.2 released?
Comment 34 Tommy Watt 2001-04-12 10:47:21 EDT
Hello?
Comment 35 Bill Nottingham 2001-04-16 12:40:14 EDT
I can now comment on the 7.1 release date. It's out. :)
Comment 36 Tommy Watt 2001-04-16 14:24:52 EDT
:)  i noticed..  feel free to close this bug out ....

Note You need to log in before you can comment on or make changes to this bug.