LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 05-21-2010, 12:16 PM   #16
tronayne
Senior Member
 
Registered: Oct 2003
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,541

Rep: Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065

While you're checking around, grep sshd /var/log/messages and have a good hard look at it (nothing to do with mail, but a lot to do with system security).

Something you can do to get the script kiddies out of your system is (1) do not allow root login in sshd.conf
Code:
]
su -
vi /etc/ssh/sshd.conf
.
.
# Authentication:

#LoginGraceTime 2m
#PermitRootLogin yes
#StrictModes yes
#MaxAuthTries 6
#MaxSessions 10
.
.
Uncomment PermitRootLogin and change yes to no.

If you're seeing tons of break-in attempts, consider installing DenyHosts or fail2ban. DenyHosts takes less fiddling around to get going and it automagically adds the IP address of offenders to /etc/hosts.deny; it also shares the experiences of other users around the world by adding offender addresses to your /etc/hosts.deny periodically; I like that.

Fail2ban is a little more fiddling but it will not only do what DenyHosts does, it will also eliminate offenders found in your HTTPD access_log and error_log -- it can use /etc/hosts.deny for many things or it will use IPTABLES. Either of those will bar any access to your systems. What goes in /etc/hosts.deny is "permanent;" IPTABLES can be transient, up to you.

DenyHosts is found at http://denyhosts.sourceforge.net and fail2ban at http://www.fail2ban.org/wiki/index.php/Main_Page.

In keeping with many recommendations, use passwords that are a least 8 characters, contain at least one numeric character, at least one puncuation character and zero dictionary "words." Don't use numeric sequences; e.g., 1234. Use upper case characters mixed with lower case.

Go get John the Ripper (http://www.openwall.com/john/) and run your passwords against it -- mine run for 24 hours without getting cracked (then I quit just because no attacker would ever have that much time to crack a password).

Web mail? Well, I use gmail for LinuxQuestions simply because AT&T seems to think LQ is a spammer (dammit, can't convince them otherwise). I don't even get spam on the thing (yet!) and I did try using the AT&T SMTP server with it (too much screwing around with both mail addresses) so I just pretty much leave it alone and it seems to work all right. On the AT&T side of the world, I use Thunderbird after I've already looked at the web mail page to see what's what -- they do block a whole lot of spam from ever getting to Thunderbird and I kind of like that.

I've had the same e-mail address for over 10 years, never had a problem with the criminal element (although I thing it's kind of fun when I've sent myself ads for Viagra...).
 
1 members found this post helpful.
Old 05-21-2010, 04:45 PM   #17
D1ver
Member
 
Registered: Jan 2010
Distribution: Slackware 13.37
Posts: 598

Original Poster
Blog Entries: 3

Rep: Reputation: 193Reputation: 193
I am pretty sure I haven't been phished twice in two weeks, and I cant imagine why anyone would make two attempts at brute forcing my gmail, I don't keep anything terribly useful in there.

I ran the command 'grep sshd /var/log/messages' about 5 minutes after boot and received the following:
Code:
May 22 07:30:19 darkstar sshd[3498]: Received signal 15; terminating.
May 22 07:31:24 darkstar sshd[3576]: Server listening on 0.0.0.0 port 22.
May 22 07:31:24 darkstar sshd[3576]: Server listening on :: port 22.
I don't really know what to make of this but it appears a client has connected on port 22?
 
Old 05-22-2010, 07:15 AM   #18
tronayne
Senior Member
 
Registered: Oct 2003
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,541

Rep: Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065
That's normal at start up; it usually takes a while (if you're connected to the network either directly or through a router) for you to get found (even up to a day or so in my experience) -- basically, they ping looking for responses then launch into trying to get in with ssh, that's when the failed password messages start showing up.

Have to wonder, though: darkstar is the default system name for a Slackware box. Did you set up your network with netconfig? Might want to think about doing that a picking another name and domain... or, maybe not -- if it ain't broke, don't fix it, eh?
 
Old 05-22-2010, 08:00 AM   #19
Josh000
Member
 
Registered: Aug 2009
Distribution: Slackware 13 64bit
Posts: 534

Rep: Reputation: 35
Quote:
Originally Posted by onebuck View Post
Not necessarily so with the browser alone statement. Phishing can be performed by various methods. You also have to insure that good security between the available presented information and that current on-line session. If someone does not follow good security habits with installations, or movement of infected data or malfunction due to malicious code then anyone can be violated. Security updates overall are very important habit to form.
My point was that if his local machine was compromised, it was not via software running natively, but rather a browser based attack.

This is my field. I am familiar with the attack vectors and mechanisms used, and his browser will have been the catylist for any attack.

I would safely guarnetee that there is no malicious software running locally and that chrootkit etc will not find anything. Of course it's a good idea to run it anyway, but its better to focus on the actual vulnerability rather than checking something unrelated.

Quote:
Good housekeeping along with proper use of tools will enhance the user's experience with added security not provide a stumbling block. Hey, if a M$ user wants problems then fine. But a GNU/Linux user is not auto-magically protected but just less likely to have the same problems as a M$ user. So why not insure that 'NO' potential problem(s)?
Actually, these days a Linux user is often just as vulnerable as a Windows user (saying M$ really is quite childish). You won't like hearing that, and many will deny it, but its the truth.

Why?

Because as I said previously, the browser is the target these days. The local OS is often irrelivant, especially when an exploit targets the browser regardless of the OS it is running on.

Last edited by Josh000; 05-22-2010 at 08:13 AM.
 
Old 05-22-2010, 08:02 AM   #20
Josh000
Member
 
Registered: Aug 2009
Distribution: Slackware 13 64bit
Posts: 534

Rep: Reputation: 35
Quote:
Originally Posted by dugan View Post
4) phished. Or otherwise conned out of you.
Well, technically phished would come under "sniffed somehow"

D1ver: which browser version are you using, and are all your security patches up to date?

Do you have any of the Adobe products installed, flash or reader?
 
Old 05-22-2010, 08:30 AM   #21
D1ver
Member
 
Registered: Jan 2010
Distribution: Slackware 13.37
Posts: 598

Original Poster
Blog Entries: 3

Rep: Reputation: 193Reputation: 193
I never ran netconfig after installing as everything seems to be working. I'm reasonably new to Linux and Slackware in particular so I'll have to read up on netconfig.

Quote:
D1ver: which browser version are you using, and are all your security patches up to date?

Do you have any of the Adobe products installed, flash or reader?
I'm using Seamonkey and Firefox, both with adblock and noscript. They're up to date with 13.0 -stable. The in browser flash plugin is installed.

I've changed all my passwords and am going to try to migrate away from Gmail. I hope this doesn't happen again
 
Old 05-22-2010, 08:34 AM   #22
onebuck
Moderator
 
Registered: Jan 2005
Location: Central Florida 20 minutes from Disney World
Distribution: SlackwareŽ
Posts: 13,877
Blog Entries: 42

Rep: Reputation: 3105Reputation: 3105Reputation: 3105Reputation: 3105Reputation: 3105Reputation: 3105Reputation: 3105Reputation: 3105Reputation: 3105Reputation: 3105Reputation: 3105
Hi,

Quote:
Originally Posted by Josh000 View Post
You seem to be disagreeing with me, but I have no idea why.

My point was that if his local machine was compromised, it was not via software running natively, but rather a browser based attack.

This is my field. I am familiar with the attack vectors and mechanisms used, and his browser will have been the catylist for any attack.

I would safely guarnetee that there is no malicious software running locally and that chrootkit etc will not find anything. Of course it's a good idea to run it anyway, but its better to focus on the actual vulnerability rather than checking something unrelated.



Actually, these days a Linux user is often just as vulnerable as a Windows user (saying M$ really is quite childish). You won't like hearing that, and many will deny it, but its the truth.

Why?

Because as I said previously, the browser is the target these days. The local OS is often irrelivant, especially when an exploit targets the browser regardless of the OS it is running on.
My suggestions if read without bias or feeling is to look at the system holistically not just from a browser standpoint. Things do happen with a GNU/Linux system less than a M$ but still can occur if good practices are not followed. If for a browser session or for a system in general anything can be broken into if proper safeguards have not been followed.

If you feel the use of the token M$ is childish then so be it. I just use M$ as my lazy icon for Microsoft and if you don't like it: 'Then so be it'.

You seem to look at the browser as the only weak point. I look at giving the person the available potential entry or violations. Sometimes when you look through a tunnel you only see the confined view not the panoramic view.

I'm not challenging you but you seem to take offense to my suggestions that there are the possibilities of violations other than the browser. Sure the most often can be shown to be the session when speaking of a desktop application but the OP & others should be aware of the other potential problems. Heck, a recent security risk pertaining to the font issues opened up a potential security risk with FF that could have introduced a system issue therefore security risk to the base via FF by a knowledgeable user. Now if someone doesn't upgrade the FF browser then a potential security risk will create issues within the OS itself. I think it was mozilla-firefox-3.6.3 that corrected the potential security risk that most people generally would not have addressed. This had nothing to do with a current browsing session but with content for a session.

I never indicated 'chkroot' would do such but that would be the means to insure a safe environment. A user that is concerned with a secure system must use all available tools to gain that environment. Be it for security tools within a application or good user habits, one must continue to attain the secure system with every possible means. Therefore don't bias someone with just one concept but to suggest the means to attain the secure system.

So my suggestion is to keep oneself secure holistically by general senses and following good proven methodology.

I don't know how often you check your system(s) attacks nor who's been knocking on the door. But it does happen all the time. If you want to stick your head in the sand and say it's not a problem 'then so be it'.
 
Old 05-22-2010, 08:39 AM   #23
onebuck
Moderator
 
Registered: Jan 2005
Location: Central Florida 20 minutes from Disney World
Distribution: SlackwareŽ
Posts: 13,877
Blog Entries: 42

Rep: Reputation: 3105Reputation: 3105Reputation: 3105Reputation: 3105Reputation: 3105Reputation: 3105Reputation: 3105Reputation: 3105Reputation: 3105Reputation: 3105Reputation: 3105
Hi,

Quote:
Originally Posted by D1ver View Post
I never ran netconfig after installing as everything seems to be working. I'm reasonably new to Linux and Slackware in particular so I'll have to read up on netconfig.

I'm using Seamonkey and Firefox, both with adblock and noscript. They're up to date with 13.0 -stable. The in browser flash plugin is installed.

I've changed all my passwords and am going to try to migrate away from Gmail. I hope this doesn't happen again
Actually your FF is not up to date for Slackware 13.0. would be to upgrade to 'xap/mozilla-firefox-3.6.3' from -current.

I suggest that you look at the Slackware 'Security Advisories' and be sure to sign up.

Just a few more useful links;

SlackwareŽ Essentials
SlackwareŽ Basics
Linux Documentation Project
Rute Tutorial & Exposition
Linux Command Guide
Bash Reference Manual
Advanced Bash-Scripting Guide
Linux Newbie Admin Guide
LinuxSelfHelp
Getting Started with Linux

The above links and others can be found at 'Slackware-Links' . More than just SlackwareŽ links!
 
Old 05-22-2010, 08:49 AM   #24
D1ver
Member
 
Registered: Jan 2010
Distribution: Slackware 13.37
Posts: 598

Original Poster
Blog Entries: 3

Rep: Reputation: 193Reputation: 193
Hmm thanks again onebuck. Subscribed to the mailing lists and will use Seamonkey exclusively until 13.1 is released
 
Old 05-22-2010, 04:11 PM   #25
onebuck
Moderator
 
Registered: Jan 2005
Location: Central Florida 20 minutes from Disney World
Distribution: SlackwareŽ
Posts: 13,877
Blog Entries: 42

Rep: Reputation: 3105Reputation: 3105Reputation: 3105Reputation: 3105Reputation: 3105Reputation: 3105Reputation: 3105Reputation: 3105Reputation: 3105Reputation: 3105Reputation: 3105
Hi,

You could get the FF 'mozilla-firefox-3.6.3-i686-1.txz' package from '-current' without to much work.
 
Old 05-23-2010, 12:17 PM   #26
Josh000
Member
 
Registered: Aug 2009
Distribution: Slackware 13 64bit
Posts: 534

Rep: Reputation: 35
Quote:
Originally Posted by onebuck View Post
My suggestions if read without bias or feeling is to look at the system holistically not just from a browser standpoint. Things do happen with a GNU/Linux system less than a M$ but still can occur if good practices are not followed. If for a browser session or for a system in general anything can be broken into if proper safeguards have not been followed.
Hi.

I get what you are saying, I just think it is irrelevant.

Yes, it is always good to follow good security practices and have a secure system.

In this particular instance however, the generic advice you give isn't relevant.

Suggesting to run chrootkit or modify hosts.deny or whatever is like suggesting an oil change for a flat tire.

Quote:
You seem to look at the browser as the only weak point. I look at giving the person the available potential entry or violations. Sometimes when you look through a tunnel you only see the confined view not the panoramic view.
The browser or browser plugins are the weak point in the situation described by d1ver.

I'm not looking at this from a narrow point of view, I'm looking at it from an experienced point of view.

The difference between suggesting you do full maintenance because you are unsure what the actual problem is, and knowing what the actual problem is.


Quote:
I'm not challenging you but you seem to take offense to my suggestions that there are the possibilities of violations other than the browser.
Oh, I don't take offence at all, but I do disagree with you.

Looking for rootkits simply doesn't make sense for the scenario d1ver described. It won't hurt and helps to be sure, but it is very unlikely to be the cause.


Quote:
Sure the most often can be shown to be the session when speaking of a desktop application but the OP & others should be aware of the other potential problems. Heck, a recent security risk pertaining to the font issues opened up a potential security risk with FF that could have introduced a system issue therefore security risk to the base via FF by a knowledgeable user.
I agree, but I was trying to solve d1vers specific problem rather than give generic good practices for staying secure.

Quote:
Now if someone doesn't upgrade the FF browser then a potential security risk will create issues within the OS itself. I think it was mozilla-firefox-3.6.3 that corrected the potential security risk that most people generally would not have addressed. This had nothing to do with a current browsing session but with content for a session.

Say what?

It is rare that browser vulnerabilities allow local file placing and execution.

Thus, it is rare that a browser vulnerability will creat an issue with the OS itself.

This is part of why I consider it is unlikely the problem is malicious software running locally.

Quote:
I never indicated 'chkroot' would do such but that would be the means to insure a safe environment. A user that is concerned with a secure system must use all available tools to gain that environment. Be it for security tools within a application or good user habits, one must continue to attain the secure system with every possible means. Therefore don't bias someone with just one concept but to suggest the means to attain the secure system.
Well, I would again use my example of suggesting an oil change for a flat tire.

General maintenance and good practices are good, but it is better to fix the specific problem when someone brings that to attention.

Quote:
So my suggestion is to keep oneself secure holistically by general senses and following good proven methodology.
Sure.

Quote:
I don't know how often you check your system(s) attacks nor who's been knocking on the door. But it does happen all the time. If you want to stick your head in the sand and say it's not a problem 'then so be it'.
As I said, it's my job, and it's my field...so yes, I know quite a bit about this.

Anyway, I don't disagree with your general point that good security pracices should be followed. I just disagree with your approach to d1vers problem.

If you reply it may be a while before I do, I'm off to costa rica early tommorow morning
 
Old 05-23-2010, 03:23 PM   #27
onebuck
Moderator
 
Registered: Jan 2005
Location: Central Florida 20 minutes from Disney World
Distribution: SlackwareŽ
Posts: 13,877
Blog Entries: 42

Rep: Reputation: 3105Reputation: 3105Reputation: 3105Reputation: 3105Reputation: 3105Reputation: 3105Reputation: 3105Reputation: 3105Reputation: 3105Reputation: 3105Reputation: 3105
Hi,

I hope you have a good trip!

As for the FF vulnerability that I mentioned, you really should look at that security risk.

As I stated previously the methods presented are good prevention and a good means to secure one's system.
 
Old 05-23-2010, 04:53 PM   #28
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599
Quote:
Originally Posted by Josh000 View Post
This is my field. I am familiar with the attack vectors and mechanisms used, and his browser will have been the catylist for any attack.
Nice. In forensics no facts can be presented without evidence. In security fixing security problems starts with determining the cause. Since you are so sure I'm left wondering what tools and commands you use to determine if this was 1) bruteforced, (let's skip sniffing), 3) obtained via software or a browser-centric attack? Please target the OPs machine as investigative target if you will and please be as detailed as possible.
 
Old 05-25-2010, 01:47 AM   #29
Josh000
Member
 
Registered: Aug 2009
Distribution: Slackware 13 64bit
Posts: 534

Rep: Reputation: 35
Quote:
Originally Posted by unSpawn View Post
Nice. In forensics no facts can be presented without evidence. In security fixing security problems starts with determining the cause. Since you are so sure I'm left wondering what tools and commands you use to determine if this was 1) bruteforced, (let's skip sniffing), 3) obtained via software or a browser-centric attack? Please target the OPs machine as investigative target if you will and please be as detailed as possible.
Hi. Sorry for the delay in my reply.

My reply will not be as in depth as it normally would be, because I recently damaged my laptop and am in costa rica, and the computers are kind of a pain to use. If you are interested though I can give you links after I get my laptop fixed.

Now, you are right, fixing problems starts with determining the cause, as with anything.

I have not checked d1vers system, and the reason I am sure the cause is limited to the browser is because I am familiar with how these attacks tend to operate. I will expand on that later.

If I wanted to be sure there was no malicious software running on the machine, I would do the following things:

1. Boot with a live cd and run chrootkit and similar software. There is little point in running it from the system you suspect to be compromised.
2. From the system you suspect to be compromised, carefully check what processes are running and what network connections are outgoing. You can use tools like lsof, ntop and netstat. I would also use tcpdump to examine outgoing traffic, and setup a firewall rule with verbose logging.
3. You would also have to check for application specific bugs or exploits. If this were a targetted attack rather than an automated attack, then someone may have gotten local access to the machine or something and changed a configuration setting or enabled remote access or such, that would not necessarily show as malicious.

The above would be a starting point, to start determining the problem. Of course, the above would not show most browser based attacks, as they do not rely on installing locally running software to the machine.


Now, why am I sure the browser is most likely the catylist for the attack? For the last few years, attacks have moved away from targetting specific OS vulnerabilities or relying on user stupidity.

This is partly because OS's have gotten more secure, by implementing things like executable space protection and basic MAC, and also by enforcing better security practices such as strongly discouraging using the administrator/root account for everyday use.

Indeed, the malware "industry" has moved towards a profit model as opposed to the infamy model it was closer to in the 90's and early 2000's. These days, it is more of a goal to silently install software, typically a botnet client, which will not hamper performance or disrupt the user, but will allow the users idle cpu time and network resources to be harnessed.

Given the horrible horrible insecurity of adobe reader and flash (which are responsible for the majority of web exploits these days) the browser is an attractive target.

What I just described is more to do with how malware is installed via browsers these days, which I still don't believe to be d1vers problem.

Looking at the symptoms, only his password for a single account was compromised. There was no other strange behaviour, and no reason to suspect a rootkit had been installed (also because a rootkit is quite a bit more precise, and generally not considered malware of the type that would steal a password). Given that the majority of exploits are adobe product based, or directly browser related (XSS, phishing etc), as well as Linux not being a target for an automated attack(a targetted attack sure, but not an automated attack), then I am reasonably sure that his browser was the catylist.

Given that it is entirely possible to craft an email or an banner ad that can result in his gmail session being stolen, and that there is a miniscule amount of automated malware that targets linux, it clearly makes more sense that the browser was the catylist. It is the significantly simpler andliklier explanation.

If his browser, adobe products and such were all up to date, and there were no funky addons installed, and since there is no talk of any exploits affecting firefox 3.6.3 in the wild since its release, the only other explanation in my mind becomes something the user did. perhaps logging in to his acocunt on an untrustworthy computer at school or an internet cafe, perhaps using a chat client to use gtalk that gave away his info, etc, pissed off girlfriend etc...any number of possibilities really.

What i would actually suggest if d1ver is still reading this is to contact google directly. Out of all the webmail providers they have the best customer support and will actually get back to you regarding this, and may be able to tell you if your account was accessed from somewhere strange.

Sorry for grammar/spelling....costa rican keyboard....

Last edited by Josh000; 05-25-2010 at 02:04 AM.
 
Old 05-25-2010, 09:31 AM   #30
onebuck
Moderator
 
Registered: Jan 2005
Location: Central Florida 20 minutes from Disney World
Distribution: SlackwareŽ
Posts: 13,877
Blog Entries: 42

Rep: Reputation: 3105Reputation: 3105Reputation: 3105Reputation: 3105Reputation: 3105Reputation: 3105Reputation: 3105Reputation: 3105Reputation: 3105Reputation: 3105Reputation: 3105
Hi,

Quote:
Originally Posted by D1ver View Post
Hmm thanks again onebuck. Subscribed to the mailing lists and will use Seamonkey exclusively until 13.1 is released
I was re-reading the thread for clarity and found this statement. Slackware 13.0 SeaMonkey has the same security risks. Update from '-current' for SeaMonkey or FF. Or just get Slackware 13.1 stable.

 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 there any simple tips for Linux security? greenwinter02 Linux - Security 3 10-23-2007 06:18 PM
Multi User Security Tips jestah84 Linux - Security 2 05-12-2004 10:08 AM
Tips on Local User Security matthew.collins Linux - Security 4 03-29-2004 01:04 AM
tips for user security spoody_goon Linux - General 3 02-01-2004 09:05 AM
Maintaining RH 9 Security Tips statmobile Red Hat 1 12-06-2003 03:48 PM

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

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