July 11, 2003 @ 7:30PM, General Meeting
Speakers:
M.E.: What is spam? (problems with these)
M.E.: What is ham?
Grey Areas:
Ideal is to receive no spam in your inbox, no network traffic from spam
and no false positives. Unfortunately, this probably isn't possible.
If you can, you want to let spam use as few resources as possible.
If your machine accepts the mail (layer 6+) you want to do your best to identify the
mail as spam, usually placing it into a special inbox that you only review
occassionally.
| Total Block | Manual Lists | Automatic Lists | Static Analysis | Dynamic Analysis | Other | |||
|---|---|---|---|---|---|---|---|---|
| You wish or 100% false positive | You update; whitelists; blacklists; both. | Everybody updates | Coded heuristics | Intelligent updating | Mostly designed to raise spammers' costs above 50/cent | |||
| layer 0: | Before they even try to spam you | Don't do email. Don't give your address to spammers. Make it hard to automatically figure out your address. Make the address temporary. |
||||||
| layer 1/2 (physical/link): | Impractical, Difficult or Impossible. | Unplug your net cable: no email, no spam. Unplug spammer: moves or replaced. |
||||||
| layer 3 (network (IP)): | Good for spam havens; Invisible; no transfer; bounces. | IP via iptables/ipchains. | RBL, DUL, SPEWS, ORBS in routing table (etc.). | tarpitting techniques. | ||||
| layer 4 (transport (TCP)): | Spam havens; Visible; no transfer; bounces. | hosts.allow, mail/access or similar MTA mechanisms. | RBL, DUL, SPEWS, ORBS in MTA (refuse connection). | |||||
| Total Block | Manual Lists | Automatic Lists | Static Analysis | Dynamic Analysis | Other | |||
| layer 5 (session (SMTP)): | Individual email addresses or entire domains. Good for "legit" spammers. Visible; minimal transfer; bounces. | mail/access. | uncommon (easy to forge); easynet | naive rules looking for "spammer-like" addresses. | soft rejects | |||
| layer 6 (presentation (email headers)): | Giveaway headers, incorrect headers, obvious subjects. Less effective as spammers get smarter. "Legit" spammers often easier. Transfer; no bounce. | Greylists. | Shared online lists of spam checksums; Razor, Pyzor, etc. |
Rules-based analysis; procmail, spamassassin | Bayesian analysis | |||
| layer 7 (application (body)): | HTML mail; advertising phrases, disguised URLs, etc. Transfer; no bounce. | Reply required: TMDA. Inconvenient for legit senders | ||||||
| layer 8 (social): | Laws, morals, ethics, shame and other non-computerized solutions | legislation; imperfect, non-universal, may supplement other techniques. Worst spammers could get imprisoned. "Legit" spammers might include filterable giveaways. |
Hire a human; almost perfect | |||||
| Total Block | Manual Lists | Automatic Lists | Static Analysis | Dynamic Analysis | Other | |||
For each category provide an example app/tool
Also cover what these are:
Something about how Bayes works.
F.B, M.E.: Prevention <F.B.>
Received: from pop.sonic.net [209.204.190.2]
by localhost with POP3 (fetchmail-5.9.11)
Received: from 12-249-60-91.client.attbi.com (12-249-60-91.client.attbi.com [12.249.60.91])
by turbo.sonic.net (8.11.6p2/8.8.5) with SMTP id h5RDb2f08984
Received: from nortelnetworks.com (lsanca2-ar37-4-62-193-080.lsanca2.dsl-verizon.net [4.62.193.80])
by sub.sonic.net (8.11.6p2/8.8.5) with SMTP id h5R9OjR13319;
Received: from 131.ts8.increments.net ([69.41.70.131])
by turbo.sonic.net (8.11.6p2/8.8.5) with SMTP id h5RAL8f30190
Received: from 61.84.0.139 (cs242770-143.houston.rr.com [24.27.70.143])
by sub.sonic.net (8.11.6p2/8.8.5) with SMTP id h5RN24g02665
Received: from rafgkcg (12-210-226-149.client.attbi.com [12.210.226.149])
by ultra.sonic.net (8.11.6p2/8.8.5) with SMTP id h5SGYor02370
Received: from 216.204.151.29 ([216.204.151.29])
by turbo.sonic.net (8.11.6p2/8.8.5) with SMTP id h5SJexp23730
Tools:
perl -MCPAN -e shell cpan> install Net::Ping Digest::MD5 Digest::SHA1 Digest::HMAC HTML::Parser HTML::Tagset IO::Stringy MIME::Base64 Mail::Internet MIME::Entity Net::DNS Time::HiRes Mail::Audit cpan> install Mail::SpamAssassin
:0fw | /usr/bin/spamassassinThough I prefer:
# spamassassin with autowhitelist :0fw | /usr/bin/spamassassin -a # /dev/null for score 25 and higher :0 * X-Spam-Level: \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* /dev/null # spambox for score 10 and higher :0 * X-Spam-Level: \*\*\* \*\*\* \*\*\* \* $HOME/Mail/spam/ # Default is regular inbox
# ~/.muttrc
# Makes these easier to run on multiple tagged messages:
set pipe_split
# Report spam and train bayes as spam; also deletes mail:
macro index \es "|spamassassin --report\nd"
macro pager \es "|spamassassin --report\nd"
# un-SPAM this one; either accidentally ran previous or SA thought it was
# spam:
macro index \ew "|spamassassin --revoke\n"
macro pager \ew "|spamassassin --revoke\n"
# ham and spam(junk). Run "sa-learn --rebuild" sometime later.
macro index h "|sa-learn --ham --no-rebuild --single\n"
macro pager h "|sa-learn --ham --no-rebuild --single\n"
macro index j "|sa-learn --spam --no-rebuild --single\n"
macro pager j "|sa-learn --spam --no-rebuild --single\n"
64.239.9.181 571 SPAM not welcome # 193.230.240.0/24 Romainia .ro 193.230.240 REJECT # APNIC - Pacific Rim 60 571 mail not accepted from 60., too much spam! 61 571 mail not accepted from 61., too much spam! userone@prodigy.net 571 Sociopaths not welcome! usertwo@aol.com REJECT virtual-biz.net 571 SPAM not welcome online-shop-exchange.com 571 SPAM not welcome
# APNIC - Pacific Rim
/\[(60|61)\./ REJECT
# 194.126.55.0 - 194.126.62.255 .kw Kuwait
/\[194\.126\.(5[5-9]|6[0-2])\./ REJECT
# 212.33.64.0/20 .pl Poland 212.33.64.0-212.33.79.255
/^\[212\.33\.(6[0-4]|7[0-9])\.[0-9]{1,3}\]$/ REJECT
# 212.154.160.0/20 212.154.160.0-212.154.175.255 KAZAKHSTAN .kz
/\[212\.154\.(16[0-9]|17[0-5])\./ REJECT
# 216.139.168.0 - 216.139.170.255 Nigeria NG
/\[216\.139\.(168|169|170)\./ REJECT
# client is IP address, known at time of connect
smtpd_client_restrictions = permit_mynetworks,
check_client_access hash:/etc/postfix/access-ip
#
# HELO/EHLO is what the sending machine *tells* your machine it
# is. It is easily spoofed and frequently mis-configured.
smtpd_helo_restrictions = check_helo_access hash:/etc/postfix/access
#
# Sender is the envelope-sender address, not the client
# machine's address or the "From:" field in the headers.
# (Though envelope-sender may well match "From:".)
smtpd_sender_restrictions =
check_sender_access regexp:/etc/postfix/regexp-sender
check_sender_access hash:/etc/postfix/access
#
# parameter "smtpd_recipient_restrictions": specify at least one working instance of:
# check_relay_domains, reject_unauth_destination or reject. Default:
# smtpd_recipient_restrictions = permit_mynetworks, check_relay_domains
smtpd_recipient_restrictions =
permit_mynetworks,
check_recipient_access regexp:/etc/postfix/regexp-recipient
check_relay_domains
M.E.: What to do after you get spam:
F.B., M.E., E.E.:
F.B., M.E., E.E.: Answer Questions from users