Saturday, April 16, 2011

HTML based Captcha

html based captcha exampleSomeone on the WickedFire forums came across an interesting problem. He needed to automate the submission of data to a website which used a relatively simple looking captcha.


Usually for a simple looking captcha like this, you’d just feed the image straight through gocr which would output plain text. If the captcha is more complicated then you have to write your own OCR code.


This captcha however, is deceiving. It’s not actually an image. It’s a mishmash of HTML and CSS!

.


html based captcha source


.


This is the first time I’ve seen something like this. It’s actually quite a clever idea. Being pure HTML/CSS code, it’s impossible to feed it through an OCR package or even pass it through to a human based captcha cracking service.


Although the idea is quite clever, it definitely needs improvement. The captcha is made up of bold tags () which are set to be 1 pixel high/wide using CSS. Some tags have a coloured background and others don’t. This results in what looks like an image to the human eye.


The following script converts the HTML/css combo to a regular image, ready to be passed through gOCR or similar.


(Note: Since there’s consistant and equal spacing and no noise or distortion in the image, I’m sure that if you sat down and mapped out each character then you could probably convert the captcha to regular text without even converting it to an image and running it through OCR software.)

No comments:

Post a Comment