This snippet is almost five years old. I used it long back when I was working in a project that needs captcha implementation. Today I am sharing this because we can see many banks are still using the captcha to protect their login page.

This article will show you how easy it is to decode the captcha and automate the process in bots. With 2 simple steps the captcha can be decoded, based on this simple command you can write scripts to automate the captcha and by pass the security of any websites.

We use ImageMagick to Convert the captcha into grayscale image, using grayscale image will improve accuracy when compared to color images.

convert Captcha.gif -colorspace Gray gray100.png

Feed the grayscale image to tesseract ocr, for converting the image to text.

tesseract gray100.png text

On success, above command will create a file named text.txt with text content.

$ cat text.txt

Instead of captcha you should try two factor authentications like e-mail and SMS OTP’s to keep the bots away.