Newsforge has an article online which is excerpted from the book Know Your Enemy: Learning About Security Threats (2nd edition), a highly recommended read even for programmers - both the article (focused on honeypots) and then of course the book. Written by a member of the Honeynet Project, this book teaches you how to study a black hat attack and learn from it. In addition, you get valuable insight into the mindset of black hats and their community.