LinuxQuestions.org
Review your favorite Linux distribution.
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 10-17-2010, 08:59 AM   #1
Zippy1970
Member
 
Registered: Sep 2007
Posts: 119

Rep: Reputation: 17
Has my server been comprimised? Receiving strange mails.


My webserver is running Debian Etch and up until last February, I've always done every single security update available (and applicable) for my server. But Etch is no longer maintained and I haven't upgraded to Lenny yet because I was afraid to do so.

But today I received a strange email (all admin mails from the webserver are redirected to my mailbox on the webserver). Actually, I had received a few weird emails earlier but more on that later.

Anyway, today I received this mail (I replaced the true domain name for obvious reasons, everything I changed is in grey):

Code:
From - Sun Oct 17 15:35:47 2010
X-Account-Key: account1
X-UIDL: UID56456-1181516889
X-Mozilla-Status: 0001
X-Mozilla-Status2: 10000000
X-Mozilla-Keys:                                                                                 
Return-Path: <www-data@hostname.mydomain.com>
X-Original-To: webmaster@localhost
Delivered-To: webmaster@localhost.mydomain.com
Received: by hostname.mydomain.com (Postfix, from userid 33)
	id 78F6F228E2; Sun, 17 Oct 2010 12:53:16 +0200 (CEST)
To: webmaster@localhost.mydomain.com
Subject: does it work
From: webmaster@localhost.domain.com
MIME-Version: 1.0
Content-Type: multipart/mixed;
 boundary="==Multipart_Boundary_xaf23c604bd337ad9848be828c3ca04ffx"
Message-Id: <20101017105316.78F6F228E2@hostname.mydomain.com>
Date: Sun, 17 Oct 2010 12:53:16 +0200 (CEST)

This is a multi-part message in MIME format.

--==Multipart_Boundary_xaf23c604bd337ad9848be828c3ca04ffx
Content-Type:text/html; charset="iso-8859-1"
Content-Transfer-Encoding: 7bit

yes

--==Multipart_Boundary_xaf23c604bd337ad9848be828c3ca04ffx
Content-Type: application/octet-stream;
 name="example.php"
Content-Transfer-Encoding: base64

PD8KaW5jbHVkZSgibWFpbGVyLmNsYXNzLnBocCIpOwokbWFpbGVyPW5ldyBtYWlsZXIoIndlYm1h

c3RlckBsb2NhbGhvc3QiLCJkb2VzIGl0IHdvcmsiLCJ5ZXMiLCJGcm9tOiB3ZWJtYXN0ZXJAbG9j

YWxob3N0Iik7CiRtYWlsZXItPmZpbGUoImV4YW1wbGUucGhwIik7CiRtYWlsZXItPmF0dGFjaCgi

dGV4dC9wbGFpbiIsInNlZS50eHQiLCJ0YWRhIDIgYXR0YWNobWVudHMiKTsKJHRlc3Q9JG1haWxl

ci0+c2VuZCgpOwplY2hvICR0ZXN0PyJzZW50IjoiZXJyb3IiOwo/Pg==



--==Multipart_Boundary_xaf23c604bd337ad9848be828c3ca04ffx
--==Multipart_Boundary_xaf23c604bd337ad9848be828c3ca04ffx
Content-Type: text/plain;
 name="see.txt"
Content-Transfer-Encoding: base64

dGFkYSAyIGF0dGFjaG1lbnRz



--==Multipart_Boundary_xaf23c604bd337ad9848be828c3ca04ffx
It looks like it's mail sent from my own webserver (I have postfix running on it). It has two attachement, one attachment is "example.php", the other "see.txt". My mail client displayes the first as the text "Yes", and the second as "tada 2 attachments".

If I look in my mail log, I find this:

Code:
Oct 17 12:53:16 hostname postfix/cleanup[24036]: 78F6F228E2: message-id=<20101017105316.78F6F228E2@hostname.mydomain.com>
Oct 17 12:53:16 hostname postfix/qmgr[23530]: 78F6F228E2: from=<www-data@hostname.mydomain.com>, size=1469, nrcpt=1 (queue
 active)
Oct 17 12:53:16 hostname postfix/local[24038]: 78F6F228E2: to=<myname@hostname.mydomain.com>, orig_to=<webmaster@localhost>,
relay=local, delay=0.13, delays=0.04/0/0/0.09, dsn=2.0.0, status=sent (delivered to maildir)
Oct 17 12:53:16 hostname postfix/qmgr[23530]: 78F6F228E2: removed
So what's up? My mailserver isn't an open relay but apparently someone has found a way in. What can I do to find out what's going on?
 
Old 10-17-2010, 09:06 AM   #2
Zippy1970
Member
 
Registered: Sep 2007
Posts: 119

Original Poster
Rep: Reputation: 17
UID 33 (www-data) is the web user, so I guess someone is sending mail through an exploit of perhaps phpBB or something?
 
Old 10-17-2010, 10:10 AM   #3
Hangdog42
LQ Veteran
 
Registered: Feb 2003
Location: Maryland
Distribution: Slackware
Posts: 7,803
Blog Entries: 1

Rep: Reputation: 422Reputation: 422Reputation: 422Reputation: 422Reputation: 422
If you decode the base64 stuff, you'll find it is a PHP program that is trying to send the files you've seen as attachment. So you may be on to something expecting phpBB to be one of the culprits. However, we like to start with facts here, so at this point I would do a few things to try and gather some evidence as to what actually happened.

- Look for the attachment files and see if they are in an odd location, or are owned by someone unusual. Also look and see if the dates around those files makes any sense
- Have a good long look at your log files for anything out of the ordinary. Any dates you got from the files may be a clue, but go through the files pretty completely
- Look and see if there is anything listening that shouldn't be. lsof -Pwn and netstat -pane would be good commands to run and look at. You also might run ps -asfxwwwe to see if any processes are looking odd.
- It would be helpful if you could give us an idea of what this server is doing/running. You've mentioned phpBB, which has a history of poor security, but is there anything else?

I would also be a phenomenally good idea to either completely sever this computer from the internet or put up a firewall that prevents all access except SSH from a trusted IP.
 
1 members found this post helpful.
Old 10-17-2010, 02:36 PM   #4
Zippy1970
Member
 
Registered: Sep 2007
Posts: 119

Original Poster
Rep: Reputation: 17
Ok, going through all my log files, I found out where it came from. Apparently, one of my clients was testing a small mail script for one of his websites.

Guess I was just a little paranoid.
 
Old 10-17-2010, 05:43 PM   #5
Hangdog42
LQ Veteran
 
Registered: Feb 2003
Location: Maryland
Distribution: Slackware
Posts: 7,803
Blog Entries: 1

Rep: Reputation: 422Reputation: 422Reputation: 422Reputation: 422Reputation: 422
Quote:
Originally Posted by Zippy1970 View Post
Guess I was just a little paranoid.
That's probably a whole lot better than not being a little paranoid. Maybe you should look into something like Aide or Samhain, either of which would monitor your file system for changes. It might help tracking down issues like this in the future.
 
  


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
STRANGE:mailserver receives mails but is not able to send mails outside nics Linux - Server 1 05-04-2007 12:44 AM
Receiving e-mails from members Mega Man X LQ Suggestions & Feedback 7 01-26-2007 12:35 AM
Receiving mails using sendmail mageshbabu.m Linux - Networking 2 01-19-2006 03:00 PM
Server Comprimised... Need to select new OS? defa0009 Linux - Security 6 05-15-2005 10:31 AM
Problems in receiving mails dominant Linux - Newbie 2 01-14-2004 02:32 PM

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

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