Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Qmail: users

Thousands of Bounces From Forged From Field

 

 

Qmail users RSS feed   Index | Next | Previous | View Threaded


alex.kirk at sourcefire

Apr 23, 2008, 11:32 AM

Post #1 of 15 (576 views)
Permalink
Thousands of Bounces From Forged From Field

I run a server that's currently on the unlucky receiving end of several
thousand bounce messages per day due to some spammer or group thereof
forging valid addresses at my domain into the From: field of their spam.
While it's not causing my server any real problems (unmetered bandwidth
+ plenty of available system resources is a good combination), it's
annoying as all get-out, especially for some of my poor users who are
receiving these bounces (and don't have the patience gained from ~8
years of running a public mail server to help them weather the storm).

Given that I'd like to actually receive any legitimate bounce messages
sent to these addresses, I realize that the likelihood of there being a
good solution for filtering out all of this garbage is pretty low.
However, I figure it's worth asking here, just in case someone has
gotten irritated enough with a situation like this to come up with a
tool I could use to fight this mess. Even any pointers on header fields
I could use in combination with mail filtering software would be great.

Thanks in advance for your help (or, more likely, sympathy).

Alex Kirk


mail at oliwel

Apr 23, 2008, 12:02 PM

Post #2 of 15 (560 views)
Permalink
Re: Thousands of Bounces From Forged From Field [In reply to]

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Alex,

Alex Kirk schrieb:
> I run a server that's currently on the unlucky receiving end of several
> thousand bounce messages per day due to some spammer or group thereof
> forging valid addresses at my domain into the From: field of their spam.
> While it's not causing my server any real problems (unmetered bandwidth
> + plenty of available system resources is a good combination), it's
> annoying as all get-out, especially for some of my poor users who are
> receiving these bounces (and don't have the patience gained from ~8
> years of running a public mail server to help them weather the storm).
>
> Given that I'd like to actually receive any legitimate bounce messages
> sent to these addresses, I realize that the likelihood of there being a
> good solution for filtering out all of this garbage is pretty low.
> However, I figure it's worth asking here, just in case someone has
> gotten irritated enough with a situation like this to come up with a
> tool I could use to fight this mess. Even any pointers on header fields
> I could use in combination with mail filtering software would be great.

I had this situation some time ago and even if I didnt finish my
thoughts, as the "wave" was over faster than my solution, I want to
outline my idea :)

I just hacked the Outgoing Mailserver which my customers use to send
mail to the internet and recorded Sender/Receipient pairs. Now, when a
bounce arrives, you just have to check out, if a mail was send to this
domain before.
I played around with regexp and some Spamassasin Modules to find the
original receipient adress from the bounce body, which I did
successfully for almost all of those mails. I wont use this as a 100%
criteria but putting it into any other kind of Anti-Spam System might
help you out - but this was exactly the point where I stopped working on...

Oliver

- --
Protect your environment - close windows and adopt a penguin!
PGP-Key: 3B2C 8095 A7DF 8BB5 2CFF 8168 CAB7 B0DD 3985 1721
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.7 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFID4etyrew3TmFFyERAnmRAJ9Bvj3tRZIUTt0nAk5VVk3D2wKbaQCfSfDP
hWmQYDiyVgRHOrCT7509KW8=
=c+CZ
-----END PGP SIGNATURE-----


kyle-qmail at memoryhole

Apr 23, 2008, 12:04 PM

Post #3 of 15 (558 views)
Permalink
Re: Thousands of Bounces From Forged From Field [In reply to]

On Wednesday, April 23 at 02:32 PM, quoth Alex Kirk:
> I run a server that's currently on the unlucky receiving end of several
> thousand bounce messages per day due to some spammer or group thereof
> forging valid addresses at my domain into the From: field of their spam.
> While it's not causing my server any real problems (unmetered bandwidth +
> plenty of available system resources is a good combination), it's
> annoying as all get-out, especially for some of my poor users who are
> receiving these bounces (and don't have the patience gained from ~8 years
> of running a public mail server to help them weather the storm).

That sounds awfully familiar! I feel your pain. :)

> Given that I'd like to actually receive any legitimate bounce
> messages sent to these addresses, I realize that the likelihood of
> there being a good solution for filtering out all of this garbage is
> pretty low. However, I figure it's worth asking here, just in case
> someone has gotten irritated enough with a situation like this to
> come up with a tool I could use to fight this mess. Even any
> pointers on header fields I could use in combination with mail
> filtering software would be great.

Well, it all depends on what you decide to call "good".

For example, coming up with a simple BATV system is relatively easy,
but can confuse some users. Here's the idea: since qmail separates all
deliveries into separate attempts, it's pretty straightforward to
create a qmail-remote wrapper that will modify the envelope sender on
a per-recipient basis. You can then create envelope sender addresses
that map to the real envelope sender in some way. A trivial example
would be, if user[at]yourdomain is sending to recip[at]otherdomain,
transform the return address into user-otherdomain[at]yourdomain (or
better yet, user-`hash(otherdomain)`@yourdomain). Then all you do is
create a qmail-queue wrapper so that email addressed to those BATV
addresses gets its recipient rewritten back to the "real" address
(user[at]yourdomain)---and you can simply reject all messages without
senders that are addressed to user[at]yourdomain, because any *real*
bounce would be addressed to user-otherdomain[at]yourdomain. This is easy
for spammers to game, if they ever realize what you're up to (which,
depending on how idiosyncratic your system is, may be particularly
unlikely), so you can add an additional quirk: use random numbers.
Thus, outbound sender addresses become user-RANDOM[at]yourdomain; the
only trick is that you have to do something like insert that randomly
generated tag into a database so that you can verify it whenever you
receive a bounce to it. And then, of course, you've got all the
problems of database management (performance, maintenance,
tag-expiration, etc.) -- all of which are very solvable, just a bit of
a pain. The upside of this kind of system is that it virtually
eliminates faked bounces. The downside is that it can have annoying
interactions with systems that rely on predictable envelope senders
(such as mailing lists).

If that's not "good", then the best you can do is something like
DomainKeys (or, more problematically, SPF), which should allow other
systems to validate your emails and ignore invalid ones. The only
problem with this idea? Most systems don't do it, so it doesn't really
help much with the bounce problem in real life (they're often better
at tasks like protecting your users from phishing attempts).

~Kyle
--
Look, I can surely say by now that I've got the antibodies to
communism inside me. But when I think of consumer society, with all
its tragedies, I wonder which of the two systems is better.
-- Pope John Paul II, 1979


safari-qmail at safari

Apr 23, 2008, 12:11 PM

Post #4 of 15 (560 views)
Permalink
Re: Thousands of Bounces From Forged From Field [In reply to]

On Wed, Apr 23, 2008 at 14:32:05 -0400, Alex Kirk wrote:
...
> Given that I'd like to actually receive any legitimate bounce messages
> sent to these addresses, I realize that the likelihood of there being a
> good solution for filtering out all of this garbage is pretty low.

Untrue. All you have to do is use different envelope sender
in MAIL FROM [1] than in message From/Reply-To header field [2].

[1] this email accepts only emails with envelope sender <>
[2] this email accepts only emails with envelope sender != <>
also does not accept automatically generated emails/spams, such as:
http://qmail.safari.iki.fi/dl/qmail-pcre-autosubmit.txt
http://qmail.safari.iki.fi/dl/qmail-pcre-antiantivirus.txt
Obviously, if you have for some odd reason subscribed [2] into
million mailing lists and so on, you are (more) screwed, but
situation can be fixed with time and patience. Or you can
just do the envelope sender check.

email [1] can be generated automatically by qmail-send,
or you can "hardcode" it.

If you can code C, you can make needed modifications to qmail-send
or borrow code from
http://qmail.safari.iki.fi/qmail-1.03-safari-latest.diff.bz2
keyword is "ABBS".

Unfortunately, some idiots do not follow RFCs or common sense,
so you have to make special cases for them (this is called "whitelisting").

--


hanche at math

Apr 23, 2008, 12:14 PM

Post #5 of 15 (560 views)
Permalink
Re: Thousands of Bounces From Forged From Field [In reply to]

+ Alex Kirk <alex.kirk[at]sourcefire.com>:

> Given that I'd like to actually receive any legitimate bounce
> messages sent to these addresses, I realize that the likelihood of
> there being a good solution for filtering out all of this garbage is
> pretty low.

The strategy I have been using for quite some while is to use an
envelope sender different from my regular email address. Any bounce
messages sent to my regular address are discarded unread, since I know
they aren't legitimate. (Or aren't supposed to be; there are broken
mail systems out there sending bounces to the wrong address, but I
don't feel obligated to cater to those.)

This won't help you in your current predicament of course ...

- Harald


safari-qmail at safari

Apr 23, 2008, 12:38 PM

Post #6 of 15 (559 views)
Permalink
Re: Thousands of Bounces From Forged From Field [In reply to]

On Wed, Apr 23, 2008 at 14:04:57 -0500, Kyle Wheeler wrote:
...
> would be addressed to user-otherdomain[at]yourdomain. This is easy for
> spammers to game, if they ever realize what you're up to (which,
> depending on how idiosyncratic your system is, may be particularly
> unlikely), so you can add an additional quirk: use random numbers. Thus,
> outbound sender addresses become user-RANDOM[at]yourdomain; the only trick
> is that you have to do something like insert that randomly generated tag
> into a database so that you can verify it whenever you receive a bounce

You do not need a database.
Just do it like in ABBS.

--


kyle-qmail at memoryhole

Apr 23, 2008, 2:28 PM

Post #7 of 15 (557 views)
Permalink
Re: Thousands of Bounces From Forged From Field [In reply to]

On Wednesday, April 23 at 10:38 PM, quoth Sami Farin:
>On Wed, Apr 23, 2008 at 14:04:57 -0500, Kyle Wheeler wrote:
>...
>> would be addressed to user-otherdomain[at]yourdomain. This is easy for
>> spammers to game, if they ever realize what you're up to (which,
>> depending on how idiosyncratic your system is, may be particularly
>> unlikely), so you can add an additional quirk: use random numbers. Thus,
>> outbound sender addresses become user-RANDOM[at]yourdomain; the only trick
>> is that you have to do something like insert that randomly generated tag
>> into a database so that you can verify it whenever you receive a bounce
>
>You do not need a database.
>Just do it like in ABBS.

I saw your code, and I see the "ABBS" string, but I've never heard of
ABBS before (neither has google). If you are creating some sort of
"signature" that can later be verified (and is presumably hard to
forge), then you're correct that a database is unnecessary. If you're
just using random numbers (as I said), then you need some way to
verify them, and a database of some kind is the most obvious method.
These are two *different* techniques; usually, predicting (or forging)
a random number is harder than forging a signature, so it's just a
matter of trade-offs (cryptographic verification rather than
storage-based verification; which is better depends on what the costs
are and how worried you are about forgery).

~Kyle
--
The government is like a baby's alimentary canal, with a happy
appetite at one end and no responsibility at the other.
-- Ronald Reagan


safari-qmail at safari

Apr 23, 2008, 2:48 PM

Post #8 of 15 (556 views)
Permalink
Re: Thousands of Bounces From Forged From Field [In reply to]

On Wed, Apr 23, 2008 at 16:28:02 -0500, Kyle Wheeler wrote:
> On Wednesday, April 23 at 10:38 PM, quoth Sami Farin:
>> On Wed, Apr 23, 2008 at 14:04:57 -0500, Kyle Wheeler wrote:
>> ...
>>> would be addressed to user-otherdomain[at]yourdomain. This is easy for
>>> spammers to game, if they ever realize what you're up to (which,
>>> depending on how idiosyncratic your system is, may be particularly
>>> unlikely), so you can add an additional quirk: use random numbers.
>>> Thus, outbound sender addresses become user-RANDOM[at]yourdomain; the
>>> only trick is that you have to do something like insert that randomly
>>> generated tag into a database so that you can verify it whenever you
>>> receive a bounce
>>
>> You do not need a database.
>> Just do it like in ABBS.
>
> I saw your code, and I see the "ABBS" string, but I've never heard of
> ABBS before (neither has google). If you are creating some sort of

http://groups.google.com/group/news.admin.net-abuse.email/msg/95fe8dff51ea0d53?dmode=source

> "signature" that can later be verified (and is presumably hard to
> forge), then you're correct that a database is unnecessary. If you're
> just using random numbers (as I said), then you need some way to verify
> them, and a database of some kind is the most obvious method. These are
> two *different* techniques; usually, predicting (or forging) a random
> number is harder than forging a signature, so it's just a matter of

Currently, guessing the HMAC-SHA1 is equivalent to guessing
a random number.

> trade-offs (cryptographic verification rather than storage-based
> verification; which is better depends on what the costs are and how
> worried you are about forgery).

There is no need to involve databases in this kind of case
(overengineering).

--


jbacksch-qmail at tca-os

Apr 23, 2008, 11:07 PM

Post #9 of 15 (547 views)
Permalink
Re: Thousands of Bounces From Forged From Field [In reply to]

Alex Kirk wrote:

> I run a server that's currently on the unlucky receiving end of several
> thousand bounce messages per day due to some spammer or group thereof
> forging valid addresses at my domain into the From: field of their spam.

A typical backscatter syndrome
(<http://en.wikipedia.org/wiki/Backscatter_(e-mail)>) :-(

You can use Bounce Address Tag Validation (BATV)
(<http://mipassoc.org/batv/>) to avoid backscatter. There´s a patch to
implement BATV in qmail
(<http://mipassoc.org/pipermail/batv-tech/2007q4/000032.html>). But
there are some issues with greylisting because of the vary of the
envelope sender. I use this patch by myself.

--
Greetings
Jörg Backschues


jbacksch-qmail at tca-os

Apr 23, 2008, 11:25 PM

Post #10 of 15 (547 views)
Permalink
Re: Thousands of Bounces From Forged From Field [In reply to]

Sami Farin wrote:

>> I saw your code, and I see the "ABBS" string, but I've never heard of
>> ABBS before (neither has google).

> http://groups.google.com/group/news.admin.net-abuse.email/msg/95fe8dff51ea0d53?dmode=source

ABBS sounds very similar to BATV.

To get an overview look at:
<http://research.mince.ac.nz/NZNOG_2007_Dealing_With_Joe_Jobs.ppt>

--
Greetings
Jörg Backschues


safari-qmail at safari

Apr 24, 2008, 4:21 AM

Post #11 of 15 (540 views)
Permalink
Re: Thousands of Bounces From Forged From Field [In reply to]

On Thu, Apr 24, 2008 at 08:25:35 +0200, Joerg Backschues wrote:
> Sami Farin wrote:
>
>>> I saw your code, and I see the "ABBS" string, but I've never heard of
>>> ABBS before (neither has google).
>
>> http://groups.google.com/group/news.admin.net-abuse.email/msg/95fe8dff51ea0d53?dmode=source
>
> ABBS sounds very similar to BATV.

Of course it does. BATV idea is based on ABBS.

--


alex.kirk at sourcefire

Apr 24, 2008, 5:36 AM

Post #12 of 15 (538 views)
Permalink
Re: Thousands of Bounces From Forged From Field [In reply to]

>> I run a server that's currently on the unlucky receiving end of
>> several thousand bounce messages per day due to some spammer or group
>> thereof forging valid addresses at my domain into the From: field of
>> their spam.
>
> A typical backscatter syndrome
> (<http://en.wikipedia.org/wiki/Backscatter_(e-mail)>) :-(
>
> You can use Bounce Address Tag Validation (BATV)
> (<http://mipassoc.org/batv/>) to avoid backscatter. There´s a patch to
> implement BATV in qmail
> (<http://mipassoc.org/pipermail/batv-tech/2007q4/000032.html>). But
> there are some issues with greylisting because of the vary of the
> envelope sender. I use this patch by myself.
>
First off, thanks to everyone who's replied. I guess a lot of you feel
my pain, judging from all of the help being offered.

That said, I've got one additional consideration that I forgot to
mention in my original e-mail that, according to the way I'm reading
things anyway, will probably be relevant. Given that the addresses being
forged are things like webmaster@, info@, etc. -- which receive a decent
amount of normal inbound mail -- I'd need to selectively enforce things
like BATV, etc. on bounce messages only, and let through normal mail (at
least to the point that it hits a spam filtering solution, anyway).

Perhaps I've missed something in the avalanche of material that you all
have sent, but thus far I'm not sure it's possible to set things up like
that. Am I missing something here?

Thanks,
Alex Kirk


conover at rahul

Apr 24, 2008, 7:47 AM

Post #13 of 15 (539 views)
Permalink
Re: Thousands of Bounces From Forged From Field [In reply to]

Alex Kirk writes:
>
> >> I run a server that's currently on the unlucky receiving end of
> >> several thousand bounce messages per day due to some spammer or group
> >> thereof forging valid addresses at my domain into the From: field of
> >> their spam.
> >
> First off, thanks to everyone who's replied. I guess a lot of you feel
> my pain, judging from all of the help being offered.
>
> That said, I've got one additional consideration that I forgot to
> mention in my original e-mail that, according to the way I'm reading
> things anyway, will probably be relevant. Given that the addresses being
> forged are things like webmaster@, info@, etc. -- which receive a decent
> amount of normal inbound mail -- I'd need to selectively enforce things
> like BATV, etc. on bounce messages only, and let through normal mail (at
> least to the point that it hits a spam filtering solution, anyway).
>
> Perhaps I've missed something in the avalanche of material that you all
> have sent, but thus far I'm not sure it's possible to set things up like
> that. Am I missing something here?
>

If you use procmail(1) for your delivery agent, checking for a
Return-Path: of "<>", (RFC 1123, 5.3.3,) and a To: of
"(info|webmaster|etc.)@mydomain.com", (RFC 2142, 2-6,) will detect
illicit bounces to addresses that never send email, (and thus could
never generate a bounce.)

Also, email addresses on user's web pages, (or business cards, etc.,)
should never be in a From: header record, either. (The qmail dash
account handling is helpful there.)

John

--

John Conover, conover[at]rahul.net, http://www.johncon.com/


oexel at economatica

Apr 25, 2008, 4:14 AM

Post #14 of 15 (528 views)
Permalink
Re: Thousands of Bounces From Forged From Field [In reply to]

Alex Kirk wrote:
> I run a server that's currently on the unlucky receiving end of several
> thousand bounce messages per day due to some spammer or group thereof
> forging valid addresses at my domain into the From: field of their spam.

One user sent me a copy of one of the bounce-messages he received; I
noticed that the spammer is using his email address but *not* his name;

inside the body of the bounce message, instead of the usual:

From: Jonh Whatsthename <johnw[at]example.com>

the copy he sent me had a line like

From: "ax rowan" <johnw[at]example.com>

I agree using this to spot "bad" bounces could generate some
false-positives; in case spammers start tracking names along with
addresses this could generate many (not just "some") false positives but
no "good" bounce will be discarded;

am I being too naïve here?

[]s,

--
Otavio Exel /<\oo/>\ oexel[at]economatica.com.br


sgifford at suspectclass

Apr 25, 2008, 7:52 AM

Post #15 of 15 (513 views)
Permalink
Re: Thousands of Bounces From Forged From Field [In reply to]

Otavio Exel <oexel[at]economatica.com.br> writes:

> Alex Kirk wrote:
>> I run a server that's currently on the unlucky receiving end of several
>> thousand bounce messages per day due to some spammer or group thereof
>> forging valid addresses at my domain into the From: field of their spam.
>
> One user sent me a copy of one of the bounce-messages he received; I
> noticed that the spammer is using his email address but *not* his name;
>
> inside the body of the bounce message, instead of the usual:
>
> From: Jonh Whatsthename <johnw[at]example.com>
>
> the copy he sent me had a line like
>
> From: "ax rowan" <johnw[at]example.com>
>
> I agree using this to spot "bad" bounces could generate some
> false-positives; in case spammers start tracking names along with
> addresses this could generate many (not just "some") false positives but
> no "good" bounce will be discarded;
>
> am I being too naïve here?

My experience is that the full name part of a From address varies
somewhat, especially if users read mail from a few different places.
Sometimes it will be missing, and different messages sometimes contain
variations (or occasionally misspellings) of the user's name.

Still, no legitimate message is likely to have the name "ax rowan", so
there's probably a useful spam heuristic in that idea somewhere. It's
definitely worth experimenting with.

-----Scott.

Qmail users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.