Usually CAPTCHAs are analyzed by using neural network, it's a good approach, but it may be overcomplicated in simple cases. Presented below, much shorter algorithm can produce sufficient results for uncomplicated CAPTCHAs.
In this algorithm an image with unknown letter is compared with samples of known letters, the letter in the most similar sample is probably also the letter in analyzed image. It was implemented as a Python script, usage presented below:
bash-3.2$ python cracker.py test1.png e
bash-3.2$ python cracker.py test2.png p
It can't be directly used on a raw CAPTCHA, firstly small artifacts have to be removed from the CAPTCHA, secondly each letter should be stored in a separate image.
The script below requires samples directory with samples of letters. A sample set and this CAPTCHA breaker can be downloaded from my GitHub (CaptachaCracker directory).
import sys, os import math import string import Image import PIL.ImageChops if __name__=="__main__": input = sys.argv[1] base = Image.open(input).convert('L') class Fit: letter = None difference = 0 best = Fit() for letter in string.lowercase: current = Fit() current.letter = letter sample_path = os.path.join('samples', letter + '.png') sample = Image.open(sample_path).convert('L').resize(base.size) difference = PIL.ImageChops.difference(base, sample) for x in range(difference.size[0]): for y in range(difference.size[1]): current.difference += difference.getpixel((x, y)) if not best.letter or best.difference > current.difference: best = current print best.letter
I was surprised that this task can be done in less than 50 lines! Of course it's not good enough to break complicated CAPTCHAs, but they also aren't easy task for more complicated algorithms.
wow!!!
ReplyDeletethe great blog.the post is very informative and very useful.
keep blogging.
image decoding
OCR software can be used as well. The problem with recognition of the letters is that there isn't a good way to recognise cambered letters (popular "fish eye" effects in Google CAPTCHA or Open Captcha).
ReplyDeleteIMHO OCR is overkill in most of the captchas, in addition, it will be probably too slow.
Delete@Anonymous, do you know open source libraries that would be good for this?
DeleteI heards about a project where DSL (in Hasjkell) was used to program route of a satelite.
Delete*Haskell
Delete@spainman, sounds cool! I will try to find more info about this project :)
DeleteHi, where is the sample directory at GitHub?
ReplyDeleteHi Alair,
Deleteit's here:
https://github.com/RobertGawron/snippets/tree/master/CaptachaCracker/samples
- Robert
You can use this captcha solver service for better captcha type support https://www.captchasolutions.com/
ReplyDeleteHi,
Deleteyes, thanks for the link, for commercional use it would be much more suitable.
Bob
en son çıkan perde modelleri
ReplyDeleteuc satın al
en son çıkan perde modelleri
nft nasıl alınır
minecraft premium
özel ambulans
yurtdışı kargo
lisans satın al
Congratulations on your article, it was very helpful and successful. 66a5b1b78247971704bd770b86651825
ReplyDeletenumara onay
sms onay
website kurma
Thank you for your explanation, very good content. 5ccf0f6b8bf4cc6ceb44a169bbabcab3
ReplyDeletealtın dedektörü
Thanks for your article. 3480323888524bdde9ee3f6affaf9f0f
ReplyDeleteevden iş imkanı
Good content. You write beautiful things.
ReplyDeletemrbahis
sportsbet
vbet
hacklink
sportsbet
hacklink
vbet
taksi
korsan taksi
maraş
ReplyDeletebursa
tokat
uşak
samsun
8ON6
salt likit
ReplyDeletesalt likit
dr mood likit
big boss likit
dl likit
dark likit
Z1S3
https://saglamproxy.com
ReplyDeletemetin2 proxy
proxy satın al
knight online proxy
mobil proxy satın al
PWWJA
https://bayanlarsitesi.com/
ReplyDeleteAltınşehir
Karaköy
Alemdağ
Gürpınar
LFFN
ankara parça eşya taşıma
ReplyDeletetakipçi satın al
antalya rent a car
antalya rent a car
ankara parça eşya taşıma
Z5B726
578AE
ReplyDeleteKalıcı Makyaj
Karaman Lojistik
Bitci Güvenilir mi
Şırnak Şehirler Arası Nakliyat
Batman Parça Eşya Taşıma
Ünye Oto Lastik
Bitexen Güvenilir mi
Çerkezköy Çamaşır Makinesi Tamircisi
Antalya Lojistik
05680
ReplyDeleteKastamonu Parça Eşya Taşıma
Ünye Kurtarıcı
Silivri Boya Ustası
İzmir Şehir İçi Nakliyat
İstanbul Lojistik
Bursa Şehir İçi Nakliyat
Sincan Fayans Ustası
Kırıkkale Şehir İçi Nakliyat
Sinop Evden Eve Nakliyat
688F3
ReplyDeleteistanbul parasız sohbet
hatay sohbet muhabbet
düzce canlı sohbet ücretsiz
bartın görüntülü sohbet sitesi
Bilecik Telefonda Rastgele Sohbet
görüntülü sohbet canlı
diyarbakır canlı sohbet et
Eskişehir Yabancı Görüntülü Sohbet Uygulamaları
görüntülü sohbet
71A71
ReplyDeletekocaeli rastgele sohbet siteleri
balıkesir sesli görüntülü sohbet
ordu mobil sohbet
kocaeli mobil sohbet et
adana görüntülü canlı sohbet
adana parasız görüntülü sohbet
karaman parasız görüntülü sohbet uygulamaları
kastamonu rastgele canlı sohbet
Mersin Bedava Görüntülü Sohbet
A66FF
ReplyDeleteTwitch Takipçi Satın Al
Parasız Görüntülü Sohbet
Kripto Para Üretme
Bitcoin Üretme
Tiktok İzlenme Satın Al
Coin Nasıl Alınır
Binance Referans Kodu
Spotify Takipçi Hilesi
Youtube Abone Hilesi
29B25
ReplyDeleteNonolive Takipçi Satın Al
Mexc Borsası Güvenilir mi
Threads Yeniden Paylaş Hilesi
MEME Coin Hangi Borsada
Telegram Abone Satın Al
Coin Nasıl Kazılır
Kripto Para Kazanma
Instagram Takipçi Hilesi
Mith Coin Hangi Borsada
3F2CB
ReplyDeleteledger desktop
avax wallet
trust wallet web
trezor suite
web bitbox wallet
ledger web
ledger web
web arculus
arculus wallet web