IV International Conference of Unix at Uninet
  • Presentación
  • Registro
  • Programa
  • Comité Organizador
  • Lista de registrados
  • Equipo de traductores
Talk

20031218-2.en

paskI'm proud to introduce Mr. Jose Nazario from Monkey.org (USA)
paskDr. Nazario holds a Ph.D. in biochemistry from Case Western Reserve University but currently works as a system
paskverification and security analyst for an American networking company. He has been active in the Open Source software and
pasksecurity community for several years.
paskThe conference's title is Vthrottle: stopping mail viruses through libmilter
paskthe audience could download some slides
paskfrom jose's web at monkey.org, exactly at http://monkey.org/~jose/software/vthrottle/
paskThe conference will be translated simultaneously to spanish at #redes channel and to dutch at #taee channel. The attendants could ask, just at the end of conference , at #qc channel
paskThe #linux channel would remain moderated til the end of conference.
paskOk,
paskand now,
paskjose,
paskthe channel is waiting for you!!
jose_ngood afternoon/day/night/morning ... my name is jose nazario.
jose_nthank you pask for that great introduction. i'm
jose_nan openbsd developer and security analyst living in ann arbor,
jose_nmichigan, in the united states.
jose_ni'm going to be presenting today on
jose_nsome software i wrote recently called 'vthrottle'.
jose_nas pask said, the slides for the talk are on my website here:
jose_nhttp://monkey.org/~jose/presentations/vthrottle.d/
jose_nthe concept behind vthrottle is not mine, it belongs to an HP
jose_nlabs researcher named matt williamson.
jose_nhe and his research
jose_ngroup have been investigating using activity rate limiting
jose_nmechanisms to prevent network anomalies from growing too
jose_nquickly.
jose_ni became aware of this research while writing a book
jose_non internet worms which was published last month.
jose_nin a nutshell the technique seems to have some promise to it,  
jose_nbut i'm not entirely convinced it will work for everything.
jose_nso, i decided to write up and release some software to test it to
jose_nsee how well it will work in the real world.
jose_nthis software is
jose_nonly at version 0.30, but it is very stable and has most of the
jose_nfeatures it will need for a 1.0 release.
jose_n[slide 2]
jose_nso, very quickly, vthrottle is a mail server plugin that allows
jose_nyou to modify server behavior.
jose_n it operates at the MTA layer, or mail transport agent.
jose_nthis is where the SMTP transaction occurs
jose_nbetween servers and clients.
jose_nthis is different than your mail
jose_nclient, which is called an MUA (mail user agent) or the software
jose_nwhich drops the mail off into your inbox, which is called the
jose_nLDA (local delivery agent).
jose_nvthrottle doesn't stop worms, it only slows them down.
jose_nyou'll never win the race ahead of a worm, so what you want to do is
jose_nto try and gain some extra time to react.
jose_nto do this, and to do  
jose_nthis for worms we haven't seen yet, we work on generic worm
jose_nproperties.
jose_nwe never look at the payload, we only look at the
jose_nbehavior of a host.
jose_nthe implementation is built as a milter plugin for sendmail
jose_nsevers.
jose_nmilter is the plugin architecture for sendmail, which
jose_nlets you interact with the server and make judgements about mail.
jose_n[slide 3]
jose_nlet's take a few minutes and talk about libmilter.
jose_nlibmilter is
jose_nthe sendmail plugin architecture, as i said on the last slide.
jose_nit is a library for the client code, and the server needs support
jose_nfor it as well at compile time.
jose_nit is for sendmail only, not
jose_nfor postfix, qmail, exim or the like.
jose_nit provides a framework for interacting with mail by working on
jose_nstate transitions within smtp.
jose_nthese transitions occur when
jose_na client connets, it says HELO, it sets the "mail from",
jose_nwho
jose_nthe mail is going to, and when it sends the headers, when
jose_nthe headers end, when it sends the body of the mail,
jose_nand when the
jose_nbody of the mail ends, when the message ends, and when the
jose_nclient aborts the connection.
jose_nmilter clients listen on a local domain (UNIX) socket or a
jose_nnetwork (IPv4 or IPv6) socket.
jose_nthis lets your run a single milter
jose_nserver for all of your MTA farm and work with multiple SMTP
jose_nservers.
jose_n[slide 4]
jose_npeople have typically been using milter plugins for the following
jose_nfour reasons.
jose_nthe first is as a mail logger mechanism. this lets your copy all
jose_nof a subset of the messages that pass through a system, for
jose_nexample for archiving or record keeping purposes.
jose_nthe second is to use it as a statistics gatherer.
jose_nthis can
jose_nbe things like a mail quota information gatherer, a connection
jose_ncounter, or the like. i'm looking at using this information
jose_nto further a generic worm detection and control mechanism.
jose_nthe third is as an antivirus subsystem hook.
jose_nyou can feed
jose_nthe antivirus software the mail message itself and return information
jose_nabout the message to the server.
jose_noops .. duplicate :)
jose_nhere you can do things like
jose_nreject or pass a mail message after inspection.
jose_nthe fourth one is as an anti-spam mechanism. similar to the
jose_nantivirus mechanism, you can pass the message or header information
jose_nto the anti-spam subsystem and pass or fail messages this way.
jose_nas i alluded to in the previous slides, milter can actually
jose_n*do* things to your mail connections.
jose_nyou can react to a
jose_nstate transition request by giving a pass code (a 200 series
jose_nreply), or a failure (400 for a temporary failure or 500 for
jose_na permanent failure).
jose_ncoming 8.13 you can quarantine messages
jose_nusing libmilter.
jose_nyou can also modify the mail as it passes through the system.
jose_nhere what you can do is add headers (such as "X-SPAM"), or
jose_neven rewrite portions of the message (such as defanging an
jose_nattachment, modifying a message body or the like).
jose_nlastly you can copy messages silently using the milter system.
jose_nthis can basically open up a file and dump the message body
jose_ninto the file, including the headers and the body of the message.
jose_n[slide 6]
jose_nusing libmilter is very easy to do.
jose_nthe first step is to build
jose_na sendmail program that has libmilter support added in already.
jose_nthe first step is to build
jose_na sendmail program that has libmilter support added in already.
jose_noops
jose_nour network broke for a bit
jose_nusing libmilter is very easy to do. the first step is to build
jose_na sendmail program that has libmilter support added in already.
jose_nthen you basically add a milter call in the configuration,
jose_nforcing messages to pass the check called by the milter program.
jose_nthe next thing to do is to write the milter program. what you
jose_ndo is you fill in a struct which tells the program what functions
jose_nto call at what points for these state transitions within an  
jose_nSMTP transaction.
jose_nand, of course, you can set them to NULL
jose_nif you wish them to not be evaluated. these are just function
jose_npointers.
jose_nnext you write the functions which evaluate the portion of the
jose_nSMTP transaction.
jose_nall functions can treate the body as a
jose_nstring, but you have to be careful about embedded NULLs. all
jose_nmethods return one of pass, fail, or reject.
jose_nwithin the program you need to connect to the socket you have
jose_nset up to communicate with the MTA program (a UNIX domain
jose_nsocket or a network socket).
jose_nthen the last thing you need to
jose_ndo is call smfi_main(), which starts the milter program.
jose_nsomeone asked in #qc if milter like tools exist for qmail. nope, not that i know of.
jose_ni dont use qmail, but i'm pretty sure milter wont work with qmail and support for milter like tools don't exist.
jose_n[slide 7]
jose_nmilter programs are typically written in C or C++, but bindings
jose_nhave been written in Perl. perl milters have the same basic
jose_nstructure as a C milter does.
jose_nit should be easy to write milter bindings for other languages
jose_nusing the SWIG toolkit.
jose_nthen you could write in Python, Ruby,
jose_ntcl, C# or whatever else you like that SWIG supports. i don't
jose_nthink anyone has done this yet.
jose_n[slide 8]
jose_nvthrottle works very very simply. it has three parts of the SMTP
jose_ntransaction it watches.
jose_nthe first is who connects to the
jose_nmail server. the second is how you say HELO (how you start the
jose_nSMTP transaction). and the third is the address the mail is
jose_ncoming from.
jose_nfor the connection and HELO information the
jose_nhostname is kept and compared; for the "mail from" segment
jose_nan email address is used.
jose_nfor each of these pieces of information, vthrottle keeps a list
jose_nof who it has seen and when they were seen.
jose_nwhat vthrottle
jose_nthen does is it looks at the current time and the list time it
jose_nsaw any of those obervations and enforces a minimum interval
jose_nbetween those observations.
jose_nwe make two pretty bold assumptions here, first that normal hosts wont
jose_ntry and send mail faster than this limit.
jose_nand the second part
jose_nof this assumption is that we figure most worms and viruses
jose_nwill try and send mail faster than this limit.
jose_nlike i said earlier, this isn't my idea, it's from matt williamson.
jose_nhe's a researcher in the UK working for HP labs.
jose_n[slide 9]
jose_nvthrottle is very easy to install.
jose_nfirst make sure that your
jose_nsendmail has support for milter build it and that you have the
jose_nmilter library and headers installed.
jose_nthis is part of the
jose_nnormal sendmail distribution, so you dont need any special
jose_nsoftware.
jose_nthen, obviously, download the software from my site:
jose_nhttp://monkey.org/~jose/software/vthrottle/
jose_nthe current version is 0.30, which i released last weekend
jose_n(14 december 2003).
jose_nbuilding vthrottle can be a bit tricky, only because i dont
jose_nhave a ./configure script yet.
jose_nyou need to modify the Makefile
jose_nto point it at the libmilter headers and the library.
jose_nthen you can install it wherever you like. the README lists the
jose_nconfiguration change you need to make to your sendmail.mc file.
jose_nonce you regenerate your .cf file you're all set.
jose_nyou start it very simply: vthrottle -s <socket>, which is
jose_nthe communications socket for the program.
jose_nyou can
jose_nset a different interval time with -i (it defaults to 60 seconds right now).
jose_nyou can create a "whitelist" using
jose_n-w, too. this file specifies different limits for mail addresses
jose_nor hosts.
jose_n[slide 10]
jose_nthese are the big features of vthrottle right now, over its
jose_nbasic behavior.
jose_nyou can configure a default interval that
jose_nworks for your network or your behavior.
jose_nlet's say people in
jose_nyour office send mail every 30 seconds on average, you can
jose_nchange the behavior on the command line at runtime.
jose_nyou can also whitelist hosts or mail addresses using the
jose_nwhitelist function.
jose_nthis is for major peer MTA systems or
jose_nmailing list addresses. you can set a different interval
jose_nfor those entries.
jose_n[slide 11]
jose_nthis is a basic order of operations for a mail server using
jose_nvthrottle.
jose_nwhen a host connects or says HELO, vthrottle looks at its
jose_nlist of hosts and when they were seen.
jose_nif it has seen the
jose_nhost before, it compares the time now to when it was last
jose_nseen and how long you are supposed to wait.
jose_nif it's longer
jose_nthan the required interval, then vthrottle says "ok" and
jose_nthe message is allowed.
jose_nf it hasn't seen the host
jose_nbefore, it adds it to the list and moves on with an "ok".
jose_nif the connection is too soon, vthrottle tells the server
jose_nto reject the transaction.
jose_nwhen the source mail address is sent, vthrottle repeats that
jose_ncheck on a list of mail addresses.
jose_nif they are at least
jose_n"interval" seconds apart, then the mail can pass. if not
jose_nthe message attempt fails.
jose_nwhenever an attempt to send mail is prevented by a rejection
jose_nor a failure, it is logged for the administrator.
jose_n[slide 12]
jose_nvthrottle has some bugs ... some of which are my fault.
jose_nthe first is that it sends a permanent failure to the
jose_nhost when it tells it to go away for a connection or a
jose_nHELO request.
jose_nthis is specified by the SMTP standards and
jose_nis limited by sendmail.
jose_nthe second is that the list used in vthrottle is global.
jose_nbecause vthrottle is threaded, it will probably destroy  
jose_nthe list and make it useless ...
jose_nthe third bug is more of a performance problem i expect to
jose_nsee. it uses a singly linked list to look up addresses,
jose_nso performance will degrade with the number of addresses
jose_nand hosts your servers interact with.
jose_nmaybe i should use
jose_na splay tree, which is self optimizing ...
jose_n[slide 13]
jose_nthis is a short list of things i plan to do with vthrottle
jose_nfor a 1.0 release.
jose_nthe first is to fix sendmail with a
jose_npatch to get it to return a temporary failure for a
jose_nconnection or HELO throttle action.
jose_nthis should make
jose_nclients react more sanely and try again in a few minutes.
jose_nthe next two i already did. you should be able to vary the
jose_ndefault interval, which you can now do. the third is to
jose_nimprove the whitelist file syntax, and that is done, too.
jose_nlastly i need to implement a deferment queue for messages
jose_nthat have been throttled. this will be trickier but will
jose_nmake the server easier to manage large queues of
jose_nmail rather than hoping the client gets it right.
jose_n[slide 14]
jose_nsadly, i don't run mail servers anymore. so, i haven't
jose_ntested vthrottle in the real world. for all i know it's
jose_ndead slow and ruins your mail server.
jose_nit could be, because
jose_nit has to traverse this linked list of information, but that
jose_ndepends on the network size.
jose_nobviously i hope vthrottle doesn't have a negative impact on
jose_nnormal network operations.
jose_nthe worst case scenario for
jose_nthis kind of impact is that someone will be away from the
jose_nnetwork for a while and compose a bunch of mail. when they
jose_nsit down to send it out, that "shotgun" blast of mail
jose_nwill be throttled. a deferment queue will help a lot in that
jose_nregard.
jose_n[slide 15]
jose_nthere are some weaknesses in the design which i want to see if
jose_ni can work around.
jose_nthe first is when a host reuses its existing connection via an
jose_nSMTP RSET (reset state). what i should do here is start the
jose_ncheck again and pretend it connected again. should be simple
jose_nto do if libmilter has a handler for RSET ...
jose_nthe second is the situation when the virus spoofs the HELO
jose_ninformation. remember you can send anything you want here,
jose_nand the server doesn't have to verify it. i imagine some
jose_nviruses already do this.
jose_nthe mail. in the absence of strong authentication (ie via
jose_nTLS) of the sender, there is no way around this one.
jose_n[slide 16]
jose_nand that's it! i need to thank matt williamson and the
jose_nmanagement team at HP labs, they were comfortable
jose_nenough with someone else releasing a product which
jose_ndoes what their patent pending process does. :)
jose_nyou can see the latest release of vthrottle on its homepage:
jose_n  http://monkey.org/~jose/softwaree/vthrottle/
jose_nthe website needs sexy graphics if you feel like contributing.
jose_ni have some ideas but i'm not a good artist.
jose_nlastly this took only a few hours to write and extend,
jose_nbut getting it up to version 0.30 took about 400 lines of C
jose_ncode and about 6 hours of work.
jose_nthank you :)
MJesusclap clap clap clap clap clap clap clap clap clap
MJesusclap clap clap clap clap clap clap clap clap clap
MJesusclap clap clap clap clap clap clap clap clap clap
MJesusclap clap clap clap clap clap clap clap clap clap
MJesusclap clap clap clap clap clap clap clap clap clap
MJesusclap clap clap clap clap clap clap clap clap clap
MJesusclap clap clap clap clap clap clap clap clap clap
fernand0plas plas plas plsa plas plas plas plas plas plas
fernand0plas plas plas plsa plas plas plas plas plas plas

Generated by irclog2html.pl by Jeff Waugh - find it at freshmeat.net!

Email UsMás información


© 2003 - www.uninet.edu - Contact Organizing Comittee - Valid XHTML - Valid CSS - Design by Raul Pérez Justicia