LinuxQuestions.org
Review your favorite Linux distribution.
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 12-21-2003, 05:04 AM   #1
Jalalabee
Member
 
Registered: Aug 2003
Distribution: Slackware 10.2
Posts: 102

Rep: Reputation: 15
i was hacked : is it safe?


I'am wondering if I can keep my music, there was a root-kit installed, romanian I believe. Also, is there a way to clean it?

Thanks for any help,

-Jalalabee
 
Old 12-21-2003, 06:14 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
there was a root-kit installed, romanian I believe / Also, is there a way to clean it?
Please be verbose when you report a system compromise. For instance:
- What vendor and release?
- What (network) services where running?
- How long ago was this?
- How did you detect it?
- What got "installed"?
- What logs showed "evidence" to trace back the exploit/cracker IP's?
- Files/dirs with "mihai" in it?


I'am wondering if I can keep my music
Most likely yes, because I never seen crackers "infect" music files on Linux but only scanning it should give proof because it would be easy to rename/append stuff to a music file (not likely that it would get executed, but that's beside the point).
 
Old 12-21-2003, 06:49 AM   #3
Jalalabee
Member
 
Registered: Aug 2003
Distribution: Slackware 10.2
Posts: 102

Original Poster
Rep: Reputation: 15
Distro: Slackware 9.0
Kernal 2.4.21 built by myself
Noticed when: my locate started having funny problems
Ran the rootkit check script...the popular one i believe, its 30kb or so.

i had to kinda move *some* of the information back up here, the following is stuff i wrote down because it seemed a problem.

---

Infected were: ifconfig, login, pstree

possible root kit: T0rn v8 or varation, showtee, shkit

root kit: Romanian /usr/iclude/file.h /usr/iclude/proc.h

---

I'd like to keep my music atleast, i already changed all my passwords for things, so my next step is to try to keep my music and format to slackware 9.1, get the newest kernel and set up some good security measures.

atleast thats what i think i should do, right?

but what about cleaning or scanning infected music?

can i just read the harddrive with a windows install and take over the music and scan for it sometime?

what to do.....
 
Old 12-21-2003, 07:36 AM   #4
adm0
LQ Newbie
 
Registered: Dec 2003
Posts: 2

Rep: Reputation: 0
edited on request.


Last edited by adm0; 12-21-2003 at 07:50 AM.
 
Old 12-21-2003, 07:40 AM   #5
Jalalabee
Member
 
Registered: Aug 2003
Distribution: Slackware 10.2
Posts: 102

Original Poster
Rep: Reputation: 15
i looked through the /var/logs and i found a foreign ip that seems to have logged into root i believe, i wonder if i should contact his/her isp?
 
Old 12-21-2003, 07:45 AM   #6
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
With all due respect, but I specifically said: "Please be verbose when you report a system compromise." With that I mean the more precise information you give, the easier it could be for us to get a grip on the situation. It also means you should answer *all* questions and not only those you like. I'm not saying this to chide you, but because I take system compromises very seriously and the help I offer must be based on facts. The more facts I have, the more my advice will be for your specific situation.

Please answer the questions you didn't.


I'd like to keep my music atleast, i already changed all my passwords for things, so my next step is to try to keep my music and format to slackware 9.1, get the newest kernel and set up some good security measures.
* Do not impulsively backup, move, change or whatever you think you should do on the box, we'll get to that later on.

If your system is infected, your next step is to make sure you
- block any process from harming the system in any way,
- block anyone from accessing the box or making changes (and that includes yourself),
- understand why it has happened.


Infected were: ifconfig, login, pstree
possible root kit: T0rn v8 or varation, showtee, shkit
root kit: Romanian /usr/iclude/file.h /usr/iclude/proc.h

- If you have a rescue cdrom, or a cdrom distro like Knoppix, FIRE, Trinux etc etc or a one floppy distro like tomstrbt, then reboot the box you think is compromised and load the kernel from that floppy/cdr, mount partitions read-only and continue.
- If you don't have a cdrom or floppy distro, drop to runlevel 1*, mount partitions read-only and continue. *Unlikely, but this could trigger "boobytraps". Always keep your ears open for high disk activity. If you get suspicious, shut down the box immediately by whatever means necessary (reset, power cord).


- Please run "for i in ifconfig login pstree; do chkrootkit -d $i; done 2>&1|tee -a /tmp/chkr.log" and "chkrootkit -d aliens 2>&1|tee -a /tmp/chkr.log". Please post the contents of the log here. If you use /dev/shm, put logs there, else remount /tmp in rw mode.
- If you have a filesystem integrity scanner (with databases on read-only media), run it and post the output. If you don't, and your package manager doesn't support GPG or md5sum checking, then you will have to fetch the packages from cdrom/ftp to correlate. "Diff" the list for files not in the package database and inspect visually.
- Check your passwd/group files and wtmp for added users and logins.
- Check your system and daemon logs for errors or "weird" lines.


i had to kinda move *some* of the information back up here,
Please explain what you mean by this.


but what about cleaning or scanning infected music?
Let's handle this one step at a time. You may think otherwise, but music files are not your first priority at this point.



"Here are the general steps:"
I disagree.
The first step is to halt risks of exposure.
The second step is to determine the box status.
The third step is to determine object status, salvage and isolate to (and investigate the point of breach).
"Mopping up" comes after that.

If you want to learn about what to do with situations like these, please try reading
the LQ FAQ: Security references, post #1 "Basics, important sites, HOWTO's", the "Compromise, breach of security, detection" part and post #5 "Forensics, recovery, undelete", the "Forensics HOWTO's, docs" part, before you offer suggestions.
 
Old 12-21-2003, 08:03 AM   #7
Jalalabee
Member
 
Registered: Aug 2003
Distribution: Slackware 10.2
Posts: 102

Original Poster
Rep: Reputation: 15
Ah, I'm pretty much low-grade, as in I don't know *that* much. But here I go.

- What vendor and release?

Slackware 9.0 -- kernel 2.4.21 compiled myself


- What (network) services where running?

webmin, apache, bind, and anything default that slackware 9.0 would contain, I'am not sure how else to answer this question.


- How long ago was this?

I'am unsure, I looked over logs (I'm not too good at noticing what is "weird", however I noticed an ip and the port 1390 and the time was 3 days ago. it seems to start today however things like nautilus wern't loading and icons missing, locate stopped working.)

- How did you detect it?

I used a root kit check script: http://www.chkrootkit.org/


- What got "installed"?

I posted above but the only thing for "sure" is the romanian root kit


- What logs showed "evidence" to trace back the exploit/cracker IP's?

I looked through message.1 and found an IP coming in as root or something about that.


- Files/dirs with "mihai" in it?

mihai? is that a file? i wouldn't know because my locate, i believe.
 
Old 12-21-2003, 08:21 AM   #8
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
OK, cool. Thanks for posting. Really helps.

Ah, I'm pretty much low-grade, as in I don't know *that* much.
No prob if you don't know stuff. Hell, I don't know everything either.


- What (network) services where running?
webmin, apache, bind, and anything default that slackware 9.0 would contain, I'am not sure how else to answer this question.

1. You could get the versions of the SW you're running from querying your package manager. Please do so for the network services you provide(d). No Samba?
2. If netstat isn't b0rken too, running "netstat -panel -A inet 2>&1|tee -a /tmp/netstat.log" should show whatever is listening.


- How long ago was this?
I'am unsure, I looked over logs.*the time was 3 days ago.

OK. Time to do the right thing. Please read the stuff below "Please answer the questions you didn't.", carefully, execute and post the logs.
 
Old 12-21-2003, 08:48 AM   #9
Jalalabee
Member
 
Registered: Aug 2003
Distribution: Slackware 10.2
Posts: 102

Original Poster
Rep: Reputation: 15
No samba, I believe, I also installed a new pkg manager for SW (was going to update last week but it wasn't working for me) 9.0 is ALL I know, that and it JUST came out when I burned the CD.

Also: http://4.5.92.217/~jalal/netlog
 
Old 12-21-2003, 09:14 AM   #10
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Please read the stuff below the line "Please answer the questions you didn't." in my second post carefully, execute and post the (URI of the) logs (or email me the URI and I'll fetch it if you make it a tarball and it's size is not in excess of a few megs).

* Looking at what you posted I'd you could take the chance and run chkrootkit etc from your box w/o booting Knoppix or a rescue cdr/floppy distro, but make sure you DISCONNECT the box from the 'net first. When you're done, run "find / 2>&1|tee find.log", then reboot with Knoppix or a rescue cdr/floppy distro and do a second run of everything, and a second run of the "find" command.
Diff the two resulting lists and if anything is hidden with an LKM (and you didn't boot the kernel from harddisk) chances are you'll see all then.


~jalal/netlog
OK. So you have a lot more running than you said... And you're running emech, an IRC bot. Cool. Probably has logs. Try running "pgrep emech -d " "| xargs -iP lsof -p 'P' 2>&1|tee emech_lsof.log" after you done the stuff above. If anything says "(deleted)", you can copy those files out of /proc/(pid of emech)/fd.
 
  


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 it safe ? Alex_jacobson Solaris / OpenSolaris 2 03-02-2005 01:24 PM
How safe am I? bad_andy Linux - Security 2 01-29-2005 01:47 PM
Is this safe enough? koyi Linux - Security 4 08-18-2004 10:50 PM
is it safe... violaten Linux - Hardware 1 08-03-2003 02:56 AM
NAT? How safe? Thaidog Linux - Security 2 10-06-2002 01:06 PM

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

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