XMCP’s How To:Basic Captcha Cracking Techniques Part 1
|
| |
![]() | |
There’s about a million different captchas out there, and there’s some way to profit from each and every one of them. The trick is creating re-usable software that can handle as many types as possible. Here I’m going to show some common types of captcha, and the techniques you can use to break them.
Note: These techniques are on how to clean up the captcha, not on how to solve it per se. Solving is just a system of tests you must think up your self, or by training. I’m going to have something more on that in a later post.
Captcha 1: Dots in the Background/Swirls/Random Dashes
![]()
- This can be solved by a basic and common technique. You scroll through all of the pixels, checking each one. For each pixel that is colored, you check 1 up, 1 down, 1 to the left, and 1 to the right. If any of those has a color, then you move on to the next pixel. If none of those have color, it’s a rogue pixel, and should be set to white.
- If it’s like the third captcha pictured above, then you should run the procedure 2-3 times to eliminate the swirls (small portions of the circles will be picked up each time.
Captcha 2: Letters in the Background

- Personally, I despise these captchas
- The first step is to go through each pixel, and determine how close it is to white. Find a set amount(Maybe 2 out of the 3 values in the 255,255,255 color scheme should be >200, and the last should be >125) of whiteness that will be eliminated, and converted completely to white.
- Convert everything else to black.
- Run the test detailed for the first type of captcha, to clean up any rogue dots that survived the test.
- When splitting these letters up, make sure to record the start and end points for each letter, as they sometimes overlap on the X axis(though not physically), and this becomes important when determining the orders of the letters.
- Writing the tests for each letter of these is relatively easy. They don’t twist or bend too much, and once they’re converted to black, life is good.
Captcha 3: Fading Gradient Background

- I’ll be honest, these ones are not my expertise, but they’re simple enough.
- The letters on these don’t touch the top, or the bottom of the image, so first, scroll through left to right at the top and bottom obtaining color samples.
- After that, for each horizontal pixel you check, compare the color of each vertical pixel in between the 2 points. If the color is too different, convert to black. If it’s not different, convert to white.
Captcha 4: Strikethroughs

- These look simple enough, but are not for beginners.
- This technique is not perfect, and will alter the letters somewhat.
- Scroll through each column vertically, and mark any black pixels present on a column that has less than 2 black pixels, and connects to less than 10 or so black pixels (horizontally and vertically) within 3 pixels on either side as an arbitrary color(say, red for this example)
- Use the y=mx+b format of a line, and connect all broken red pixels to the nearest pixel on the right with red, effectively recreating the line
- Turn all red pixels white.
- Scroll through one more time. If there is any white pixel that has black pixels on both the top and the bottom within 2 pixels, then set it to black. That should recreate the letters.
- Pray.
So that’s how to clean up captchas for later recognition. Later, I’ll write an entry about how to identify the individual letters.





















November 5th, 2007 at 11:37 pm
Good one.
I am writing some articles on Captcha cracking too.
November 13th, 2007 at 10:47 am
theorist :)))))
Practice where?
November 13th, 2007 at 10:53 am
haha I’m no theorist.
I’ve gotten a decent edge up on the Google Captcha,
Sucessfully broken 2 popular social bookmarking sites captchas,
and broken 2 or 3 different web directory captchas.
The only issue is, if I posted any code showing how to do it, everyone would pick it up, the captcha would change, and my work would be useless.
December 25th, 2007 at 12:42 pm
[…] P.S : vous pouvez aussi lire ces articles en anglais : http://www.slightlyshadyseo.com/?p=25 […]
January 17th, 2008 at 3:39 am
Hi. I’m also working on cracking the google captcha, mostly for the challenge of it. Can you hit me up (my e-mail was provided above) via e-mail so we can compare notes.
April 2nd, 2008 at 10:26 am
im a developer and i love the stuff you are doing, id love to talk with you about some ideas ive had
May 22nd, 2008 at 10:39 am
[…] for various reasons… having never broke a captcha before I checked Harry’s and Slightly’s blogs to see how to do it. The captcha I needed to break in comparison to what their both up to is […]