LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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-13-2012, 12:44 PM   #1
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,642
Blog Entries: 4

Rep: Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933
Which spambot is this?


I encountered a spambot, hitting a port somewhere in the 32xxx range, which had the following modus operandi:
  • It installed its own rogue /etc/cupsd
  • When logged on as root and watching it, the system could and would replace this file every few minutes.
  • Another file of identical size was in /etc/logrotate.d ... a binary copy of the rogue.
Which "bot" is this, and where is it documented?

The rogue file is interesting in part because it contains the word "spam" quite liberally inside its carefully-designed content. Obviously a zombie engine. Not easy to see how long it's been there especially if they were monkeying with logrotate.

Grrr... If your hosting company "helpfully" installs Plesk on your machine, beat them severely with a wet noodle. (Coated in battery acid.)

Last edited by sundialsvcs; 03-13-2012 at 12:48 PM.
 
Old 03-13-2012, 12:53 PM   #2
ButterflyMelissa
Senior Member
 
Registered: Nov 2007
Location: Somewhere on my hard drive...
Distribution: Manjaro
Posts: 2,766
Blog Entries: 23

Rep: Reputation: 411Reputation: 411Reputation: 411Reputation: 411Reputation: 411
Hi,

Tried to look at the iotop right after the rogue install? This should be interesting...

Hey! Thanks for this thread! I'll follow this one with more than the usual interest...

And, a wet noodle does'nt hurt! You should consider the classic: the board with a nail

Thor
 
Old 03-13-2012, 02:34 PM   #3
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,642

Original Poster
Blog Entries: 4

Rep: Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933
No, this was a virtual server from 1&1 Internet. Not only did they pre-install software that was chock full o' bugs, but it also had many "gratuitous" features (including Plesk itself) which I tried to lock down but obviously missed.

Incidentally, the modus operandi was always the same: it installed or reinstalled a rogue /etc/cupsd file, then spawned the listener, and a few seconds later it was dumping spam somewhere. A very freshly installed and updated ClamAV didn't know anything about it. Unfortunately for me, the rogue software was executing as root.

I also noticed that sshd_config permitted GSSAPI authentication although I don't know why. I haven't quite figured out the attack vector it was using, except for noticing the binary file (of exact size and content) in /etc/logrotate.d.

The maddening thing about these "gratuitous installs," of course, is that you really don't know all of what they are doing; all of what has been installed. I am accustomed to installing Linux more-or-less from scratch on a machine that I can actually touch. But when it's a virtual box in Kansas City, that's a little hard to do.
 
Old 03-13-2012, 03:16 PM   #4
ButterflyMelissa
Senior Member
 
Registered: Nov 2007
Location: Somewhere on my hard drive...
Distribution: Manjaro
Posts: 2,766
Blog Entries: 23

Rep: Reputation: 411Reputation: 411Reputation: 411Reputation: 411Reputation: 411
Quote:
the rogue software was executing as root.
That means a user, what does the password file say? Is there a 0.0 user in there other that the root?
 
Old 03-13-2012, 05:16 PM   #5
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,642

Original Poster
Blog Entries: 4

Rep: Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933
In /etc/passwd there is no one else with a UID of zero.

In /etc/shadow this field does not apply.

Anywhere else to look? Command to use? (System is ancient, centos-5.)

But I wouldn't have put it past these guys to, say, have monkeyed-around with PAM.

Edit: We also know that no successful login attempts are recorded through last although lastb (failed attempts) is as full as ever. So, whatever it is that "refreshes" these files a few minutes after they're removed, that thing is persistent. We also know that it is not constantly active. And, as I said earlier, we know that ClamAV doesn't seem to see anything wrong. (Not even the obviously rogue /etc/cupsd or the obviously bogus file previously mentioned ... which tells you how useful that kind of software actually is ...)

Last edited by sundialsvcs; 03-13-2012 at 08:33 PM.
 
Old 03-15-2012, 06:07 AM   #6
ButterflyMelissa
Senior Member
 
Registered: Nov 2007
Location: Somewhere on my hard drive...
Distribution: Manjaro
Posts: 2,766
Blog Entries: 23

Rep: Reputation: 411Reputation: 411Reputation: 411Reputation: 411Reputation: 411
Is that a webserver? Consider that one (you've seen it on this forum, I'm sure) infected PHP file could spawn a Perl file with the proper rights at any time without the maker even being needed. Nifty but nasty. As soon as the page is called up (by an innocent surfer) the whole ball starts rolling again...

Just thinking out loud...but, still thinking.

Thor
 
Old 03-15-2012, 12:22 PM   #7
orgcandman
Member
 
Registered: May 2002
Location: new hampshire
Distribution: Fedora, RHEL
Posts: 600

Rep: Reputation: 110Reputation: 110
Suggestion: Use auditctl to watch what is opening the file (or directory) and writing to it.

Example:
Code:
# mkdir /test
# auditctl -w /test -p war -k suspicious-test
# touch /test/foo
# cd /test
# touch bar
# cd ~
# ausearch -f /test
From there, you should be able to go further. NOTE: this requires you have kernel auditing turned on, and the auditing package.
 
Old 03-15-2012, 10:31 PM   #8
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,642

Original Poster
Blog Entries: 4

Rep: Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933
I simply shot the horse. (Poor dobbin... she was such a nice nag.)
 
Old 03-17-2012, 06:39 AM   #9
ButterflyMelissa
Senior Member
 
Registered: Nov 2007
Location: Somewhere on my hard drive...
Distribution: Manjaro
Posts: 2,766
Blog Entries: 23

Rep: Reputation: 411Reputation: 411Reputation: 411Reputation: 411Reputation: 411
Quote:
I simply shot the horse. (Poor dobbin... she was such a nice nag.)
Bam!!! Straite in the kisser! Oh well, may she enjoy LinuxHeaven...where all good Kernels go
 
  


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
Video: a forum spambot in action dugan General 8 04-01-2011 01:30 PM
problem with a spambot graziano1968 Linux - Server 3 10-25-2006 03:33 PM

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

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