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 10-13-2011, 02:17 PM   #1
rewesh
LQ Newbie
 
Registered: Oct 2011
Posts: 12

Rep: Reputation: Disabled
Red face My system is infected with a rootkit or something


My system is infected with a rootkit or something and i trying to find the source of the infection but i can not. I though by doing an upgrade from etch to lenny will help, however the process is halted by an error to upgrade Mysql which i do not want to update for he moment. I found this bot file attached in the tmp folder. i had to put .txt so i can attach it. I posted this in the Debain thread but was adviced to posted in security. I did not know how to move it from there.
 
Click here to see the post LQ members have rated as the most helpful post in this thread.
Old 10-13-2011, 02:30 PM   #2
corp769
LQ Guru
 
Registered: Apr 2005
Location: /dev/null
Posts: 5,818

Rep: Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007
Quote:
My system is infected with a rootkit or something
Well it doesn't sound like you are too sure about this.... How do you know you are infected? Can you show us logs or proof? What all are you doing and checking to know about this infection?

Cheers,

Josh
 
Old 10-13-2011, 02:35 PM   #3
rewesh
LQ Newbie
 
Registered: Oct 2011
Posts: 12

Original Poster
Rep: Reputation: Disabled
Sorry forgot to attach the file

file is attached
Attached Files
File Type: txt bot.txt (17.4 KB, 43 views)
 
Old 10-13-2011, 02:46 PM   #4
rewesh
LQ Newbie
 
Registered: Oct 2011
Posts: 12

Original Poster
Rep: Reputation: Disabled
this was driving me crazy as the internet connection was saturated and no one could browse the internet, I last suspected the Linux machine,however while watching the switch lights, the Linux machine was very busy, i disconnected and everything is normal. My journey started as I do not have much experience with Linux on top of that, this is a secure machine that is what i though that Linux can not be hacked. After doing so many things from disconnecting the server from the internet to restarting the server every two hours, finally i realized some process when they are running, the server connects to the internet and start the saturation part, the process is httpd,if i stopped everything will be normal again until the script runs again.
I run rkhunter and chkrootkit both they did not detect anything, i modified wget permission, however still the same problem.

hope some could help
 
Old 10-13-2011, 02:53 PM   #5
corp769
LQ Guru
 
Registered: Apr 2005
Location: /dev/null
Posts: 5,818

Rep: Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007
Ok, so did you delete it? And please answer the rest of my questions. And note that since you said you have found it in /tmp, it may be nothing. But knowing more information will be beneficial on how you discovered this, what picked it up, and also the actual file name, and if it is running in memory.

Edit - Sorry, didn't see your previous post. What is the file name though? Run "ps aux" and grep it with the filename, and see what all comes up. Is this being run as root by any chance?

Last edited by corp769; 10-13-2011 at 02:54 PM.
 
Old 10-13-2011, 02:53 PM   #6
dive
Senior Member
 
Registered: Aug 2003
Location: UK
Distribution: Slackware
Posts: 3,467

Rep: Reputation: Disabled
Well that script looks like it connects to an irc server and send files. It's possible that by now your passwords have been hacked.

Remove/rename/move that file, kill the process, change passwords.

How you got it is another matter. It could have been through something you installed that was exploited.

Last edited by dive; 10-13-2011 at 02:54 PM.
 
Old 10-13-2011, 02:57 PM   #7
rewesh
LQ Newbie
 
Registered: Oct 2011
Posts: 12

Original Poster
Rep: Reputation: Disabled
i am not sure you posted your answer before mine. the name of the file was just bot, i moved it somewhere else. This file is automatically created each time after a reboot. I provided some information on my previous post, let me know
 
Old 10-13-2011, 03:07 PM   #8
corp769
LQ Guru
 
Registered: Apr 2005
Location: /dev/null
Posts: 5,818

Rep: Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007
I would start looking in your cron entries, and if you have updatedb and locate installed, run updatedb, and use locate to try to track down any other duplicates of that file.
 
Old 10-13-2011, 03:10 PM   #9
dive
Senior Member
 
Registered: Aug 2003
Location: UK
Distribution: Slackware
Posts: 3,467

Rep: Reputation: Disabled
Then either there is another (probably also perl) script running, or it's being downloaded via the net.

If you can find a startup file that loads anything suspicious it may help. Other than that all I can think of is a clean reinstall (with new passwords of course).

Last edited by dive; 10-13-2011 at 03:12 PM.
 
Old 10-13-2011, 03:19 PM   #10
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
If you do a clean install, go for a recent version. You say that you upgraded from Etch to Lenny to see if that will help. Etch is unsupported since February 2010, so since then there was no security update for it. That may have helped to infect the machine.
If you run a Linux server that doesn't mean that you don't have to care for security at all, you still have to maintain that system. Even a Linux system is only so secure its administrator makes it to be.
 
Old 10-13-2011, 04:51 PM   #11
craigevil
Senior Member
 
Registered: Apr 2005
Location: OZ
Distribution: Debian Sid/RPIOS
Posts: 4,885
Blog Entries: 28

Rep: Reputation: 533Reputation: 533Reputation: 533Reputation: 533Reputation: 533Reputation: 533
I would suggest a clean install using Squeeze.

Also wouldn't hurt to read Securing Debian Manual - http://www.debian.org/doc/manuals/se...-debian-howto/
 
Old 10-13-2011, 05:16 PM   #12
rewesh
LQ Newbie
 
Registered: Oct 2011
Posts: 12

Original Poster
Rep: Reputation: Disabled
yes there is a perl script

Quote:
Originally Posted by dive View Post
Then either there is another (probably also perl) script running, or it's being downloaded via the net.

If you can find a startup file that loads anything suspicious it may help. Other than that all I can think of is a clean reinstall (with new passwords of course).
I noticed when i do ps aux and found that httpd is the running process and i take that ID and run netstat -A -n -p |grep ID
i found that perl is using it. how can i find that script. how can i find startup files ? Thanks
 
Old 10-13-2011, 06:14 PM   #13
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
To the OP: in short the two most common points of entry are vulnerabilities in services (weak passwords) and vulnerabilities in software running on top of the web server. Please note any "advice" to reinstall without suggesting proper analysis is incomplete and premature (and certainly not in line with what we view as responsible incident response) as doing so may seem to remedy the problem but without knowing the point(s) of entry you may unknowingly re-enable it. Additionally altering the file system by deleting files or running commands may thwart investigation. Thinking you can upgrade your way out of a "infected with a rootkit or something" compromise is a serious misjudgment.

That said best step through the CERT Intruder Detection Checklist first (it's old but it's got a usable list of tasks to perform regardless), if unsure please consider using a Live CD during the inspection, and review your logs (preferably copied over to a separate known safe workstation running Logwatch) for anomalies.

A listing of items, unless the machine was rebooted, would be welcome. Please post:
- which services the machine or machines provide (including web-based management panels, statistics, web log, forum, shopping cart, plugins and other software if any),
- which exact software versions and if the software was kept up to date,
- which logging, access restrictions is in place and hardening was performed,
- if there have been earlier breaches or anomalies,
- complete listings of running (piping through SSH or saving in /dev/shm may be a substitute for "/path/to/"):
'( /bin/ps acxfwwwe 2>&1; /usr/sbin/lsof -Pwln 2>&1; /bin/ls -al /var/spool/cron 2>&1; /bin/netstat -anpe 2>&1; /usr/bin/lastlog 2>&1; /usr/bin/last 2>&1; /usr/bin/who -a 2>&1 ) > /path/to/data.txt'.
- additionally please post about any audit and auth data, system and daemon logs, setuid root files, user shell histories, cronjobs or service initialization files you've looked at (because possibly something made you change wget access permissions).
Please be as verbose and complete as possible so you can be given advice advice tailored to your specific situation and please keep the machine disconnected from the 'net. BTW, do you have regular backups?

Last edited by unSpawn; 10-13-2011 at 06:22 PM. Reason: //More *is* more
 
3 members found this post helpful.
  


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
Server is infected with rootkit or something rewesh Debian 7 10-14-2011 10:32 AM
rootkit hunter false positive for Xzibit Rootkit on CentOS 4.8? abefroman Linux - Security 2 12-20-2009 08:19 AM
what is the best live cd to work on a badly infected XP system ? rob.rice Linux - General 7 08-02-2009 11:17 AM
rootkit: infected??? help synaptical Linux - Security 4 05-16-2005 07:11 PM
Linux.slapper infected system! Help!! cmiwebmaster Linux - Newbie 1 04-16-2003 05:46 PM

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

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