public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-user] Rootkit?
@ 2011-10-06 15:01 Nilesh Govindarajan
  2011-10-06 15:10 ` Michael Mol
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Nilesh Govindarajan @ 2011-10-06 15:01 UTC (permalink / raw
  To: Gentoo User Mailing List

One of the servers I manage has a strange problem.

Every 24h, someone starts a process shows up as perl in the list, but
launching command is /usr/sbin/httpd.
It shows just one process, but when I run something like this:

ps -C perl -o cmd,pid

I get some 5-6 processes alternatively with cmd as /usr/sbin/httpd or
/usr/bin/perl.

The even more interesting thing is, /usr/sbin/httpd does not exist.
I suspect a rootkit, but chkrootkit & rkhunter reported nothing.

Also, I found a mysterious file: /tmp/ips.txt with following content:
xxx.xxx.xxx.xxx
127.0.0.1
addr:xxx.xxx.xxx.xxx
addr:
addr:127.0.0.1
addr:

Somebody is aware of a malware/rootkit which creates such files?

-- 
Nilesh Govindarajan
http://nileshgr.com



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [gentoo-user] Rootkit?
  2011-10-06 15:01 [gentoo-user] Rootkit? Nilesh Govindarajan
@ 2011-10-06 15:10 ` Michael Mol
  2011-10-06 15:12   ` Michael Mol
  2011-10-06 15:23 ` Paul Hartman
  2011-10-06 15:36 ` [gentoo-user] Rootkit? Alberto Luaces
  2 siblings, 1 reply; 9+ messages in thread
From: Michael Mol @ 2011-10-06 15:10 UTC (permalink / raw
  To: gentoo-user

On Thu, Oct 6, 2011 at 11:01 AM, Nilesh Govindarajan
<contact@nileshgr.com> wrote:
> One of the servers I manage has a strange problem.
>
> Every 24h, someone starts a process shows up as perl in the list, but
> launching command is /usr/sbin/httpd.
> It shows just one process, but when I run something like this:
>
> ps -C perl -o cmd,pid
>
> I get some 5-6 processes alternatively with cmd as /usr/sbin/httpd or
> /usr/bin/perl.
>
> The even more interesting thing is, /usr/sbin/httpd does not exist.
> I suspect a rootkit, but chkrootkit & rkhunter reported nothing.
>
> Also, I found a mysterious file: /tmp/ips.txt with following content:
> xxx.xxx.xxx.xxx
> 127.0.0.1
> addr:xxx.xxx.xxx.xxx
> addr:
> addr:127.0.0.1
> addr:
>
> Somebody is aware of a malware/rootkit which creates such files?

No direct experience with Linux rootkits, but you might have better
luck if you run a statically-linked copy of busybox that can talk to
the kernel, rather than going through a potentially malicious libc.

Is this a server running Gentoo or some other distro?


-- 
:wq



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [gentoo-user] Rootkit?
  2011-10-06 15:10 ` Michael Mol
@ 2011-10-06 15:12   ` Michael Mol
  0 siblings, 0 replies; 9+ messages in thread
From: Michael Mol @ 2011-10-06 15:12 UTC (permalink / raw
  To: gentoo-user

On Thu, Oct 6, 2011 at 11:10 AM, Michael Mol <mikemol@gmail.com> wrote:
> On Thu, Oct 6, 2011 at 11:01 AM, Nilesh Govindarajan
> <contact@nileshgr.com> wrote:
>> One of the servers I manage has a strange problem.
>>
>> Every 24h, someone starts a process shows up as perl in the list, but
>> launching command is /usr/sbin/httpd.
>> It shows just one process, but when I run something like this:
>>
>> ps -C perl -o cmd,pid
>>
>> I get some 5-6 processes alternatively with cmd as /usr/sbin/httpd or
>> /usr/bin/perl.
>>
>> The even more interesting thing is, /usr/sbin/httpd does not exist.
>> I suspect a rootkit, but chkrootkit & rkhunter reported nothing.
>>
>> Also, I found a mysterious file: /tmp/ips.txt with following content:
>> xxx.xxx.xxx.xxx
>> 127.0.0.1
>> addr:xxx.xxx.xxx.xxx
>> addr:
>> addr:127.0.0.1
>> addr:
>>
>> Somebody is aware of a malware/rootkit which creates such files?
>
> No direct experience with Linux rootkits, but you might have better
> luck if you run a statically-linked copy of busybox that can talk to
> the kernel, rather than going through a potentially malicious libc.
>
> Is this a server running Gentoo or some other distro?

Mm. Something else. A process is allowed to modify its argv[0], which
changes what you see when you run commands like 'ps'. However, if you
take a look at what's in /proc for the PID in question, you might be
able get a better idea of the file's origin.


-- 
:wq



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [gentoo-user] Rootkit?
  2011-10-06 15:01 [gentoo-user] Rootkit? Nilesh Govindarajan
  2011-10-06 15:10 ` Michael Mol
@ 2011-10-06 15:23 ` Paul Hartman
  2011-10-06 15:36 ` [gentoo-user] Rootkit? Alberto Luaces
  2 siblings, 0 replies; 9+ messages in thread
From: Paul Hartman @ 2011-10-06 15:23 UTC (permalink / raw
  To: gentoo-user

On Thu, Oct 6, 2011 at 10:01 AM, Nilesh Govindarajan
<contact@nileshgr.com> wrote:
> /usr/sbin/httpd

I think this is what apache version 1 used. Did the server upgrade
from apache1 to apache2 at some point? Maybe there's some leftover
things from the old days that is for apache1.



^ permalink raw reply	[flat|nested] 9+ messages in thread

* [gentoo-user] Re: Rootkit?
  2011-10-06 15:01 [gentoo-user] Rootkit? Nilesh Govindarajan
  2011-10-06 15:10 ` Michael Mol
  2011-10-06 15:23 ` Paul Hartman
@ 2011-10-06 15:36 ` Alberto Luaces
  2011-10-06 16:55   ` Nilesh Govindarajan
  2 siblings, 1 reply; 9+ messages in thread
From: Alberto Luaces @ 2011-10-06 15:36 UTC (permalink / raw
  To: gentoo-user

Nilesh Govindarajan writes:

> One of the servers I manage has a strange problem.
>
> Every 24h, someone starts a process shows up as perl in the list, but
> launching command is /usr/sbin/httpd.
> It shows just one process, but when I run something like this:
>
> ps -C perl -o cmd,pid
>
> I get some 5-6 processes alternatively with cmd as /usr/sbin/httpd or
> /usr/bin/perl.
>
> The even more interesting thing is, /usr/sbin/httpd does not exist.
> I suspect a rootkit, but chkrootkit & rkhunter reported nothing.
>
> Also, I found a mysterious file: /tmp/ips.txt with following content:
> xxx.xxx.xxx.xxx
> 127.0.0.1
> addr:xxx.xxx.xxx.xxx
> addr:
> addr:127.0.0.1
> addr:
>
> Somebody is aware of a malware/rootkit which creates such files?

I had some of that recently. The attacker used a instance of phpmyadmin
to inject into its URL a wget command to download a perl script from
another site. Look for `wget' into apache logs.

-- 
Alberto




^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [gentoo-user] Re: Rootkit?
  2011-10-06 15:36 ` [gentoo-user] Rootkit? Alberto Luaces
@ 2011-10-06 16:55   ` Nilesh Govindarajan
  2011-10-06 17:02     ` Michael Mol
  0 siblings, 1 reply; 9+ messages in thread
From: Nilesh Govindarajan @ 2011-10-06 16:55 UTC (permalink / raw
  To: gentoo-user

On Thu 06 Oct 2011 09:06:06 PM IST, Alberto Luaces wrote:
> Nilesh Govindarajan writes:
>
>> One of the servers I manage has a strange problem.
>>
>> Every 24h, someone starts a process shows up as perl in the list, but
>> launching command is /usr/sbin/httpd.
>> It shows just one process, but when I run something like this:
>>
>> ps -C perl -o cmd,pid
>>
>> I get some 5-6 processes alternatively with cmd as /usr/sbin/httpd or
>> /usr/bin/perl.
>>
>> The even more interesting thing is, /usr/sbin/httpd does not exist.
>> I suspect a rootkit, but chkrootkit & rkhunter reported nothing.
>>
>> Also, I found a mysterious file: /tmp/ips.txt with following content:
>> xxx.xxx.xxx.xxx
>> 127.0.0.1
>> addr:xxx.xxx.xxx.xxx
>> addr:
>> addr:127.0.0.1
>> addr:
>>
>> Somebody is aware of a malware/rootkit which creates such files?
>
> I had some of that recently. The attacker used a instance of phpmyadmin
> to inject into its URL a wget command to download a perl script from
> another site. Look for `wget' into apache logs.
>

@all
Apache was never installed & I don't see any reason to install it 
because nginx satisfies my needs. I grepped for the string wget in all 
logs and php files, found some, but they were for libssh2 in wordpress 
code.
@Michael,
I thought of doing that, but before I discovered the file, I'd already 
killed the processes. Will check later when the process is relaunched 
sometime later.

-- 
Nilesh Govindarajan
http://nileshgr.com



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [gentoo-user] Re: Rootkit?
  2011-10-06 16:55   ` Nilesh Govindarajan
@ 2011-10-06 17:02     ` Michael Mol
  2011-10-06 17:10       ` Nilesh Govindarajan
  0 siblings, 1 reply; 9+ messages in thread
From: Michael Mol @ 2011-10-06 17:02 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 1705 bytes --]

On Oct 6, 2011 12:57 PM, "Nilesh Govindarajan" <contact@nileshgr.com> wrote:
>
> On Thu 06 Oct 2011 09:06:06 PM IST, Alberto Luaces wrote:
> > Nilesh Govindarajan writes:
> >
> >> One of the servers I manage has a strange problem.
> >>
> >> Every 24h, someone starts a process shows up as perl in the list, but
> >> launching command is /usr/sbin/httpd.
> >> It shows just one process, but when I run something like this:
> >>
> >> ps -C perl -o cmd,pid
> >>
> >> I get some 5-6 processes alternatively with cmd as /usr/sbin/httpd or
> >> /usr/bin/perl.
> >>
> >> The even more interesting thing is, /usr/sbin/httpd does not exist.
> >> I suspect a rootkit, but chkrootkit & rkhunter reported nothing.
> >>
> >> Also, I found a mysterious file: /tmp/ips.txt with following content:
> >> xxx.xxx.xxx.xxx
> >> 127.0.0.1
> >> addr:xxx.xxx.xxx.xxx
> >> addr:
> >> addr:127.0.0.1
> >> addr:
> >>
> >> Somebody is aware of a malware/rootkit which creates such files?
> >
> > I had some of that recently. The attacker used a instance of phpmyadmin
> > to inject into its URL a wget command to download a perl script from
> > another site. Look for `wget' into apache logs.
> >
>
> @all
> Apache was never installed & I don't see any reason to install it
> because nginx satisfies my needs. I grepped for the string wget in all
> logs and php files, found some, but they were for libssh2 in wordpress
> code.
> @Michael,
> I thought of doing that, but before I discovered the file, I'd already
> killed the processes. Will check later when the process is relaunched
> sometime later.

You might crank up service log levels in anticipation, too, and prod your
firewall to log unusual-but-allowed connections, too.

[-- Attachment #2: Type: text/html, Size: 2255 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [gentoo-user] Re: Rootkit?
  2011-10-06 17:02     ` Michael Mol
@ 2011-10-06 17:10       ` Nilesh Govindarajan
  2011-10-09  4:23         ` Nilesh Govindarajan
  0 siblings, 1 reply; 9+ messages in thread
From: Nilesh Govindarajan @ 2011-10-06 17:10 UTC (permalink / raw
  To: gentoo-user

On Thu 06 Oct 2011 10:32:14 PM IST, Michael Mol wrote:
>
> On Oct 6, 2011 12:57 PM, "Nilesh Govindarajan" <contact@nileshgr.com
> <mailto:contact@nileshgr.com>> wrote:
> >
> > On Thu 06 Oct 2011 09:06:06 PM IST, Alberto Luaces wrote:
> > > Nilesh Govindarajan writes:
> > >
> > >> One of the servers I manage has a strange problem.
> > >>
> > >> Every 24h, someone starts a process shows up as perl in the list, but
> > >> launching command is /usr/sbin/httpd.
> > >> It shows just one process, but when I run something like this:
> > >>
> > >> ps -C perl -o cmd,pid
> > >>
> > >> I get some 5-6 processes alternatively with cmd as /usr/sbin/httpd or
> > >> /usr/bin/perl.
> > >>
> > >> The even more interesting thing is, /usr/sbin/httpd does not exist.
> > >> I suspect a rootkit, but chkrootkit & rkhunter reported nothing.
> > >>
> > >> Also, I found a mysterious file: /tmp/ips.txt with following content:
> > >> xxx.xxx.xxx.xxx
> > >> 127.0.0.1
> > >> addr:xxx.xxx.xxx.xxx
> > >> addr:
> > >> addr:127.0.0.1
> > >> addr:
> > >>
> > >> Somebody is aware of a malware/rootkit which creates such files?
> > >
> > > I had some of that recently. The attacker used a instance of
> phpmyadmin
> > > to inject into its URL a wget command to download a perl script from
> > > another site. Look for `wget' into apache logs.
> > >
> >
> > @all
> > Apache was never installed & I don't see any reason to install it
> > because nginx satisfies my needs. I grepped for the string wget in all
> > logs and php files, found some, but they were for libssh2 in wordpress
> > code.
> > @Michael,
> > I thought of doing that, but before I discovered the file, I'd already
> > killed the processes. Will check later when the process is relaunched
> > sometime later.
>
> You might crank up service log levels in anticipation, too, and prod
> your firewall to log unusual-but-allowed connections, too.
>

I just found something: 
http://blog.vaultpress.com/2011/08/02/vulnerability-found-in-timthumb/
Data on just one of the wordpress installations seems to be deleted, 
which seems to me as an effect of this. We're removing timthumb and 
will watch. Thanks for the tip :-)

-- 
Nilesh Govindarajan
http://nileshgr.com



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [gentoo-user] Re: Rootkit?
  2011-10-06 17:10       ` Nilesh Govindarajan
@ 2011-10-09  4:23         ` Nilesh Govindarajan
  0 siblings, 0 replies; 9+ messages in thread
From: Nilesh Govindarajan @ 2011-10-09  4:23 UTC (permalink / raw
  To: gentoo-user

On Thu 06 Oct 2011 10:40:35 PM IST, Nilesh Govindarajan wrote:
> On Thu 06 Oct 2011 10:32:14 PM IST, Michael Mol wrote:
>>
>> On Oct 6, 2011 12:57 PM, "Nilesh Govindarajan" <contact@nileshgr.com
>> <mailto:contact@nileshgr.com>> wrote:
>>>
>>> On Thu 06 Oct 2011 09:06:06 PM IST, Alberto Luaces wrote:
>>>> Nilesh Govindarajan writes:
>>>>
>>>>> One of the servers I manage has a strange problem.
>>>>>
>>>>> Every 24h, someone starts a process shows up as perl in the list, but
>>>>> launching command is /usr/sbin/httpd.
>>>>> It shows just one process, but when I run something like this:
>>>>>
>>>>> ps -C perl -o cmd,pid
>>>>>
>>>>> I get some 5-6 processes alternatively with cmd as /usr/sbin/httpd or
>>>>> /usr/bin/perl.
>>>>>
>>>>> The even more interesting thing is, /usr/sbin/httpd does not exist.
>>>>> I suspect a rootkit, but chkrootkit & rkhunter reported nothing.
>>>>>
>>>>> Also, I found a mysterious file: /tmp/ips.txt with following content:
>>>>> xxx.xxx.xxx.xxx
>>>>> 127.0.0.1
>>>>> addr:xxx.xxx.xxx.xxx
>>>>> addr:
>>>>> addr:127.0.0.1
>>>>> addr:
>>>>>
>>>>> Somebody is aware of a malware/rootkit which creates such files?
>>>>
>>>> I had some of that recently. The attacker used a instance of
>> phpmyadmin
>>>> to inject into its URL a wget command to download a perl script from
>>>> another site. Look for `wget' into apache logs.
>>>>
>>>
>>> @all
>>> Apache was never installed & I don't see any reason to install it
>>> because nginx satisfies my needs. I grepped for the string wget in all
>>> logs and php files, found some, but they were for libssh2 in wordpress
>>> code.
>>> @Michael,
>>> I thought of doing that, but before I discovered the file, I'd already
>>> killed the processes. Will check later when the process is relaunched
>>> sometime later.
>>
>> You might crank up service log levels in anticipation, too, and prod
>> your firewall to log unusual-but-allowed connections, too.
>>
>
> I just found something: 
> http://blog.vaultpress.com/2011/08/02/vulnerability-found-in-timthumb/
> Data on just one of the wordpress installations seems to be deleted, 
> which seems to me as an effect of this. We're removing timthumb and 
> will watch. Thanks for the tip :-)
>

After about 72 hours of watch, it seems timthumb was the culprit. No 
attack/overload since 72h.

-- 
Nilesh Govindarajan
http://nileshgr.com



^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2011-10-09  4:24 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-06 15:01 [gentoo-user] Rootkit? Nilesh Govindarajan
2011-10-06 15:10 ` Michael Mol
2011-10-06 15:12   ` Michael Mol
2011-10-06 15:23 ` Paul Hartman
2011-10-06 15:36 ` [gentoo-user] Rootkit? Alberto Luaces
2011-10-06 16:55   ` Nilesh Govindarajan
2011-10-06 17:02     ` Michael Mol
2011-10-06 17:10       ` Nilesh Govindarajan
2011-10-09  4:23         ` Nilesh Govindarajan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox