-
Notifications
You must be signed in to change notification settings - Fork 43
Description
Hello VisualCaptcha team,
I have worked with VisualCaptcha solution for several month, on my projects and during security audits.
As penetration tester, I encountered recently an old VisualCaptcha solution (branch 5.x with API endpoints /start and /image) integrated into a CMS. I worked on this to find a way to break it, and it was successfull with this methodology :
- List all text-label solution for the VisualCaptcha
- Download all the image database used by VisualCaptcha
- Calculate checksum of each PNG downloaded
- Making an map with text-label corresponding to the right image's checksum
- Automatized with a Python script a call to "/start/1" ("1" to force a minimum number of image choice in the user session, that was 2 images in this old implementation of VisualCaptcha)
- Then download each "/image/0" and "/image/1"
- Calculate their PNG-checksum and search these values in the "map"
- Send the right "value" to the final page (100% captcha bypass)
After this successfull scenario I tried my script on the latest VisualCaptcha versoin (available on demo.visualcaptcha.com) and it doesn't work...
I dig again to understand "why it doesn't work on the latest version, and what security mecanism was added ?", then I found this issue : #2
Random bytes are added to each PNG (and audio) file delivered to the client's browser. This is the reason why my PNG checksum calculation failed (two same PNG visualy are not the same with checksum comparison).
So I updated my script to convert each PNG downloaded to JPG. These conversion delete all additionnal random data to make a comparable JPG file with the same checksum any time.
Via this mecanism, the final script works on all VisualCaptcha 5.x version, with random bytes added or not and with a 100% success rate (because the captcha solution is based on limited image database).
I encountered several times this kind of captcha (that are really appreciated for equipment like smartphone or tablet), so I decided to create a generic "VisualCaptchaBreaker" script to demonstrate the feasability of breaking this solution.
You can find the full script, default database and sample here:
https://github.com/yanncam/VisualCaptchaBreaker
Demonstration video against the demo.visualcaptcha.net page :
https://www.youtube.com/watch?v=fkfeDQqXNdk
I know that VisualCaptcha has already been broken by the past (describe in issues), but no generic script was created (usable with BurpSuite, proxy, custom configuration, etc.).
And other methods are OCR-based or need image-analysis library (slower). None of them seems to exploit the "simple checksum" method with JPG-conversion.
I think VisualCaptcha can be updated to add more randomization in image/audio to produce different checksum in PNG and after JPG conversion.
It's not a long-term solution, VisualCaptcha will be broken again via OCR or image-analysis method, but it will take more time for a potential attacker.
Plus, what do you think about the idea to add a "timer" (several second) between the "/start" call (captcha initialization) and the form submit with the captcha verification? For a simple "contact form" a user doesn't need to send the form with less than 1sec after it was displayed, so scripting attack against the form (and the captcha) will be slower.
VisualCaptcha is a good and well designed solution, but as all other "limited static-image database captcha solution", it can be broken.
Thanks for your reading and your interest,
Do not hesitate to contact me for more information,
Sincerely,