Captcha Breaking Experiment in PHP

Few days back I saw a really nice post of Nadim Jahangir about breaking captcha [Breaking CAPTCHA: Getting Naughty With Computer Vision Based Human Interaction Simulator Bot]. After, reading his post, I’d decided to create something similar with PHP. And I’ve already done it. I also use somewhereindhaka.net captcha for my experiment but didn’t create any bot to post in their site ;) .

Breaking Captcha with Histogram in PHP

Steps are very simple -

  1. Create horizontal & vertical histogram of captcha using PHP GD.
  2. Recognize each character by comparing values from histogram.
  3. I didn’t use any Template Recognition Algorithm. Rather, I use simple Edit Distance Algorithm (Levenshtein Distance). And it works :)

See it live – http://tr.im/35au

Tags: , , , , ,

11 Responses to “Captcha Breaking Experiment in PHP”

  1. Prince Says:

    Nice job :)

  2. Russell Says:

    LOL good good! :D

  3. Mehdi Hasan Says:

    Good job mate!

  4. Nadim Jahangir Says:

    nice job bro.
    u used Edit Distance and it works for such simple captcha. but did u try with complex ones ? lower fault tolerance of edit distance fails to cope with complex ones ;) nice attempt though :) keep doing naughty jobs :P it’s fun, isn’t it ? for such naughty guyz like u n I, some more advanced captcha schemes have already been developed like Video Captcha, have u heard of it ?

  5. VistaArc Says:

    @Nadim Jahangir

    Thanks bro, Ya I know :) . First of all, Edit Distance is not a appropriate approach you know ;) I wanted to use Neural Networking. But then think I should use something simple to break this simple captcha [Mosha marte kaman keno???] :) , Even it can be broken with distribution formulas [sounds funny though] ;) . Here for this simple captcha Edit Distance has some tolerance, but it is ignorable. No one mind if 1 is fault among 10000 :P . So, for complex captchas it will be like 9000 faults in 10000. lolz

    Hmm, After their bad experience with Audio Captcha they are now dealing with Video. Actually, Audio captcha is easier to break than Visual capthca. And, Ya its really fun doing this.

    BTW, Keep doing your great jobs. Your projects are really awesome.

  6. Nadim Jahangir Says:

    thanx,
    u seem an interesting guy. keep in touch. would love to have chat with u later on :)

  7. Kurt Alfred Kluever Says:

    @Nadim: You mentioned the Video CAPTCHA…that was my thesis topic :-) . Here’s more info about it and a link to a demo: http://www.kloover.com/video-captchas/

    @VistaArc: I tested a few different classification methods for breaking the PayPal CAPTCHA (including vertical and horizontal projections as you have done). The writeup and full MATLAB source code are up on my site: http://www.kloover.com/projects/paypalhip/

  8. Sabuj Kundu aka manchumahara Says:

    I read about the Nadim’s blog and now this one. Got fan of u both :D . I think I will try to do some experiment soon.

  9. hasin Says:

    very interesting indeed. good work :)

    have a look at http://www.cs.sfu.ca/~mori/research/gimpy/ – here is another interesting project to break captcha. see the variations they have done, just amazing.

  10. VistaArc Says:

    @Sabuj Kundu aka manchumahara – Certainly

    @hasin Thanks, I went through this link before.

  11. Niloy Says:

    That’s an excellent font you used there. For a while, I thought you had a graphics tablet and an excellent handwriting. :)

Leave a Reply