euglug.org

[Eug-lug] Quick And Dirty Network Profiling

작성자

카테고리:



Cory PetkovsekTue Sep 7 15:06:34 PDT 2004

On Tue, Sep 07, 2004 at 01:11:42PM -0700, Jason Van Cleve wrote:
> First off, I am not a system admin', but I rent a server on
> SprocketData.  Normally, I use about 0% of my included bandwidth, but
> last month I used nearly ten gig's, around nine of which were consumed
> between August 17th and August 19th.  The trend this month is also
> disturbing.  So evidently I've picked up some species of parasite.

The other suggestions are good.  Look at your logs, they will give you
the best clues of what happened.  Monitors mean you have to wait to be
abused again.  If you use postfix use pflogsumm to analyze your logs.
There are other log performance monitors for apache, ftp and other mail
servers.  Look at awstats, it will graph not only apache but also mail
servers.

> So I'm guessing someone has figured out how to spam through my SMTP
> relay, but with so much spam bouncing around, it's hard to tell from my
> mail logs what's going on.  I'm just not sure how to diagnose this, and
> I'd appreciate some pointers.

Why do you have an smtp relay?  That's usually not a good thing to have.

> I run postfix 1.1.11 on this Mandrake 9.1.I.think
> system.  
Ah, good, get pflogsumm and run it on your old log files.  If you see a
day that has 100,000 emails sent, that is indicative of a problem.  It
will tell you that yes, you are being used to spam.  Now figure out how
it got in.  Trace it back to your first emails, note the times, ip
addresses, etc.  Post these if necessary.  

My servers were being used to send spam a while back.
Turned out I had made an error in my contact form on my webpage.  I
inserted tainted strings into mail headers sent directly to
/usr/lib/sendmail.  What that means is that I took user input and
directly put it in my email:
    open MAIL, "|/usr/lib/sendmail -t"
    print MAIL, "From: $email_from";
    print MAIL, "To: support at adaptableit.com\n";
    print MAIL, "Subject: Support Request\n";
    print MAIL, "$message";

The problem is that a user input variable like $email_from could contain
a new line and a line that says "To: 1 at aol.com, jobe at aol.com,
carol at aol.com..." and that's exactly what it did.

> For all I know, it could be one of my few mail users trying to
> send a really big attachment, or something like that, but I rather
> suspect it's a spammer.
A 10 gig attachment?

Cory

-- 
Cory Petkovsek                                       Adapting Information
Adaptable IT Consulting                                Technology to Your
(858) 705-1655                                                   Business
cory at AdaptableIT.com                                  www.AdaptableIT.com