AdSuppression - Intriguingly uses Netscape's automatic proxy configuration feature to block advertisements. A proxy.pac file contains JavaScript which detects the URLs to be blocked. Colin Kong has written a more up to date .pac file, which improves this idea with more sophisticated and detailed filters. Released under the Zope Public License. Alfajor - Python cookie remover, named after a Chilean pastry.
Latest version can block addresses which match regular expressions, and so block adverts.
ByProxy - General purpose internet filter. As well as the web, it works with email and news to filter spam, and has many other functions. Written in Java. Partial source code available. CTC - Advert filter proxy written in Python.