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 09-18-2016, 03:44 PM   #1
donald3.heckel
Member
 
Registered: Aug 2014
Posts: 60

Rep: Reputation: Disabled
Exclamation Possible Server Breach with empty logs, nonstop rkhunter warnings, chkrootkit shows possible LKM Trojan


Hello Everyone,

Configuration 1: CSF/LFD (ConfigServer Security and Firewall with Integrated Logon Failure Daemon)

Configuration 2 (Alt Config): (IPTables and Fail2Ban)

I have a Linux server that I use primarily for a variety of uses such as X11 Forwarding, Gaming, and others. Recently, my family got a new modem router that didn't work well with my firewall on the LAN side while I am hosting gaming servers, and I had to implement a simpler solution to as a result (Note Config 2 Above). In the process, I have discovered that my logs were empty (primarily in /var/log/auth.log), a strange previous login from an unidentified IP Address, and rkhunter was spitting out nonstop warnings of just about everything on the system (I am not sure if these are false positives or not). Chkrootkit has picked up a possible unidentified Trojan (LKM Trojan). I have changed the authentication method to require two public keys to authenticate with my other server and range banned the subnet while I get the first one sorted out (With CSF and LFD enabled).

Server 1 (Possibly Compromised Machine):

Pentium 4 Processor: 3.00E GHz Dual Core
Matrox GPU
Ubuntu (Mainly Kubuntu) w/ Ubuntu Server and many Desktop Environments

I could use some help in securing my system and removing the possible trojan.

All help will be greatly appreciated.

P.S.: If all else fails, I guess I might back up my home directory and rebuild my server from scratch.

Sincerely,

d3h
 
Old 09-19-2016, 11:27 AM   #2
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
https://help.ubuntu.com/community/RKhunter instructs you on how to deal with those warnings.
So does /etc/fail2ban/jail.conf BUT that's scary, to some, I guess.

Sorry that's all I can help with.

Last edited by Habitual; 09-19-2016 at 11:29 AM.
 
Old 09-22-2016, 02:08 PM   #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
Quote:
Originally Posted by donald3.heckel View Post
I could use some help in securing my system and removing the possible trojan.
Sorry to hear things went belly up. But if 0) your logs were cleaned out, 1) logins from unknown IP Addresses occurred, 2) rkhunter questions the integrity of about everything on the system and 3) you have a possible LKM then there is nothing to "clean up". Also I do hope there was no personally identifiable information or clear text credentials on the server?.. Do mark past backups as "tainted, don't use", have every user change pass phrases, consider isolating disposable games servers in a DMZ and keeping your family data in the LAN, do consider separately encryption truly valuable data and do read up on securing servers. *If you need pointers to documentation outside of what Ubuntu and the "Securing Debian" bible offer let us know, OK?
 
Old 09-23-2016, 08:13 AM   #4
donald3.heckel
Member
 
Registered: Aug 2014
Posts: 60

Original Poster
Rep: Reputation: Disabled
Hello everyone,

Thank you all for the replies. I am not exactly sure what is going on, but I checked a few times over and chkrootkit is actually showing nothing at this point except for a false positive. As for rkhunter, the results are questionable. It took a while for everything to show up in my logs, but they finally did. On the other hand, I think I would be better off hosting game servers from a Virtual Machine. ;-)

Any recommendations to make security certain? (Intrusion Detection anyone?)

Sincerely,

donald3.heckel
 
Old 09-23-2016, 10:51 AM   #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
Quote:
Originally Posted by donald3.heckel View Post
I am not exactly sure what is going on, but (..)
...but still there is nothing to "clean up".
Plus you haven't posted any details that would help us help you.


Quote:
Originally Posted by donald3.heckel View Post
Any recommendations to make security certain?
Start afresh. Do mark past backups as "tainted, don't use", have every user change pass phrases, consider isolating disposable games servers in a DMZ and keeping your family data in the LAN, do consider separately encryption truly valuable data and do read up on securing servers and if you need pointers after reading the Ubuntu (security) documentation and the "Securing Debian" bible let us know, OK? (IDS is nice but it's no replacement for a properly maintained and hardened setup.)
 
Old 09-23-2016, 05:04 PM   #6
donald3.heckel
Member
 
Registered: Aug 2014
Posts: 60

Original Poster
Rep: Reputation: Disabled
Hello unSpawn,

Thank you for your reply.

I was wondering if any of you would recommend any intrusion detection systems. At this point, I am curious on how to address the rkhunter warnings. I will also consider hosting game servers from VMs as an extra safety/security precaution. ;-)
I might've been thrown off by the delay in the machine logging the activity, but I am not entirely sure.

ADDITION: Agreed. Do you know of any resources on how to better harden my system? I usually keep it well maintained. I am curious about using SELinux as an option.

Sincerely,

donald3.heckel

Last edited by donald3.heckel; 09-23-2016 at 05:08 PM. Reason: Adding in a detailed reply
 
Old 09-28-2016, 02:30 PM   #7
c0wb0y
Member
 
Registered: Jan 2012
Location: Inside the oven
Distribution: Windows
Posts: 417

Rep: Reputation: 74
If you're hosting some sort of servers on-premise, you better dedicate a DMZ for those external services. And separate your LAN to begin with. Also, if the external facing services are known for security issues (or run as root) then, it has a wider attack surface.

If you enable SSH, accept only certificate-based auth.

SELinux can mitigate exploits and is another component of security layer (though comes with additional complexity, unfortunately). I'd say, forget this for now. Start with the basics. Proper permission, updates, network isolation, cert auth etc.
 
  


Reply

Tags
security, server, sshd



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
[SOLVED] chkrootkit LKM Trojan -- False Positive or not? Konphine Linux - Security 26 09-20-2011 03:28 PM
Rkhunter warnings (hopefully not related to the kernel.org breach) Peufelon Linux - Security 12 09-05-2011 01:02 PM
chkrootkit warning of lkm trojan provkitir Linux - Security 5 10-20-2004 06:17 AM
LKM trojan? help! synaptical Linux - Security 3 03-07-2004 07:16 AM
chkrootkit and lkm Crashed_Again Linux - Security 3 06-08-2003 08:54 PM

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

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