Stopping Spam And Trojan Horses With BSD 54
Brett Glass writes: "This paper, first presented at BSDCon 2000, describes state of the art methods of blocking spam and malware using BSD and Sendmail. The techniques described here are also applicable to other operating systems and mail transfer agents, so this paper is worth reading even if you're using NT, Linux, Postfix, qmail, etc. If you've never heard of a Rumplestiltskin attack, are baffled by the finer points of Sendmail configuration, or want to know how to block worms like ILOVEYOU before they reach vulnerable Windows clients, you'll enjoy this paper. Slides from the presentation are also included."
Great paper (Score:1)
Adding RSS lookups has been the biggest spam killer so far. The first week I had it enabled I was rejecting about 1200 spams a day. Now that the bigger spammers know they can't steal from me so easily, it's down under 100 per day.
The next step is procmail for filtering malware.
. Thanks
- H
Re:Sendmail and RBL Lists (Score:1)
I'm also interested in this, but I never knew it until you brought it up. It would be very easy for the users to setup a mail filter to move all subjects with '[SPAM]' in the subject to dev/null. It seems that inserting it into the subject line would be much more compatible to all mail readers than custom headers.
Re:Sendmail and RBL Lists (Score:1)
I looked into this at some length at my previous job, where we couldn't just drop spam in the bit-bucket for policy reasons, but wanted to identify spam so that users could easily filter it out themselves if they wanted to.
The ideal solution would be something like:
H?Spam?X-Spam: ${RBL} ${ORBS} ${DUL}
where the variables ${Spam}, ${RBL}, ${ORBS}, etc. are set by the standard rulesets. This way, those messages identified as spam would have an X-Spam: header providing more details. Normal messages would be passed unchanged.
Unfortunately, it appears to be impossible to set a variable from inside a ruleset (please tell me if I'm wrong), so this doesn't work.
The next best thing would be
HX-Spam: $>CheckSpam
which would add an X-Spam: header to every message, the value of which would be whatever is returned by the CheckSpam ruleset. Unfortunately, it looks as if sendmail 8.10.2 doesn't allow you to invoke rules from within header definition lines. Brett Glass's article hints otherwise (see Listing 2), but perhaps he's using a newer version of sendmail than I am.
Oz Explained (Re:It's not always just Linus) (Score:1)
There is no separation of kernel and userland in BSD in the same way that there is in a Linux Distribution. There are no "package maintainers" because it isn't a package-based distribution. Everything that makes up the system is engineered by the same team of people. It's all in a single source tree under
(Not counting third party applications available via Packages or Ports of course.)
Re:Trap for harvesters. (Score:1)
That was mentioned in a wee little paragraph near the end of the "Web Page Address Harvesting" section, and included some simple sample CGI [turnstep.com].
Re:Sendmail and RBL Lists (Score:1)
The change you will need to make is on line 24 of cf/feature/ddnsbl.m4. Somehow you are going to
have to figure out to to get a header added when a condition happens and then return $: OK. I think I would try to set some variable and then create a "H" line with something like H?Var?X-spam: $Var.
Use a non-filtered domain (Score:1)
When the users need to communicate with those using open relays, give them an account with no spam filters.
Re:It's not always just Linus (Score:1)
--------
Genius dies of the same blow that destroys liberty.
Re:BSD security sucks (Score:1)
> Compared to what OS?
Why, Windows 95, of course!
--------
Genius dies of the same blow that destroys liberty.
Re:Grammar (Score:1)
--------
Genius dies of the same blow that destroys liberty.
Re:OS/2 and sendmail (Score:1)
For instance, I just put PMVNC, ported from the Open source code on my OS/2 machine, which I used to access a Linux box and a Win2k box 90 miles from here. I also used a SSH port to access the linux box. I have had a port of NcFTP for a long time on the machine.
There is also an OS/2 ISP mailing list where they discuss Sendmail usage, SPAM, and a lot of other things; I also participate in that list.
You can find most of this stuff for OS/2 at http://hobbes.nmsu.edu [nmsu.edu]. Xfree86 and Samba links for OS/2 can also be found at their respective sites.
Re:Question about spam filtering (Score:1)
To demonstrate the difference, we run Lotus Notes at work. I have used it for about 5 years. And love it. But often the initial impression a person may have might not approach my fondness or that of the others at work. That is just because you don't know it.
But hear this: When the "I Love You" thing hit, we might have had 75 infected machines [total] out of over 10,000. We were virutally unaffected. And that was the first hit by the virus. It did NOT spread. And as soon as we knew it was there, a tweak of Notes prevented a user from sending it anywhere.
OTOH, I know for a fact that some companies that we deal with were completely down for a week or more trying to fix the mess.
The upside is that Notes is just very reliable and good. Exchange isn't. BTW, we merged with another company of similar size, who was using Exchange. They are converting to Notes right now.
Re:Sendmail and RBL Lists (Score:1)
Dear god (Score:1)
How sad. Trolls with no families or friends to keep them company on Xmas, so they resort to posting crap and nonesense on
You've trolled this before (Score:1)
Yet, all you do is keep repeating the same things over and over.
When you have some links to back up these claims, please post them.
Re:BSD security sucks (Score:1)
Compared to what OS?
Re:NSA: "*BSD is dying" (Score:1)
*yawn*
Come back with proof!
Oh, no! Not acne-faced part-time HS students! (Score:1)
If you're in this situation, you're in big trouble no matter what MTA you're using.
Sendmail's code isn't as bad as you paint it, though. Thousands of pairs of experienced eyes have pored over it -- certainly more than for any other MTA.
If you really are concerned about Sendmail, wrap it with smtpd [brettglass.com] or use qmail [qmail.org]. Warning: you'll still need to understand the underlying principles to control relaying and block spam and malware. And don't assume that it will necessarily be that much easier. as this FAQ [summersault.com] explains, using spam prevention tools such as DNS blacklists with qmail is more complex than doing it with Sendmail (which requires only one line per blacklist in your .mc file).
--Brett
qmail anti-spam FAQ (Score:1)
--Brett
GMAB! "BSD is Dead" msgs are silly and off-topic (Score:1)
Really, guys -- the "BSD is dead" trolls are getting very, very old. BSD is here for keeps and is gaining in popularity; it's not going away just because a few overzealous advocates of other OSes are in denial. Besides, as I've mentioned, every technique I've mentioned in the paper -- even the Sendmail configuration options, which have equivalents in most other MTAs -- is useful on other OS platforms and with other mail software. So, even if you're a total Linux (or qmail, or exim, or Lotus Notes, or Groupwise) fanatic, you still need to know these techniques to be a good sysadmin. I'd like to see more discussion of filtering techniques.... Even the state of the art filters and HTML manglers are nowhere near perfect yet.
--Brett Glass
Are you sure that spam is really from Yahoo? (Score:1)
If your ISP will let you run Procmail filters (most UNIX-based ones will), your best bet is to set up a Procmail filter which checks the RBL and also looks for other signs of spam. I recommend a couple in the paper.
--Brett
hrm. (Score:1)
finger stream tcp nowait nobody
BSD inetd will allow you to write stuff in the hosts.allow file for example
fingerd : ALL \
: severity auth.info \
: twist
Re:It's not always just Linus (Score:1)
Re:*BSD is dying (Score:1)
Re:BSD security sucks (Score:1)
Article on Daemon News (Score:1)
Re:this is motherfucking bullshit (Score:1)
Sendmail and procmail run under linux and that is what the article is about.
BSD is as dead as Unix is (Score:1)
- Hubert
Re:Pretty sad... (Score:1)
Malware? (Score:1)
Thank you (Score:1)
I have had a few too many for most of this to stick right now, but this is definitely a good asset to have.
Again, Thank You
Re:I hear you, buddy. (Score:1)
My Hi-fi _maxes out_ at -0, and is silent at -Inf.
Does that mean it plays my music backwards?
Calm down pet.
Merry Chrissy all.
FatPhil
-- Real Men Don't Use Porn. -- Morality In Media Billboards
Re:I hear you, buddy. (Score:1)
Re:The Death of *BSD (Score:1)
Re:Can you still spoof "FROM" if you want to? (Score:1)
UNIX (Score:1)
It does already have a better name. It's called "Unix".
8^}
BSD? (Score:1)
Ashes of Empires and bodies of kings,
Re:I hear you, buddy. (Score:1)
Re:Pretty sad... (Score:1)
It's not always just Linus (Score:2)
Cardinal explained (Score:2)
Most security exploits are in userland daemons, not the kernel itself.
...in Linux.
Which is a response to the comment by Oz:
normaly when an exploit is found in *BSD it is typicaly fixed faster than in linux just because how they have 'there system of makeing the system' setup. They have a core team that can say 'yeah we need this' or 'no' and in linux its just linus.
I was pointing out that "its just linus" is usually not the case, because such exploits tend to be in userland, not the kernel.
Pretty sad... (Score:2)
I just realized how sad it is that I am actually reading this article at 11:20 pm on Christmas Eve, and enjoying it. Then I realize that Hemos actually posted it about the same time... :)
Great Article. Merry Christmas and Happy Holidays to all!
Re:Pretty sad... (Score:2)
as a side note, careful what ya say to Hemos, he is a soft fellow, we all know the Cmdr can take it, but old Hemos doesn't stand up as well to it. (Where is Taco anyway? that lazt sack hasn't posted since yesterday morning!)
Merry Christmas All.
Re:BSD security sucks (Score:2)
Sendmail and RBL Lists (Score:2)
The reason behind this, is to allow users to choose whether to filter or not. Some usere here have contact to ppl on open-relay hosts, and I would like to block them
Samba Information HQ
Re:ive never used a BSD program (Score:2)
Sendmail is another example of BSD derived code.
Oh, how about the TCP/IP stack? the include file for in_systm.h says "Original taken from BSD UNIX 4.3-RENO"
If you'd bother to grep for BSD in the linux kernel, you'd find that BSD is core to Linux.
And you 'use' a "BSD" program to get to slashdot. Yup, the OpenBSD firewall that is (was) protecting the site.
Re:Malware? (Score:2)
--Brett
Re:Article on Daemon News (Score:2)
--Brett
Re:Article on Daemon News (Score:2)
That's because the craven Greg Lehey quoted me without attribution.
--Brett Glass
Re:Why? Because they're in different markets (Score:2)
;-)
just a thought.
(but good point tho)
Re:Pretty sad... (Score:3)
*Gets up and walks away*
*5 minutes pass*
*Running sounds back to the computer*
I'm so sorry everybody, please forgive me, it's christmas, and i was so wrapped up over the presents that i wasn't thinking properly. Taco, you rule, Hemos, you're dedicated and I swear I'll never do anything like that again...till the next time :-)
seriously merry xmas all...
Trap for harvesters. (Score:4)
Look here [roaringpenguin.com].
Feh. (Score:5)
The referenced article starts with a particularly ridiculous bit of advocacy that renders the rest of it fairly dubious. It recommends sendmail on the basis of market penetration, but carefully avoids mentioning its security vulnerabilities and accumulation of cruft; it then makes a contrived argument that, since sendmail was developed on a BSD box, it should be run on the same. Nonsense. sendmail works equally poorly on many Un*x variants; there's nothing special about BSD in that regard.
Why should we judge sendmail on its market penetration but avoid judging BSD in the same way? The paper doesn't bother to justify that. I expect its author(s) figured on a sympathetic audience of BSD advocates.
If you really want to avoid being screwed, run a better MTA -- qmail and exim are reasonable choices. BSD is of course a reasonable choice of OS for that job, as are a number of Un*ces. But don't pick BSD because it will run sendmail -- that's like buying a Colt M1911A1 because it can be converted to full auto. The choice of platform is good, but the reasoning stinks!
--
filtering on the message body (Score:5)
I've got a patch [abnormal.com] to fix this for 8.11.1 that uses the built in regex map to allow sendmail to look for a regex in the body of the message.