Νέα μορφή email harvesting

Μηνύματα με άσχετο Subject: και περιεχόμενο έναν αριθμό. Υποθέτω ο spammer μαζεύει τα bounces και επικαιροποιεί τη λίστα του. Π.χ.

From: FLAC <rnxdzfxg@oyakeuro.com>
Subject: OTHERWISE FROMOUT DEALINGS
Return-Path: <rnxdzfxg@oyakeuro.com>
:
Message-ID: <000801c717e3$5ca43970$00000000@zeusz>

59192

Όσοι λάβατε τέτοια mails, ετοιμαστείτε για εορταστικό spam outbreak…

Yours Internet Expert

Αυτό είναι το Subject: σε mail που ήρθε χτες στον MAILER-DAEMON παπάκι τε-ε τελεία τζι αρ πάνω από είκοσι (20) φορές από Ελληνική εταιρία που δραστηριοποιείται στο Internet.

Από το web site τους διαβάζω:

  • Έχουμε όραμα: Να είμαστε οι καλύτεροι
  • Έχουμε στόχο να γίνουμε ο e-δικός σας συνεργάτης στο Internet
  • Έχουμε τον τρόπο: ΕΡΕΥΝΑ-ΜΕΛΕΤΗ-ΥΛΟΠΟΙΗΣΗ-ΠΡΟΩΘΗΣΗ

Τον τρόπο να φτιάξουν τον auto-responder σωστά και να έχουν ένα ορθογραφημένο Subject: header δεν τον έχουν πάντως.

Fighting spam, spyware and malicious software: Member States should do better, says Commission

It is time to turn the repeated political concern about spam into concrete actions to fight spam,” said Viviane Reding Commissioner for Information Society and Media. “In line with EU legislation outlawing spam, the Dutch authorities have managed to cut domestic spam by 85% – I’d like to see other countries achieving similar results through more efficient enforcement. I will revisit this issue again next year to see whether additional legislative measures against spam are required.”

Περίπου δύο χρόνια πριν η ΑΠΔΠΧ προσπάθησε να δημιουργήσει ένα κώδικα δεοντολογίας των Ελληνικών ISPs ώστε να υπάρχει μια ενιαία αντιμετώπιση στο ζήτημα του spam. Η προσπάθεια αυτή απέτυχε, αλλά ευτυχώς δεν έχει σταματήσει. Το γιατί απέτυχε (at least from my POV) θα είναι θέμα επόμενου post. Είναι ευχάριστο όμως που βλέπει κανείς να υπάρχουν προσπάθειες πίεσης ώστε οι ISPs να μπορέσουν να ασχολήθούν περισσότερο με αυτό το θέμα και ειδικά με το εξερχόμενο από αυτούς spam (τον έλεγχο στο εισερχόμενο ταχυδρομείο τον κάνουν market ως υπηρεσία προσφερόμενη δωρεάν σχεδόν όλοι).

Ανακοίνωση της Ευρωπαϊκής Επιτροπής: Σχετικά με την καταπολέμηση των ανεπίκλητων ηλεκτρονικών μηνυμάτων, του κατασκοπευτικού και του κακόβουλου λογισμικού. [pdf document]

[via]

Wow!

Ο “Αθέατος Κόσμος” μόλις ανακάλυψε το Nigerian Spam!

BTW, όποιος έχει όρεξη ας διαβάσει τις περιπέτειες του Νιγηριανού κ. Philip Ukulele καθώς προσπαθεί να συνεργαστεί με τους πρόσφατα αυτονομηθέντες από την Ελλάδα Γλυκοτσούτσουνους, των οποίων ηγείται ο Λυκάων Σπαρτιατικός.

(Όχι δεν είμαι εγώ αυτός)

Υ.Γ.1:  Για τα έγκυρα συμπεράσματα του  “Αθέατου Κόσμου” μπορείτε να δείτε εδώ και εδώ (thanks to Lida).

Υ.Γ.2: Η λέξη είναι “φυτό”, “φύτουλας”, “φυτούκλα” , αλλά σίγουρα όχι “φύτακλας”.

Μάθετε να ρυθμίζετε σωστά τους auto-responders

Όταν χρησιμοποιείτε έναν autoresponder, καλό είναι να μάθετε να τον ρυθμίζετε σωστά. Για παράδειγμα είναι τεράστεια αγένεια (και βλακεία) να δέχεστε email από μια mailing list και να απαντάει σε αυτή ο autoresponder. Ή ακόμα χειρότερα να δέχεστε email από τον MAILER-DAEMON@example.com και να του απαντάτε τα office hours και με ποιον αντικαταστάτη σας μπορεί να επικοινωνήσει. Γενικά δεν απαντάμε ποτέ σε ένα bounce-message και ακόμα ειδικότερα δεν απαντάμε ποτέ μέσω autoresponder. Αν οι παραπομπές δεν σας βοηθάνε να καταλάβετε το γιατί, ρωτήστε τον postmaster σας. Εν ολίγοις, είναι χαζό να απαντάτε σε ένα πρόγραμμα που σας έστειλε ένα πληροφοριακό μήνυμα.

Μάθετε να σέβεστε το χρόνο του απέναντί σας. Μπορεί ο μέσος χρόνος ανάγνωσης ενός autorespond message να είναι 3sec, αλλά τα χιλιάδες καθημερινά τέτοια, απλά καταστρέφουν το χρόνο κάποιου εργαζόμενου. Μην καταστρέφετε το robustness principle πάνω στο οποίο οικοδομήθηκε το Internet:

Be conservative in what you send, liberal in what you accept”

Εάν θεωρείτε σημαντικό το χρόνο σας, καλό είναι να θεωρείτε σημαντικό και τον χρόνο των άλλων.

Migrating thousands of mailboxes to a new mailbox storage

Years ago we were faced with the following situation: We had thousands of mailboxes that were being served by a proprietary and unsupported version of email software. So we decided to move to a new architecture. While researching I selected a very good (IMHO) commercial product. But for reasons outside the scope of the post I opted for a F/OSS solution, and specifically the UW-IMAP toolkit. For those rushing to judge that price was the decisive factor I only have to reiterate Vladimir Butenko‘s words:

“Bottom line: you always pay. You need a simple thing – you pay a small amount, you need a big thing – you pay more.” (plain message and comp.mail.imap thread)

OK and now for the real question: How do you move thousands of mailboxes without your users noticing?

Since you do not know (and do not want to know) your users’ passwords the only thing you can do is to hack into the source code of your POP3 server (we do not offer IMAP yet). Whether it is the UW-IMAP toolkit, Cucipop, popa3d or any other server that you have access to its source, the server knows the correct password for your users when they authenticate. So when the authentication succeeds you fork(2) a program that logs into the old server and fetches the mailbox from the old server to the new one that runs the F/OSS software that you have selected. This can be fetchmail or any similar program. However I have found out that Net::POP3 is a better choice:

#!/usr/bin/perl
use Sys::Syslog;
use Net::POP3;
use DB_File;
$host = shift or die;
$user = shift or die;
$pass = shift or die;
tie %d, 'DB_File', "/etc/pop3.users.db", O_CREAT|O_RDWR, 0640, $DB_BTREE or die;
if ($d{$user}) {
        untie %d;
        exit 0;
}
$pop = Net::POP3->new($host) or die;
if ($pop->login($user, $pass) >= 0) {
        openlog("pop3cat-tmail", 'pid', 'mail') or die;
        syslog('info', 'fetching mail for user %s', $user);
        closelog();
        $msgnums = $pop->list or die;
        foreach $msgnum (keys %$msgnums) {
                $msg = $pop->get($msgnum);
                open T, "| /usr/bin/tmail $user" or die;
                print T @$msg;
                $pop->delete($msgnum);
                close T;
        }
        $d{$user} = "OK";
        untie %d;
}
$pop->quit;
exit 0;

Where exactly in the server code you fork(2), exec(3) and wait(2) for the script depends on the source code. You need to find where in the server code the authentication procedure succeeds and patch from there, before the server actually opens the user’s mailbox.

This script basically checks whether it has already moved a user’s mailbox from the old server. If it has, then the user is found in /etc/pop3.users.db and the script exits. If not, then the mailbox is moved and the user is inserted in /etc/pop3.users.db. Simply using Net::POP3 allows you to move the old mailbox to the Unix traditional mailbox format. That is why we fork tmail, since I have chosen the mbx mailbox format to store messages (I compile UW-IMAP with CREATEPROTO=mbxproto). If your server supports a format like Maildir, then you have to customize the above script accordingly, since it is written for mbx, which means that the user’s mailbox is a single file.

smrsh and Debian sendmail

If you run sendmail from the Debian (Etch) packages and you use FEATURE(`smrsh’) then you must put the symlinks of the commands that you want smrsh to execute under /etc/mail/smrsh and not under /usr/lib/sm.bin . The Debian manpage is not particularly helpful on this.

From sendmail’s configuration README:

smrsh		Use the SendMail Restricted SHell (smrsh) provided
		with the distribution instead of /bin/sh for mailing
		to programs.  This improves the ability of the local
		system administrator to control what gets run via
		e-mail.  If an argument is provided it is used as the
		pathname to smrsh; otherwise, the path defined by
		confEBINDIR is used for the smrsh binary -- by default,
		/usr/libexec/smrsh is assumed.

re: Εμπορική ονομασία το… spam;

Ο Voyager αναμεταδίδει την είδηση. Ακολουθώντας το μονοπάτι της είδησης (επειδή ορθά παραθέτει την πηγή του) βλέπουμε πως αυτή προέρχεται από το techteam.gr. Επίσης πολύ σωστά το techteam.gr μας δίνει την πηγή του που είναι το PC Magazine. Ακόμα πιο σωστά το PC Magazine δεν επικαλείται γενικά και αόριστα πηγές, αλλά μας δίνει τη δική του πηγή, το techspot.com. Στο techspot.com με ημερομηνία 12 Οκτωβρίου 2006 διαβάζουμε πως η εταιρία Hormel (που παράγει προϊόν με την ονομασία SPAM από το 1937) λέει:

“We do not object to use of this slang term to describe (unsolicited commercial e-mail),” the company said on its Web site, “although we do object to the use of the word “spam” as a trademark and to the use of our product image in association with that term.”

Τι μου θυμίζει, τι μου θυμίζει… Ναι, είναι το κείμενο από εδώ:

” We do not object to use of this slang term to describe UCE, although we do object to the use of the word “spam” as a trademark and to the use of our product image in association with that term. Also, if the term is to be used, it should be used in all lower-case letters to distinguish it from our trademark SPAM, which should be used with all uppercase letters.”

Ποιό είναι το catch λοιπόν; Το catch είναι πως το παραπάνω κείμενο γράφτηκε στις 18 Απριλίου του 2003! Άρα το techspot.com δεν μίλησε ποτέ με τη Hormel. Πράγμα που με έκανε να αναρωτιέμαι αν η Hormel έκανε ποτέ τη σχετική αίτηση (μια και δεν υπάρχει σχετική ανακοίνωση στο website της).

Ας βρούμε λοιπόν το “Γραφείο Εμπορικών Σημάτων και Σχεδίων”. Κανένας από όσους αναφέρουν την είδηση (και γράφουν για την απόφαση του Γραφείου Εμπορικών Σημάτων και Σχεδίων) δεν μας λέει που μπορούμε να βρούμε το Γραφείο στο Internet και πως να αναζητήσουμε το σκεπτικό της απόφασής του. Είναι το “Office for Harmonization in the Internal Market – Trade Marks and Designs“.

Πάμε στο Search και επιλέγουμε “Entire Site”. Γράφουμε spam και …voila! Εκεί βρίσκουμε την απόφαση[pdf document] του “Second Board of Appeal” που απορρίπτει και την έφεση της Hormel. Από την απόφαση αυτή μαθαίνουμε πως η Hormel είχε ξεκινήσει τη διαδικασία στις 17 Δεκεμβρίου του 2004. Η απόφαση του δευτεροβάθμου οργάνου έχει ημερομηνία 19 Ιουλίου 2006.

Αν έκανα αυτή την άσκηση εξακρίβωσης της πληροφορίας, δεν ήταν γιατί αμφισβήτησα τον Voyager ή κάποια από τις προηγούμενες πηγές. Ήταν γιατί από ένα σημείο και μετά όλοι όσοι αναφέρουν την είδηση αναμεταδίδουν το ίδιο κείμενο (ημερομηνίας 11 Οκτωβρίου 2006) από το AP (όλο το άρθρο ή τμήματά του) άλλοι αναφέροντάς το ως πηγή και άλλοι όχι.

Εξίσου μεγάλο ενδιαφέρον για εμένα έχει και το timeline της ιστορίας:

  • 2003/04/18:Η Hormel στο site του SPAM δηλώνει “We do not object to use of this slang term…”.
  • 2004/12/17:Η Hormel ξεκινάει τη διαδικασία να καταχωρήσει τη λέξη SPAM σαν trademark για τις ηλεκτρονικές επικοινωνίες.
  • 2006/07/19:Το δευτεροβάθμιο όργανο του “Γραφείου” αποφασίζει πως η Hormel δεν έχει το δικαίωμα αυτής της καταχώρησης.
  • 2006/10/11:Εμφανίζεται το πρώτο άρθρο από το AP στο οποίο φαίνονται δηλώσεις της Hormel για την υπόθεση που όμως έχουν γίνει πριν καν ξεκινήσει η διαδικασία!

(ref)

check_dnsbl: a simple Nagios plugin

One way to deal with rogue virus spamming client machines is to do what AOL does. In our case this is not an acceptable choice. Therefore we redirect all rogue port 25/tcp traffic to a relay server1 where we simply check for virii in the outgoing email messages. Such a method has the side effect that this server sometimes ends up in bl.spamcop.net. In order to know when this happens I wrote this simple Nagios plugin, check_dnsbl:

#!/usr/bin/perl -w
#
# yiorgos, Fri Oct 13 16:09:52 EEST 2006
# Normally this *must* follow the Nagios plugin guidelines:
# http://nagiosplug.sourceforge.net/developer-guidelines.html
#

# Yes these three lines are needed because of the embedded Perl interpreter
use vars;
use strict;
my($revip, $dnsbl, $ans);

$revip = shift or die "you must give a reversed IP address";
$dnsbl = shift or die "you must give a DNSBL";

open DNSBL, "/usr/bin/dig -4 $revip.$dnsbl a |" or die;
while(<DNSBL>) {
  chop;
  if (m/^;; ANSWER SECTION:/) {
    $ans = <DNSBL>
    close DNSBL;
    print "$dnsbl STATUS: ", $ans;
    exit 2;
  }
}
close DNSBL;

print "$dnsbl STATUS: OK";
exit 0;

Of course you can hack check_dnsbl to include more DNSBLs. This is simply a proof-of-concept that does the job fine. It is not a complete plugin. If you want to make a more complete plugin you have to read through the Nagios plugin developer guidelines.

Update: A final version of the check_dnsbl plugin can be downloaded from here.  The final version checks for $HOSTNAME$ being listed in various DNSBLs specified in an array (Yes @dnsbl_list is specified inside the source.  You can use an external file to specify the array and have the Perl interpreter require it if you don’t like it this way).  It also uses Net::DNS instead of opening a pipe to dig which makes it considerably faster.

[1] in Greek