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 01-12-2018, 02:53 PM   #1
horizn
Member
 
Registered: Jan 2015
Location: UK and Poland
Distribution: Slackware + Debian + Ubuntu
Posts: 170

Rep: Reputation: Disabled
How to check when rootkit has been installed.


Hi,
Unfortunately someone left VM exposed to the internet with easy to guess ssh root password, and rootkit Linux/XOR.DDoS has been installed. I know, when attacker gained access to the server and what aws his IP address, but I'd like to know when rootkit has been installed. Is it possible?

Last edited by horizn; 01-12-2018 at 02:54 PM.
 
Old 01-12-2018, 03:34 PM   #2
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925
Have a read of this - https://bartblaze.blogspot.co.uk/201...uxxorddos.html - and determine the files that the rootkit creates. Have a look for these and, unless the rootkit faked the dates or has touched them since, you should be able to see the date that it started its active infiltration.
 
1 members found this post helpful.
Old 01-12-2018, 04:32 PM   #3
jsbjsb001
Senior Member
 
Registered: Mar 2009
Location: Earth, unfortunately...
Distribution: Currently: OpenMandriva. Previously: openSUSE, PCLinuxOS, CentOS, among others over the years.
Posts: 3,881

Rep: Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063
While I don't know if this particular rootkit will be picked up by the following command, it's a good command to have installed to check for rootkit's with. You will more likely than not need to install it, as it is not normally installed by default in most Linux distro's.

Code:
[root@localhost ~]# rkhunter 

Usage: rkhunter {--check | --unlock | --update | --versioncheck |
                 --propupd [{filename | directory | package name},...] |
                 --list [{tests | {lang | languages} | rootkits | perl | propfiles}] |
                 --config-check | --version | --help} [options]
The link that hydrurga has given you looks like it's well worth a read.
 
Old 01-13-2018, 10:12 AM   #4
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
rkhunter after the fact? Dunno, as it would require a --propupd before it is effective?

Code:
clamscan -ir /path/to/scan/
should light up something.

Code:
grep aws_ip /var/log/* -R
for the time period.

Likely a reverse shell and clamscan finds a lot of those (when I had "one")

See https://aw-snap.info for interrogation techniques.

Last edited by Habitual; 01-23-2018 at 01:53 PM.
 
Old 01-13-2018, 02:13 PM   #5
fatmac
LQ Guru
 
Registered: Sep 2011
Location: Upper Hale, Surrey/Hants Border, UK
Distribution: Mainly Devuan, antiX, & Void, with Tiny Core, Fatdog, & BSD thrown in.
Posts: 5,493

Rep: Reputation: Disabled
Use a live forensic distro to check your system, such as Kali.
https://docs.kali.org/general-use/ka...forensics-mode
 
Old 01-23-2018, 12:31 PM   #6
Trihexagonal
Member
 
Registered: Jul 2017
Posts: 362
Blog Entries: 1

Rep: Reputation: 334Reputation: 334Reputation: 334Reputation: 334
Quote:
Originally Posted by Habitual View Post
rkhunter after the fact? Dunno, as it would require a --propupd before it is effective?
In addition to checking the status of files after running --propupd, rkhunter does a check of known and possible rootkit files and directories, malware checks, and in this case FreeBSD specific checks, as well as network ports if you enable nmap support.

Code:
Rootkit checks...
Rootkits checked : 477
Possible rootkits: 0
OpenBSD considers rkhunter a "gimmic" and it isn't even in their repository.
 
Old 01-23-2018, 07:09 PM   #7
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,659
Blog Entries: 4

Rep: Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941
Most-importantly, "see to it that rootkits can't be installed in the first place."

Practice the "principle of least privilege." Jealously guard all user-ids which are capable of attaining root privileges and do not use these accounts ... nearly all of the time. No one can "just stumble-upon your system" and "decide to install a rootkit on it."
 
Old 02-04-2018, 07:58 PM   #8
sfzombie13
Member
 
Registered: Dec 2003
Location: wv
Distribution: slackware, lfs, kali, pentoo, centos
Posts: 168

Rep: Reputation: 18
Quote:
Originally Posted by sundialsvcs View Post
Most-importantly, "see to it that rootkits can't be installed in the first place."

... No one can "just stumble-upon your system" and "decide to install a rootkit on it."
While the first part of your comment is right on, the last part is most certainly not true. I stumble upon systems with full access on the open internet all the time. of course, i don't go around installing root kits, but i could if i wanted to.
 
  


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
rootkit installed? aidylewis Linux - Newbie 10 06-30-2017 09:57 AM
LXer: Dell Compromises Customers’ Security with Pre-Installed Rootkit LXer Syndicated Linux News 1 11-25-2015 11:07 AM
rootkit hunter false positive for Xzibit Rootkit on CentOS 4.8? abefroman Linux - Security 2 12-20-2009 08:19 AM
How do I check what wm I have installed. mlsbraves *BSD 12 12-08-2004 10:25 PM
Possible rootkit, any readonly way to run check? tekhead2 Linux - Security 4 10-27-2004 01:48 AM

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

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