public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
From: Paul Hartman <paul.hartman+gentoo@gmail.com>
To: gentoo-user@lists.gentoo.org
Subject: Re: [gentoo-user] Rooted/compromised Gentoo, seeking advice
Date: Mon, 9 Aug 2010 18:07:15 -0500	[thread overview]
Message-ID: <AANLkTimeSbUFvy7TV_qma4xEVQY7QyYSvcLwO6Zyc_bO@mail.gmail.com> (raw)
In-Reply-To: <201008092009.38665.michaelkintzios@gmail.com>

On Mon, Aug 9, 2010 at 2:09 PM, Mick <michaelkintzios@gmail.com> wrote:
> On Monday 09 August 2010 17:25:56 Paul Hartman wrote:
>> My user account has sudo-without-password rights to any command.
>
> Ouch!
>

Having still not physically touched the machine yet, I don't know if
sudo had anything to do with it at all at this point. But I'll assume
for a moment that its use was perhaps involved...

> There have been discussions on this list why sudo is a bad idea and sudo on
> *any* command is an even worse idea. You might as well be running everything
> as root, right?

Essentially. I did not think it through from an internally-defensive
standpoint. I only thought of sudo as "I am deciding whether to run
this command as user or as root". Assuming *I* would be the only one
running a program on my computer. My thinking was clearly flawed
there... The idea of an attacker being in my system didn't really
enter my mind. Or an untrusted program shelling out and running "sudo
some-bad-stuff" without my knowing. Every sudo command is logged,
sure, but as Bill pointed out that only works for as long as it takes
someone to sudo himself into a root shell (or delete the logs). I
don't really audit the sudo logs regularly because of the stupid
assumption that I was the only one running any sudo commands.

> You have decided wisely to reinstall because you can't be sure of this OS
> anymore.

I'm most concerned about learning how this happened because I don't
want to reinstall everything only to be compromised again, and with
the hope that perhaps any info I find can help others avoid finding
themselves in this same situation. If I'm only going to re-create the
exact same set-up, I don't know if I can be sure of it then even after
reinstalling...

> Please keep us updated on what you find from the forensic analysis.

Sudo was one of the first things that popped into my head. sshd is
really the only service open to the outside. Some other ports are open
for specific apps, like bittorrent traffic, which is what I was
monitoring when I noticed the suspicious activity -- and I was
downloading a Linux ISO, I swear. My original plans for tonight were
to install Sabayon on an old laptop that is becoming unmanageable from
a Gentoo standpoint due to infrequent use and days-long update
sessions. I'll put that little project on hold for now...

My sshd setup is pubkey only, no root logins, and I use denyhosts to
block after 3 failed logins, and it syncs its blocklist from the
denyhosts master server many times a day. I use NX Server, but not
with the default key, and I don't think there have been any (publicly
disclosed) remotely-exploitable opensshd vulnerabilities that would
allow an attacker direct entry into a system. I haven't noticed
anything out of place on my system, no unusual files or missing items.
I take infrequent peeks at my ssh logs, w/who/last and network traffic
(as I did today when I discovered it), but I am not religious about
reading every log. Life has been quite busy lately and I haven't had
as much time to dedicate to that sort of stuff.  I has been more like
log on, check my email, pay my bills, log off.

So, from that outside-entry standpoint I was certainly lulled into a
false sense of security about my system. My root account has a very
long and complicated password, and my user account was surely
"impenetrable" since I was using pubkey-only SSH logins, right...  I
have encrypted partitions, but they are mounted when the system is up
and running, so they are really pointless against an "online"
attack...

Typing that long password into sudo every time I ran a command was a
hassle, and clearly I thought myself too intelligent to ever run a
malicious piece of code on my own computer. I mean, that's the kind of
thing I would never do. I'm careful. I usually look at things before I
run them, scan them with clamscan (not that I run outside
scripts/binaries very often at all). Right? And what if a
seemingly-safe program decided to download and run malware on its own?
What if there was a vulnerability that was exploited before it was
discovered & patched by the community (and my Gentoo update cycle)?
What if there was a rogue Firefox add-on stealing passwords or running
shell scripts? That would probably never happen, surely someone else
would have noticed it and put a stop to it before it got to me, or I
would have read a warning about it in the tech news someplace. Yeah,
I'm being a bit sarcastic here. ;)

I do hope I can find some evidence that leads me to the point of
entry. It would set my mind at ease.



  parent reply	other threads:[~2010-08-09 23:07 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-09 16:25 [gentoo-user] Rooted/compromised Gentoo, seeking advice Paul Hartman
2010-08-09 16:48 ` Alan McKinnon
2010-08-09 18:48   ` Paul Hartman
2010-08-09 18:59 ` [gentoo-user] " 7v5w7go9ub0o
2010-08-09 19:08   ` Paul Hartman
2010-08-09 19:46   ` Mick
2010-08-10 13:50     ` Kyle Bader
2010-08-09 19:09 ` [gentoo-user] " Mick
2010-08-09 20:08   ` Robert Bridge
2010-08-09 20:20     ` Bill Longman
2010-08-10  0:30       ` Kevin O'Gorman
2010-08-10  1:18         ` William Hubbs
2010-08-10  6:42           ` Alan McKinnon
2010-08-10 13:03           ` Kevin O'Gorman
2010-08-10 18:50             ` Alan McKinnon
2010-08-10 19:22               ` Hazen Valliant-Saunders
2010-08-10 23:23                 ` Peter Humphrey
2010-08-11 16:55                 ` Stroller
2010-08-11 18:16                   ` Dale
2010-08-11 20:30                     ` Alan McKinnon
2010-08-11 22:11                       ` [gentoo-user] Rooted/compromised Gentoo, seeking advice - AKA passwords Bill Longman
2010-08-11 23:09                         ` Alan McKinnon
2010-08-12  4:30                           ` Bill Longman
2010-08-12 13:01                       ` [gentoo-user] Rooted/compromised Gentoo, seeking advice Stroller
2010-08-12 19:21                         ` Alan McKinnon
2010-08-12 19:43                           ` Peter Humphrey
2010-08-12 20:14                             ` Alan McKinnon
2010-08-12 12:56                     ` Stroller
2010-08-13  2:11                       ` Dale
2010-08-11 16:58               ` Stroller
2010-08-11 20:26                 ` Alan McKinnon
2010-08-09 20:25     ` Dale
2010-08-09 21:22       ` Mick
2010-08-09 22:19         ` Dale
2010-08-09 21:17     ` Philip Webb
2010-08-09 23:07   ` Paul Hartman [this message]
2010-08-10  2:14     ` Frank Steinmetzger
2010-08-10  2:24       ` Indexer
2010-08-11  1:05       ` Walter Dnes
2010-08-11  2:16         ` Dale
2010-08-11  4:36           ` Walter Dnes
2010-08-11  5:37             ` Dale
2010-08-10  2:30     ` Keith Dart
2010-08-10  3:06 ` Adam Carter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AANLkTimeSbUFvy7TV_qma4xEVQY7QyYSvcLwO6Zyc_bO@mail.gmail.com \
    --to=paul.hartman+gentoo@gmail.com \
    --cc=gentoo-user@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox