LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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-16-2004, 03:33 AM   #1
ruleman
LQ Newbie
 
Registered: Feb 2004
Distribution: Slackware 9.1
Posts: 22

Rep: Reputation: 15
My server has been hacked, how to remove SUCKIT?


Hi guys, my server has been hacked and installed SUCKIT rootkit.
When i tried to reboot my server using; shutdown -r now i got following errors.

The system is going down for reboot NOW!
/dev/null
RK_Init: idt=0xc033e000, sct[]=0xc033ec40, kmalloc()=0xc0139df0, gfp=0x3
Z_Init: Allocating kernel-code memory...Done, 12836 bytes, base=0xfffffff2
BD_Init: Starting backdoor daemon...Done, pid=31175

Then i searched little bit and found this is a SUCKIT issue. I found SUCKIT rootkit on /dev/sdhu0/tehdrakg directory. And here is the files on it:

[root@server1 tehdrakg]# ls -la
total 172
drwxr-xr-x 3 root root 4096 Apr 26 08:08 .
drwxr-xr-x 3 root root 4096 Jan 3 04:54 ..
-rw-r--r-- 1 root root 6705 Oct 25 2002 mig-logcleaner11.tar.gz
-rwxr-xr-x 1 root root 25273 Jan 3 05:07 m.tehdrakg
-rwxr-xr-x 1 root root 29764 Jan 3 04:54 sk
drwxr-xr-x 5 500 500 4096 Jan 3 04:54 skrh9
-rw--w--w- 1 root root 85711 May 13 05:14 .sniffer
-rwxr-xr-x 1 root root 1089 Feb 26 2001 udp.pl

it seems i had been hacked since 3th of January This scricpt kiddie knows his job i use chrootkit almost everyday but it always show nothing infected. Also I found /sbin/inittehdrakg and /sbin/init were created on 3th January.

Now what i want to know is how to remove this s*ckin' SUCKIT. Is there any chance to secure my system since now ? Without OS-Reload. And is there any chance to trace this script kiddie back?

Thanks.
 
Old 05-16-2004, 04:48 AM   #2
XavierP
Moderator
 
Registered: Nov 2002
Location: Kent, England
Distribution: Debian Testing
Posts: 19,192
Blog Entries: 4

Rep: Reputation: 475Reputation: 475Reputation: 475Reputation: 475Reputation: 475
Firstly, you need to isolate the box - get it iff the network, make sure it can't connect to the network or any other box.

Then, go here: http://www.linuxquestions.org/questi...threadid=45261 Unspawn has listed a huge number of security references for us all.
 
Old 05-16-2004, 05:23 AM   #3
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Sorry. Removing a rootkit is *NOT* the solution.

Then, go here:
(Damn, it takes too much time to write these replies :-[ )


From now on, regard this system as UNTRUSTED. DO NOT USE IT, AND DO NOT ALLOW OTHERS TO USE IT.

Here's what you do:
Precaution 0: read Steps for Recovering from a UNIX or NT System Compromise before doing anything else.

Precaution 1: For any operations on the server boot your distro's rescue cd, any cd-based distro (Trinux, Knoppix, Finnix, FIRE, PSK) or a one-floppy distro like tomsrtbt, LOAF. DO NOT BOOT the kernel from the harddisk or let it automatically mount the disks. If you need to mount the disks, mount them readonly.

1. Power down the server. This will render the system useless to the cracker and protect you from doing stuff on the box. Running any system diagnostics wouldn't make sense because you can't trust your system to not lie to you. Forget about making backups, forget about saving files, just drop it.
Notify local and remote admins and users about the compromise. : if this box is used to access remote boxen, other boxen on the network, etc, etc alert network admins. Also alert users of the box their authentication is void and ask them to change any auth they share with other boxen. Alerting is best done from a box that doesn't reside on the same subnet as the compromised one. Initiate checking other boxen on your network. Inform your ISP if you want to.

2. This step depends on what you want to do:
2a. If you want to spend time trying to find out what exactly happened, prepare another box on the network, else skip to 3b. This means combing over that box and make sure it is SAFE to use. If unsure it's your choice to either not use the box, or use the 3 R's: repartition, reformat and re-install from scratch. Make sure the box has enough diskspace (minimally 2x the disks to duplicate). Make copies using "dd" over the network or physically mount the disk on the other box. For dd'ing out you don't need to mount the partitions, just "dd if=/dev/<partitionname> of=/somedir/somefile_<partitionname>" and don't forget the swapfile. What does this yield? Absolutely nothing. Now you've got a copy of the disks you can perform basic forensics on them and try to work out what happened. I'd be glad to help you, but remember this is tedious and time consuming work, and the result is not guaranteed.
2b. OK. You decided not to "play" with forensics. Copy the /etc and /var dir off the server. These include most system config files and logfiles. Comes in handy if you want to see if you can get to know something w/o doing full-fledged forensics.

Precaution 2: read
Starting from Scratch: Formatting and Reinstalling after a Security Incident first.

3. Make sure you copy out any config files you forgot under 3b. DO NOT COPY BINARY DATA. Copy only verifiable, human readable data out. Exceptions are /var files like utmp, wtmp, lastlog and any other accounting files. Grab all updates from a local ftp mirror. Now use the 3 R's: Repartition, reformat and reinstall from scratch. Install only what you need NOW. Finish by applying the updates. Make sure you render any backups inaccessable and change all users passwords.

Don't connect the box back to the network, but first head over to the Linux - Security forum and read the "FAQ: Security references" thread, especially post 1. At least read these:
UNIX Security Checklist v2.0: http://www.cert.org/tech_tips/unix_s...cklist2.0.html
SANS, The Twenty Most Critical Internet Security Vulnerabilities: http://www.sans.org/top20/
Linux Administrator's Security Guide (LASG): http://www.seifried.org/lasg/
Securing Optimizing Linux RH Edition (older): http://tldp.org/LDP/solrhe/Securing-...-Edition-v1.3/
Intruder Detection Checklist (CERT): http://www.cert.org/tech_tips/intrud...checklist.html
Intrusion Detection Primer: http://www.linuxsecurity.com/feature...e_story-8.html

Add checking any distro specific stuff like mailinglists and hardening.



...and finally to answer your questions:

This scricpt kiddie knows his job i use chrootkit almost everyday but it always show nothing infected.
First of all you shouldn't trust just one tool. Second, SuckIT file hiding and skdet checks where added recently to a tool similar to Chkrootkit: Rootkit Hunter. Third point I'd like to make is that tools in that category suffer from using default locations and default binary names for checks. Once you change your location or binary name you're safe from any "find" ops, unless someone runs "strings" for identification or uses specific (skdet, kern_check, ip) or more tools to find anomalies. That's why you should install a filesystem integrity checker (Aide, Samhain, tripwire) once the OS is installed.


Now what i want to know is how to remove this s*ckin' SUCKIT.
SuckIT installs default built binary called "sk" as /sbin/init. SuckIT (if unmodified) will uninstall itself when you call the "sk" binary with argument "u". So "/sbin/init u" should unload SuckIT. This by no means means you're in the safe zone.


Is there any chance to secure my system since now ? Without OS-Reload.
In short, no. One would be insane to suggest it.
A slightly longer explanation: Yes, rebuild it. You have no idea what the cracker knows about your system, what it was used for, what backdoors are in place and what service she used to get in. Thinking you can get your box up to the point where it's more or less secure without rebuilding it from scratch is a fallacy.


And is there any chance to trace this script kiddie back?
In short, since the box has been found compromised for that long a period, chances are low.
A slightly longer explanation: when an intruder enters the system she will introduce methods to stay as much invisible as possible for as long as she can manage it. Removal or hiding of suspect files and logcleaning are the first things. Undelete could yield results (ls_hidden, an_check, mc VFS undelete, TCT), be partially undone, but only when it was discovered real soon after, and provided the server doesn't do much writes to the places where unlinked data lives.


// Out of sheer selfinterest, if you could secure me a copy of the contents of /dev/sdhu0/tehdrakg and whatever files changed on the system (no system auth stuff) and make it available for download I'd be happy. if you do, please *email* the download location.
 
Old 06-13-2004, 11:54 PM   #4
ruleman
LQ Newbie
 
Registered: Feb 2004
Distribution: Slackware 9.1
Posts: 22

Original Poster
Rep: Reputation: 15
Thanks unspawn. I didn't have any important data on that server, to avoid OS-Reload fee I changed my ISP I'm more serious about system security since my last box compromised. I'm using fedora core 1 and grsecurity patched kernel which is 2.4.26 and i followed steps you suggested. I also sent you an email that contains files link of that atacker left behind. Thank you very much.
 
Old 06-14-2004, 05:34 PM   #5
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Thanks. sk.* contained a modified SuckIT rootkit archive for RedHat 9, the other one was a login record logcleaner. Shame you didn't ship the (/dev/sdhu0/) tehdrakg stuff.
 
Old 06-15-2004, 07:43 AM   #6
SBing
Member
 
Registered: Mar 2004
Posts: 519

Rep: Reputation: 35
@unspawn

Great read, as spectators is useful to know about this kinda stuff if and when it happens to us.
Quote:
posted by unSpawn...sometime...
when an intruder enters the system she will introduce methods to stay as much invisible as possible for as long as she can manage it.
One question, why do you use 'she' in regards to the intruder? Any reason in particular or are you suggesting that you have absolutely no idea who the intruder is so the gender is irrelevant?

Or have I missed something obvious :/?

Steve
 
Old 06-20-2004, 05:47 AM   #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
One question, why do you use 'she' in regards to the intruder? Any reason in particular or are you suggesting that you have absolutely no idea who the intruder is so the gender is irrelevant?
In essence gender is irrelevant because you'll look at someone's skills and not his/her gender and also because the amount of crackers (I'm not saying hackers, OK) of the opposite sex is thought to be way low. Calling an intruder "she" is a somewhat default in security circles, and I just used it w/o finding out what it really stands for (which is bad ofcourse).
 
Old 06-20-2004, 06:25 AM   #8
SBing
Member
 
Registered: Mar 2004
Posts: 519

Rep: Reputation: 35
Okay, cheers for explaining that mate :)

Steve
 
  


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
Is my server hacked? kazjol Linux - Security 3 10-10-2004 12:09 PM
Server hacked cpanelskindepot Linux - Security 46 07-05-2004 06:19 PM
Server hacked php4u Linux - Security 1 07-05-2004 11:34 AM
server hacked!?!?! vittibaby Linux - Security 1 03-27-2004 12:31 PM
pacpac has hacked my server. Help! 360 Linux - Security 10 04-22-2002 03:35 AM

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

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