Fighting Comment Spam With Project Honey Pot (Posted on May 11th, 2013)

Early on when developing this blog my goal was to allow for a commenting system that didn't require login of my site or any other third party site to post. This has made me a huge target for spammers. In fact when my site first launched I didn't use recaptcha so I was getting thousands of comments per day and I didn't really have all that much content. However, a majority of these posts never saw the light of day thanks to Project Honey Pot's HTTP Blacklist. Taken from their site:

The HTTP Blacklist, or "http:BL", is a system that allows website administrators to take advantage of the data generated by Project Honey Pot in order to keep suspicious and malicious web robots off their sites. Project Honey Pot tracks harvesters, comment spammers, and other suspicious visitors to websites. Http:BL makes this data available to any member of Project Honey Pot in an easy and efficient way.

The service works by tracking the IPs of bad things and giving it a rating. With that rating you can choose how content gets marked as spam. So all I do is send the IP address of the poster to the service and then check to see what the odds are of it being a spammer.

Using HTTP Blacklist

The first step is registering for an API key which also requires an account on the site. Once you have that done using the service with Python (or any language really) is actually only a few lines of code which is pretty sweet. I've included some extra code for those using Django as well.

#Getting the users IP from a Django request
x_forwarded_for = request.META.get('HTTP_X_FORWARDED_FOR')
if x_forwarded_for:
    ip = x_forwarded_for.split(',')[0]
else:
    ip = request.META.get('REMOTE_ADDR')

#Step 1: Reverse the order of the IP address octets
iplist = ip.split('.')
iplist.reverse()

#Step 2: Build the query
query = YOUR_HTTP_BL_API_KEY + '.' + '.'.join(iplist) + '.' + 'dnsbl.httpbl.org'

#Step 3: Execute the query
from socket import gethostbyname
httpbl_result = gethostbyname(query)
httpbl_resultlist = httpbl_result.split('.')

From there it's up to you to interpret the data. The first item in the result list should be 127 signaling that the query was successful. The second item will be a value from 0-255 of when the last time that IP address was marked. The third item will be a threat score. I find this to be the most useful metric. From my experience anything above 45 is usually spam. The fourth and final item will be the type of user such as search engine, suspicious, harvester, or comment spammer. The API goes in to more detail for all of these fields. My code for marking comments as spam looks like this:

#Check if response is proper
if httpbl_resultlist[0] == "127":
    #Check threat level
    if httpbl_resultlist[2] > 45:
        comment.spam = True
    else:
        comment.spam = False
else:
    comment.spam = True

Overall I've found http:BL to be a super useful and FREE service to catch spammers. A lot of people also use Akismet so definitely check that out to see which fits your needs better. As of now I'm using recaptcha and http:BL to filter comments. I'd say about 10 comments get past recaptcha per day and about 5% of the comments that get past recaptcha also get past http:BL. So about 2-3 comments make it to the site every week which isn't bad for a userless commenting system. I'll definitely be looking to cut this number down with some more advanced filtering in the near future.

As always if you have any feedback or questions feel free to drop them in the comments below or contact me privately on my contact page. Thanks for reading!

Tags: Django, Python, Tools

Comments:

  • Jeni - 10 months, 1 week ago

    Our oracle database syllabus desined by oracle certified experts which includes basic and advanced level training. At the end of the oracle database course students can clear oracle global certification exams like OCA, OCP ,OCM.Trainingbangalore povides latest oracle version training like 10g,11g,11g R2.Our training center equiped with high level lab facilites.

    reply

  • showbiz news - 10 months ago

    Just admiring your work and wondering how you managed this blog so well. It’s so remarkable that I can't afford to not go through this valuable information whenever I surf the internet!

    reply

  • Life Insurance Calgary - 4 months, 3 weeks ago

    Generally I do not learn post on blogs, but I wish to say that this write-up very forced me to try and do it! Your writing taste has been surprised me. Thank you, very nice article.

    reply

  • pou hack - 9 months, 3 weeks ago

    Really a great addition. I have read this marvelous post. Thanks for sharing information about it. I really like that. Thanks so lot for your convene.

    reply

  • hill climb racing cheats - 9 months, 3 weeks ago

    Very good points you wrote here..Great stuff...I think you've made some truly interesting points.Keep up the good work.

    reply

  • Please Visit Tom Hardy Jacket - 9 months ago

    Its fantastic comparison of the topic and able to study much more material here.

    reply

  • instagram get more followers - 7 months, 3 weeks ago

    Your blog provided us with valuable information to work with. Each & every tips of your post are awesome. Thanks a lot for sharing. Keep blogging..

    reply

  • get comments on instagram - 7 months, 3 weeks ago

    I am happy to find this post Very useful for me, as it contains lot of information. I Always prefer to read The Quality and glad I found this thing in you post. Thanks

    reply

  • facebook like hack - 6 months, 3 weeks ago

    I am very much pleased with the contents you have mentioned. I wanted to thank you for this great article.

    reply

  • Chris Pratt Vest Tedwed - 7 months, 3 weeks ago

    It’s very easy to understand! The involved analysis is very knowledgeable and a lot to know about this. Keep sharing here!

    reply

  • Governor Vest - 7 months, 3 weeks ago

    Just having read your article for a while now and impressed. Thanks for this great analysis. Outstanding assumptions

    reply

  • superiorpapers review - 7 months, 3 weeks ago

    I am using this superior papers reviews it is very motivating site for students it is very simply to understand and how to read and write simply. We are very happy with this superior papers making sites well.

    reply

  • gain twitter followers - 6 months, 3 weeks ago

    Thanks for the blog loaded with so many information. Stopping by your blog helped me to get what I was looking for.

    reply

  • Salesforce Training in Chennai - 7 months, 2 weeks ago

    VEry informative article . Thanks.

    reply

  • David Beckham Jacket amazon - 7 months, 1 week ago

    This post is a helpful overview of the particular topic and very actionable. Interesting approach!

    reply

  • amazon - 7 months, 1 week ago

    The provided resource of reading is best to gain lots of knowledge and build relevancy. Fastidious post

    reply

  • Credit Counseling - 7 months, 1 week ago

    Credit counseling agencies usually have a tie-up along with creditors and gives non-judgmental guidance. An professional guidance within the backdrop of the diminishing credibility allows you to negotiate restructuring better together with your creditors.

    reply

  • Depression - 7 months, 1 week ago

    Natural Remedy Of Depression is really a useful 1 whenever. Some occasion's depression might actually be triggered caused by insufficient nutrition within your body. Do you realize nicotine is really a crucial component to combat depression?

    reply

  • Debt - 7 months, 1 week ago

    Consolidating debts is really a debt administration strategy that must definitely be completely recognized before it's undertaken. Many individuals think this tactic is alone that can be obtained for their unique financial scenario.

    reply

  • Credit Counseling - 7 months, 1 week ago

    Debt administration and credit score counseling are extremely popular in the usa today. With the charge card crisis increasing, the credit score counseling services have become indispensable.

    reply

  • Debt Consolidation - 7 months, 1 week ago

    This debt consolidation reduction property enhance island the right way towards bring about anything formerly your financial situation.

    reply

  • best college paper writing service - 6 months, 3 weeks ago

    We are really interested to develop more articles and more online essay services for this kind of websites. These are all helps to improve more best college paper writing service books and content writing services.

    reply

  • how to get lots of followers on instagram - 6 months, 3 weeks ago

    Thanks for the post and great tips..even I also think that hard work is the most important aspect of getting success..

    reply

  • like instagram - 6 months, 3 weeks ago

    Excellent website you have here, so much cool information!..

    reply

  • Business Insurance - 6 months, 3 weeks ago

    Business insurance according to South Carolina of the islands a vast design as well as is going to extend a variety of aspects of SC businesses.

    reply

  • Business Insurance - 6 months, 3 weeks ago

    Insurance agent will usually provide the business owner those commercial insurance quotes that are extremely low hoping to obtain business from the owner

    reply

  • Accounting Services - 6 months, 3 weeks ago

    Outsourced accounting services provide quality financial information and genuine results that will help small, medium and large business enterprises make practical manoeuvres in conducting their operational strategies.

    reply

  • Business Travel - 6 months, 3 weeks ago

    If you have started your search for the best travel agent to get you to your business engagement with first class service, you have probably come across hundreds of corporate travel companies that claim to offer exactly that.

    reply

  • Debts Online - 6 months, 3 weeks ago

    When stuck up with multiple debts, debt consolidation may simplify their repayment a lot. You can search for some lenders that offer you to consolidate debt online, this is really easy and can be done in front of your computer at home.

    reply

  • fans facebook - 6 months, 3 weeks ago

    That is my own first-time all of us click here. I came across lots of pleasant points within your website, especially it is conversation. Within the lots of comments inside your posts, I guess I am not necessarily on it's own obtaining all the pleasurable the following! Carry on the actual outstanding perform.

    reply

  • 1000 followers - 6 months, 3 weeks ago

    Nevertheless this is our new we tend to hop on over. I stumbled upon a considerable amount of interesting important things ınside your blog, primarily its talk. In your a considerable amount of comments on your articles and reviews, Perhaps So i am never by themselves buying the different free time what follows! Remain typically the terrific characteristic.

    reply

  • twitter - 6 months, 3 weeks ago

    The on-line world might be bogged downwards with the help of counterfeit web logs without a proper personal message nonetheless put up was basically awesome not to mention value typically the read through. Regards for the purpose of showing this unique when camping.

    reply

  • Raleigh criminal lawyer - 6 months, 3 weeks ago

    This is usually a superb posting, With thanks to get allowing people this review. Continue to keep writing.

    reply

  • read more - 6 months, 2 weeks ago

    Exceptional article, gone ahead of time along with added your blog. My spouse and i can’t delay you just read additional via anyone.

    reply

  • Pykazamberi28 - 6 months, 2 weeks ago

    I'm curious to find out what blog system you are using? I'm experiencing some small security issues with my latest blog and I would like to find something more risk-free. Do you have any recommendations? A person necessarily lend a hand to make seriously posts I'd state. That is the very first time I frequented your website page and thus far? I amazed with the analysis you made to create this particular put up incredible. Excellent task!

    reply

  • Kesehatannya - 6 months, 2 weeks ago

    I don't know whether it's just me or if perhaps everyone else encountering problems with your website. It appears like some of the text in your content are running off the screen. Can someone else please comment and let me know if this is happening to them too? This could be a problem with my web browser because I've had this happen previously. Appreciate it Your means of telling everything in this article is genuinely fastidious, all be capable of easily know it, Thanks a lot.

    reply

  • Sehat Sehat Hidupku - 6 months, 2 weeks ago

    WOW just what I was searching for. Came here by searching for <Meta keyword of Target site we don't know yet> Thank you for sharing your info. I really appreciate your efforts and I am waiting for your further write ups thanks once again. Howdy! Do you know if they make any plugins to safeguard against hackers? I'm kinda paranoid about losing everything I've worked hard on. Any tips?

    reply

  • packers and movers mumbai - 6 months, 1 week ago

    http://www.youdial.in/packers-and-movers-mumbai

    reply

  • packers and movers mysore - 6 months, 1 week ago

    http://www.youdial.in/packers-and-movers-mysore

    reply

  • packers and movers nagpur - 6 months, 1 week ago

    http://www.youdial.in/packers-and-movers-nagpur

    reply

  • packers and movers nashik - 6 months, 1 week ago

    http://www.youdial.in/packers-and-movers-nashik

    reply

  • youtube subscribers - 6 months, 1 week ago

    Great post I would like to thank you for the efforts you have made in writing this interesting and knowledgeable article.

    reply

  • free youtube views - 6 months, 1 week ago

    I am hoping the same best effort from you in the future as well. In fact your creative writing skills has inspired me.

    reply

  • Batman Begins Jacket - 6 months ago

    Sharing knowledge is a great act and you did that. Thank you for sharing this information.

    reply

  • find out more - 6 months ago

    Thanks for providing recent updates regarding the concern, I look forward to read more.

    reply

  • Packers and Movers - 5 months, 3 weeks ago

    A complete household relocation information Visit site:- Packers and movers in bangalore@ http://professionalmovers.in Packers and Movers in Gurgaon@ http://professionalmovers.in/packers-and-movers-in-gurgaon/ Packers and Movers Bangalore@ http://professionalmovers.in/packers-and-movers-in-bangalore/ Packers and Movers in Noida@ http://professionalmovers.in/packers-and-movers-in-nodia/ Packers and Movers in delhi@ http://professionalmovers.in/packers-and-movers-in-delhi/

    reply

  • Puja Kumari - 5 months, 3 weeks ago

    Thanks for Nice and Informative Post. This article is really contains lot more information about This Topic http://www.top9th.in/packers-and-movers-bangalore/ http://www.top9th.in/packers-and-movers-hyderabad/ http://www.top9th.in/packers-and-movers-mumbai/ http://www.top9th.in/packers-and-movers-delhi/ http://www.top9th.in/packers-and-movers-gurgaon/ http://www.top9th.in/

    reply

  • Puja Kumari - 5 months, 3 weeks ago

    Thanks for post this helpful post - Please visit for More information about: http://www.top9th.in/packers-and-movers-pune/ http://www.top9th.in/packers-and-movers-noida/ http://www.top9th.in/packers-and-movers-chennai/ http://www.top9th.in/packers-and-movers-kolkata/ http://www.top9th.in/packers-and-movers-ahmedabad/ http://www.top9th.in/packers-and-movers-surat/

    reply

  • Vashikaran-mantra-in-hindi - 4 months, 4 weeks ago

    Such an nice informative article you shared.

    reply

  • Rubber Roller - 4 months, 2 weeks ago

    Great Website

    reply

  • Doctoring Rewinding Machine - 4 months, 2 weeks ago

    We are leading manufacturer of Doctoring Rewinding Machine from India, We have more than 25 Different models to choose from. Our Product range includes doctoring rewinding Machines Like: inspection Rewinding for Inkjet and Batch Printing, Doctoring Inspection, Doctoring Inspection with Slitter System, Doctor Re Reeling...etc

    reply

  • Mississippi Grind Jacket - 4 months, 2 weeks ago

    It’s very catchy and informative. Thanks much! Keep the excellent work!

    reply

  • WilliamSeta - 4 months, 2 weeks ago

    <a href="http://usapillsviagra.ru/">viagra online usa</a> <a href="http://comprarcytoteconline.ru/">can i buy 60 pills cytotec in canada</a> <a href="http://vrdrug.ru/">vrdrug</a> <a href="http://retinaforsale.ru/">canada drugs online generic retin a</a> <a href="http://orderlassixwaterpills.ru/">buy lasix online fast delivery</a> <a href="http://healthymanreviews.ru/">healthyman</a> <a href="http://orderingcialisonline.ru/">where to order cialis</a> <a href="http://cialisfordailyusecost.ru/">cialis cost vs viagra cost</a> <a href="http://canesoralusa.ru/">canesoral usa</a> <a href="http://buyonlinenorx.ru/">247 rx shop viagra generic</a>

    reply

  • Richardsr - 4 months, 1 week ago

    <a href="http://genericlevitra20mg.ru/">generic levitra professional</a> <a href="http://buyorlistatfrommexico.ru/">orlistat online</a> <a href="http://allicanada.ru/">where to buy alli in canada</a> <a href="http://retinawithoutaprescription.ru/">tretinoin no prescription</a> <a href="http://overnightpharmbrandcialis.ru/">brand cialis price</a> <a href="http://bestrxonlineviagrageneric.ru/">viagra 100mg price</a> <a href="http://indiapharmacy.ru/">online pharmacy no prescription</a> <a href="http://discountcialis20mg.ru/">cialis 20mg price at walmart</a> <a href="http://acheterduviagra.ru/">viagra without prescription</a> <a href="http://orderviagrapills.ru/">order viagra usa pharmacy</a>

    reply

  • Packers Movers - 4 months, 1 week ago

    Thanks for post this helpful post - Please visit for More information about:

    http://www.expert9th.in/packers-and-movers-delhi/ http://www.expert9th.in/packers-and-movers-noida/ http://www.expert9th.in/packers-and-movers-gurgaon/ http://www.expert9th.in/packers-and-movers-kolkata/ http://www.expert9th.in/packers-and-movers-ghaziabad/ http://www.expert9th.in/packers-and-movers-amritsar/


    Thanks for post this helpful post - Please visit for More information about:

    http://www.expert9th.in/packers-and-movers-bangalore/ http://www.expert9th.in/packers-and-movers-hyderabad/ http://www.expert9th.in/packers-and-movers-chennai/ http://www.expert9th.in/packers-and-movers-pune/ http://www.expert9th.in/packers-and-movers-faridabad/ http://www.expert9th.in/packers-and-movers-kochi/


    Thanks for post this helpful post - Please visit for More information about:

    http://www.expert9th.in/packers-and-movers-mumbai/ http://www.expert9th.in/packers-and-movers-surat/ http://www.expert9th.in/packers-and-movers-navimumbai/ http://www.expert9th.in/packers-and-movers-ahmedabad/ http://www.expert9th.in/packers-and-movers-chandigarh/ http://www.expert9th.in/packers-and-movers-jamshedpur/

    reply

  • Packers Movers - 4 months, 1 week ago

    Thanks for Nice and Informative Post. This article is really contains lot more information about This Topic http://www.top9th.in/packers-and-movers-bangalore/ http://www.top9th.in/packers-and-movers-hyderabad/ http://www.top9th.in/packers-and-movers-mumbai/ http://www.top9th.in/packers-and-movers-delhi/ http://www.top9th.in/packers-and-movers-gurgaon/ http://www.top9th.in/


    Thanks for post this helpful post - Please visit for More information about: http://www.top9th.in/packers-and-movers-pune/ http://www.top9th.in/packers-and-movers-noida/ http://www.top9th.in/packers-and-movers-chennai/ http://www.top9th.in/packers-and-movers-kolkata/ http://www.top9th.in/packers-and-movers-ahmedabad/ http://www.top9th.in/packers-and-movers-surat/

    reply

  • Double Wirelass Remote For Exit - 4 months, 1 week ago

    The wonderful reading on specific topic to achieve positive results.Keep writing here

    reply

  • www.oneminutebusinesscheckup.com - 4 months, 1 week ago

    Customer loyalty is the degree to which a customer will select a particular brand, product or service when a purchase is considered. It is the buyer’s feeling of attachment to a particular product or service. Buyers exhibit varying degrees of loyalty

    reply

  • www.yournexthouseloan.com - 4 months, 1 week ago

    The label on any product is one of the things that the buyers notice at first while they look at any product located on the shelf of any store. The same is the scenario while a buyer checks the image of any product in any shopping site.

    reply

  • Web Guiding System - 4 months ago

    Great work

    reply

  • amazon.com - 4 months ago

    In this guide, everything is worth doing to providing great searching volume to the readers. It’s superb articulate piece

    reply

  • Rubber Roller - 1 month, 3 weeks ago

    Great work thanks for sharing this article.....<a href="http://www.conpaptex.com/rubber_roller.html">Rubber Roller</a>

    reply

  • The Best strategy for binary option trading - 1 month, 3 weeks ago

    Generally I do not learn post on blogs, but I wish to say that this write-up very forced me to try and do it! Your writing taste has been surprised me. Thank you, very nice article.

    reply

  • iPhone cases - 1 month, 2 weeks ago

    Now I'm carrying my tab instead of the laptop. Please try to send the same message to http://australianessays.com/ as soon as possible as they need it urgently.

    reply

  • Rental Mobil Di Surabaya - 1 month, 1 week ago

    I have bookmarked your Fighting Comment Spam With Project Honey Pot because this site contains valuable information in it. I am really happy with articles quality and presentation.

    reply

  • Rubber Roller - 1 month, 1 week ago

    Great work Thanks for sharing

    reply

  • probiotic america review - 1 month ago

    “It’s a supplement deals with gastro issues like indigestion, bloating, chronic diarrhea, chronic bad breath, constipation, excess intestinal gas and too little or no intestinal gas, unusual abdominal pain due to overeating or any other digestive discomforts.

    reply

  • Black Magic Specialist in Nagpur - 3 weeks, 4 days ago

    Such an great job you done i have bookmark this website for such interesting posts in future.

    reply

  • Vashikaran Specialist baba - 2 weeks, 6 days ago

    Thanks for share it.

    reply

  • clash of clans hacked apk . boom beach game - 2 weeks, 3 days ago

    I'd say about 10 comments get past recaptcha per day and about 5% of the comments that get past recaptcha also get past http:BL.

    reply

  • richa - 2 weeks ago

    I just read the whole paragraph and I really like it. You are too good in writing such an awesome article. I also read few more posts on this blog and I finally can say this blog is worth reading. I learned a lot from here. Keep up the good work my friend. <a href="http://gonnabeethinandfit.tumblr.com/post/136123128529/get-animal-jam-codes-for-free-this-january-2016">animal jam codes</a> | <a href="http://gonnabeethinandfit.tumblr.com/post/136247658324/how-to-get-free-meez-coins">meez coin</a>

    reply

  • Tyre Cord Machinery - 1 week, 4 days ago

    Kew Engg & Mfg. Pvt. Ltd, have been manufacturing, exporting and supplying heavy duty and high quality Tyre Cord Machinery from alt 25 years, India. Also, Tyre Cord and Technical Textile Fabric Dipping Plant/Machine and equipments with meeting the highest performance, safety, environment and cost criteria.It is designed for excellent quality of tire cord fabric for all categories of tyres. Our plant is running at a very high production speed, dipping is final and most important stage of tyre cord fabric manufacturing and we are dealing on innovative constructions for a longer tyre life. Stronger wires and new cord constructions that lead to lower costs, lower weight and fuel savings. Tyre Cord Dipping Plant and Equipment like, Two Stage Let Off Station, Automatic Tension Control, Curved Bar Expander, Feed Roll System, Let Off, Accumulator, Center Guiding System, Fabric Dipping Tank, Stretch Heat Zone, Web Master Centering Device, Pull Roll, Hot Stretch, Intermediate Guiding, Cooling Roll System, Automatic Centering System, Wind Up, Accumulator, Pull Roll, Automatic Web Guiding Systems, Trio Canter, Two Stage Winder.

    reply

  • check here - 1 week, 4 days ago

    To me its while to read with appreciated words support. Good one post!

    reply

  • more instagram followers ! more likes on instagram - 1 week, 3 days ago

    So all I do is send the IP address of the poster to the service and then check to see what the odds are of it being a spammer.

    reply

  • Rewinding Machine - 4 days, 3 hours ago

    Krishna Engineering Works, leading manufacturer, exporter of different types of Roll to Roll Processing Machines also, Rewinding Machines. Wide range of Roll to Roll Processing Machines for Rewinding and Unwinding different types of Materials. Rewinding Machines for different types of Industry specific requirement also, for various applications per machines. Like, Winding Rewinding Machine, Slitting Rewinding Machine, Rotogravure Printing Machine, Inspection Rewinding Machine, Doctoring Rewinding Machine and many more. Also, Doctoring Rewinding, Film Rewinding Machine with Slitter, Winding and Slitting Rewinding, Winding Rewinding for Label Stock, Film Rewinding for Batch Coding and for Batch Printing, Rewinding with Inkjet Printer, Rewinding with Thermal Transfer Over printer, Rewinding with Multi head Inkjet Printer. We have been manufacturing from last 25 years, India.

    reply

  • tubemate video downloader - 3 days, 18 hours ago

    good post

    reply

  • jual PC Murah - 18 hours ago

    Wonderful article, their quite a neat web site that you've below, carry on the excellent operate, are going to be rear.

    reply