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 03-28-2016, 09:05 AM   #16
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600

@skyred5: please post feedback confirming you understand what you need to do or else ask more detailed questions.
 
Old 03-28-2016, 10:34 AM   #17
skyred5
LQ Newbie
 
Registered: Mar 2016
Posts: 14

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by unSpawn View Post
@skyred5: please post feedback confirming you understand what you need to do or else ask more detailed questions.
hey sorry for the late reply. Yes it seems that when I copy from the putty window, I copied without realizing that it's not the full thing. I have reattached the log that was generated and saved in the server.

I do have a question. I have always been accessing the server through PUTTY using root. If I'm not supposed to use root to access, then what is the recommended way?

Last edited by skyred5; 03-28-2016 at 08:13 PM.
 
Old 03-28-2016, 11:14 AM   #18
ilesterg
Member
 
Registered: Jul 2012
Location: München
Distribution: Debian, CentOS/RHEL
Posts: 587

Rep: Reputation: 72
Quote:
Originally Posted by skyred5 View Post
I do have a question. I have always been accessing the server through PUTTY using root. If I'm not supposed to use root to access, then what is the recommended way?
Setup another user and use that to connect to your server via Putty. Once you are logged in, use "su" or "sudo su" to login as root.
 
1 members found this post helpful.
Old 03-28-2016, 11:22 AM   #19
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 skyred5 View Post
Yes it seems that when I copy from the putty window, I copied without realizing that it's not the full thing. I have reattached the log that was generated and saved in the server.
Unfortunately you haven't. That said I've already presented my analysis and course of action basd on what you posted so just take it as me cautioning you to please be precise, OK?


Quote:
Originally Posted by skyred5 View Post
I do have a question. I have always been accessing the server through PUTTY using root. If I'm not supposed to use root to access, then what is the recommended way?
Only use public key auth and only SSH into unprivileged accounts. Then either use Sudo (or 'su' if you must) to perform ops that require root privileges. Additionally, if you can not limit SSH access to a private LAN only, see if you can use AllowUsers and AllowGroups sshd_config directives to limit, and add some proactive measure like fail2ban or equivalent.

Can I ask you what you have done so far? Have you isolated the machine? Have you informed others? Do you have a clear view of what you have to do right now?
 
Old 03-28-2016, 11:25 AM   #20
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 ilesterg View Post
Setup another user and use that to connect to your server via Putty. Once you are logged in, use "su" or "sudo su" to login as root.
It's not just "another user" but an unprivileged user account and PuTTY can do pubkey auth too. Please be precise.
 
Old 03-28-2016, 08:23 PM   #21
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,987

Rep: Reputation: 3627Reputation: 3627Reputation: 3627Reputation: 3627Reputation: 3627Reputation: 3627Reputation: 3627Reputation: 3627Reputation: 3627Reputation: 3627Reputation: 3627
Take it offline.

Use known clean sources to recreate the server, update everything. Use hardened security and as many best practices as you can to avoid this.


I never find it much use to try to simply stop the malware.
 
Old 03-28-2016, 08:37 PM   #22
skyred5
LQ Newbie
 
Registered: Mar 2016
Posts: 14

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by unSpawn View Post
Unfortunately you haven't. That said I've already presented my analysis and course of action basd on what you posted so just take it as me cautioning you to please be precise, OK?



Only use public key auth and only SSH into unprivileged accounts. Then either use Sudo (or 'su' if you must) to perform ops that require root privileges. Additionally, if you can not limit SSH access to a private LAN only, see if you can use AllowUsers and AllowGroups sshd_config directives to limit, and add some proactive measure like fail2ban or equivalent.

Can I ask you what you have done so far? Have you isolated the machine? Have you informed others? Do you have a clear view of what you have to do right now?
Hi @unSpawn, I realized while uploading the log file there is actually a limit to the upload size for this forum. Is there a way to send you the log by other means?
 
Old 03-28-2016, 08:59 PM   #23
skyred5
LQ Newbie
 
Registered: Mar 2016
Posts: 14

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by ilesterg View Post
Setup another user and use that to connect to your server via Putty. Once you are logged in, use "su" or "sudo su" to login as root.
Quote:
Originally Posted by jefro View Post
Take it offline.

Use known clean sources to recreate the server, update everything. Use hardened security and as many best practices as you can to avoid this.


I never find it much use to try to simply stop the malware.
Thank you all for the valuable advice. I will take note and apply it for my server. If you all could point me in the right direction as to how to do OS hardening for linux will be good! I have recommendations from my vendor to also rebuild the server.

Last edited by skyred5; 03-28-2016 at 09:00 PM.
 
Old 03-29-2016, 12:09 AM   #24
Sefyir
Member
 
Registered: Mar 2015
Distribution: Linux Mint
Posts: 634

Rep: Reputation: 316Reputation: 316Reputation: 316Reputation: 316
Quote:
Originally Posted by skyred5 View Post
If you all could point me in the right direction as to how to do OS hardening for linux will be good!
Perhaps https://www.linuxquestions.org/quest...erences-45261/
 
1 members found this post helpful.
Old 03-29-2016, 02:23 AM   #25
salasi
Senior Member
 
Registered: Jul 2007
Location: Directly above centre of the earth, UK
Distribution: SuSE, plus some hopping
Posts: 4,070

Rep: Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897
Quote:
Originally Posted by skyred5 View Post
I have recommendations from my vendor to also rebuild the server.
You will, in all probability, rebuild the server eventually. I can't see how you would feel safe otherwise. What is at issue is doing enough now to be sure that you understand how you have been exploited this time, for, without that knowledge, you will not know for sure what was wrong this time and what you have to do better next time.

I mean, you will get lots of people advising you to do all sorts of stuff that is 'best practice', and that's all nice and well meaning, etc, but it doesn't actually mean that you have blocked off the hole that was used to exploit you, unless it includes every bit of best practice in the universe. (And, I don't think you have time for that, at least currently.)
 
Old 03-29-2016, 03:06 AM   #26
ilesterg
Member
 
Registered: Jul 2012
Location: München
Distribution: Debian, CentOS/RHEL
Posts: 587

Rep: Reputation: 72
Well, the most feasible entry for the exploit I can think of right now is the server not being updated on a timely manner, kernel and all. If you have the resources to further investigate on the exploited server, then you must do so and setup another server; do not rebuild the compromised server.
 
1 members found this post helpful.
Old 03-29-2016, 03:08 AM   #27
ilesterg
Member
 
Registered: Jul 2012
Location: München
Distribution: Debian, CentOS/RHEL
Posts: 587

Rep: Reputation: 72
Quote:
Originally Posted by unSpawn View Post
It's not just "another user" but an unprivileged user account and PuTTY can do pubkey auth too. Please be precise.
Thanks for pointing that out unSpawn.
 
Old 03-29-2016, 03:13 PM   #28
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 skyred5 View Post
Hi @unSpawn, I realized while uploading the log file there is actually a limit to the upload size for this forum. Is there a way to send you the log by other means?
You could post or upload only the part that's missing? Meaning
Code:
( \ps axfwwwe 2>&1; lsof -Pwln 2>&1 ) | tee /tmp/log1.txt
That said I've already posted my analysis and course of action in post #11, so you want to start post-mortem please first answer my previous questions as I first need to know if others where alerted of the incident and if the system was isolated from the Internet.
 
Old 03-29-2016, 09:39 PM   #29
skyred5
LQ Newbie
 
Registered: Mar 2016
Posts: 14

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by unSpawn View Post
You could post or upload only the part that's missing? Meaning
Code:
( \ps axfwwwe 2>&1; lsof -Pwln 2>&1 ) | tee /tmp/log1.txt
Still too large. I've uploaded to my own google drive. Link here.

Quote:
Originally Posted by unSpawn View Post
That said I've already posted my analysis and course of action in post #11, so you want to start post-mortem please first answer my previous questions as I first need to know if others where alerted of the incident and if the system was isolated from the Internet.
Yes I have done as what you have mentioned, and have informed the relevant people in my company.
 
Old 03-29-2016, 10:03 PM   #30
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,987

Rep: Reputation: 3627Reputation: 3627Reputation: 3627Reputation: 3627Reputation: 3627Reputation: 3627Reputation: 3627Reputation: 3627Reputation: 3627Reputation: 3627Reputation: 3627
There are many ways to harden a server. The more "best practices" you learn and employ the more secure it will be.

I don't agree with all of these but it is a start. http://www.cyberciti.biz/tips/linux-security.html

Your vendor should provide you with a set of parameters too.

Stuff older like this helps too. https://www.nsa.gov/ia/_files/factsh...phlet-i731.pdf

https://www.sans.org/media/score/che...xchecklist.pdf
 
  


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
centos 5 machine plagued with 'mount error 13 = Permission denied' tonj Linux - Software 22 03-28-2015 05:32 AM
LXer: Delicious irony: iPhone 5S and iOS 7 plagued by Blue Screen of Death LXer Syndicated Linux News 0 10-12-2013 05:11 PM
[SOLVED] May have contracted malware. Yes, malware. Firefox on Ubuntu Fiesty. Seeking a fix drachenchen Linux - Security 22 08-17-2008 01:05 PM
May have contracted malware. Yes, malware. Firefox on Ubuntu Fiesty. Seeking a fix drachenchen Linux - Security 1 06-12-2008 05:10 AM

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

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