APLawrence - Information and Resources for Unix and Linux Systems, Bloggers and the self-employed
RSS Feeds Get APLawrence.com by RSS











(OLDER) <- More Stuff -> (NEWER) (NEWEST)
Home > News Posts > email worm management
Printer Friendly Version




News Group Posts

email worm management




From: Jean-Pierre Radley <jpr@jpr.com>
Subject: Re: How Can I Block Latest Worm-Generated SPAM?
Date: 19 Sep 2003 16:11:00 -0400
References: <Pine.UW2.4.21.0309191413380.24405-100000@ris7.UniXpress.com> 

Lucky Leavell typed (on Fri, Sep 19, 2003 at 06:21:32PM +0000):
| I know I am one of very many hapless souls receiving message after message
| totaling around 150K/message purporting to be M$ patches or undeliverable
| or some such muck. When receiving similar SPAM generated by SoBig.F, it
| all (for me) came from one IP address so it was fairly easy to insert a
| statement in my .maildelivery file to eliminate it but today's has no
| discernible pattern I can see.
| 
| Any suggestions on how to stem the flow other than closing port 25 which
| would only defer the problem? My email server is UW7.1.0 with PTF7130e
| installed. I even though about rejecting any messages with attachments but
| am not sure how to do that with sendmail.
| 
| The main headache it is causing me today is that it takes so much of my
| very limited bandwidth that the only thing I can do is send
| (hopefully!) and receive (definately!) email.  Everything else, including
| pings time out with Unknown Host.

I hate sendmail and run smail here.  It pipes incoming main to Chip
Salzenburg's 'deliver'; ~part~ of my /usr/local/lib/deliver.sys reads:














 #!/bin/ksh
 # /usr/local/lib/deliver.sys
 # 1.4  JPR  18Sep03
 
 typeset -l TO=`header -f To -f Cc -f Apparently-To -f Sender $HEADER`
 ID=`header -f Message-ID $HEADER`
 typeset -l FR=`header -f From $HEADER | sed '
 s/.*<\(.*\)>.*/\1/
 s/[("].*[)"]//
 s/ //g'`
 typeset -l CT=`header -f Content-Type $HEADER | sed 's/;.*//'`
 typeset -l CN=`header -f Control $HEADER`
 IP=`header -f Received $HEADER | sed -n '1s.*\\[\\(.*\\)].*\\1p'`
 : ${IP:=localhost}
 USER=$1
 
 # Configure the email server to block or remove email that contains file
 # attachments that are commonly used to spread viruses, such as .vbs, .bat,
 # .exe, .pif and .scr files.
 
 for X in EXE BAT PIF SCR VBS
 do
  grep -iq "^Content-.*name=.*\.$X" $BODY &&
  echo "A .$X file mailed by $FR\nto $TO\nvia $IP\nwas dumped in the garbage."|
        mutt -s "Dumped .$X file" $USER &&
        /usr/local/bin/addfilter $IP &&
        echo DROP &&
        exit
 done

/usr/local/bin/addfilter collects IP addresses which an overnight cron
job adds to my local RBL list.

-- 
JP


If this page was useful to you, please click to help others find it:  

Your +1's can help friends, contacts, and others on the web find the best stuff when they search.

Comments?



Click here to add your comments



Don't miss responses! Subscribe to Comments by RSS or by Email

Click here to add your comments


If you want a picture to show with your comment, go get a Gravatar



Have you tried Searching this site?

Unix/Linux/Mac OS X support by phone, email or on-site: Support Rates

This is a Unix/Linux resource website. It contains technical articles about Unix, Linux and general computing related subjects, opinion, news, help files, how-to's, tutorials and more. We appreciate comments and article submissions.

Publishing your articles here

Jump to Comments



Many of the products and books I review are things I purchased for my own use. Some were given to me specifically for the purpose of reviewing them. I resell or can earn commissions from the sale of some of these items. Links within these pages may be affiliate links that pay me for referring you to them. That's mostly insignificant amounts of money; whenever it is not I have made my relationship plain. I also may own stock in companies mentioned here. If you have any question, please do feel free to contact me.

Specific links that take you to pages that allow you to purchase the item I reviewed are very likely to pay me a commission. Many of the books I review were given to me by the publishers specifically for the purpose of writing a review. These gifts and referral fees do not affect my opinions; I often give bad reviews anyway.

We use Google third-party advertising companies to serve ads when you visit our website. These companies may use information (not including your name, address, email address, or telephone number) about your visits to this and other websites in order to provide advertisements about goods and services of interest to you. If you would like more information about this practice and to know your choices about not having this information used by these companies, click here.

g_face.jpg

This post tagged:

       - SCO_OSR5




Unix/Linux Consultants

Skills Tests

Guest Post Here