Giter Site home page Giter Site logo

visualcaptcha-bot's Introduction

visualCaptcha bot

Automate visualCaptcha, "the best captcha alternative".

Overview

visualCaptcha Bot

Description

I just wanted to show how easy it is to automate the visualCaptcha solution.

After adding the bookmarklet, go to http://demo.visualcaptcha.net/ and launch it (or just copy the script in the JavaScript console). The right image should be automatically selected.

You can renew the challenge and test it again and again. It will work with a 100% success rate unless new images were added since I computed the images list.

Installation

Add this bookmarklet and run it on a page containing a visualCaptcha (or just paste it in the JavaScript console).

Note: if you use NoScript, you'll have to (temporarily) allow www.myersdaily.org and raw.githubusercontent.com.

(function(){function a(a,b){var c=document.createElement("script");c.src=a,c.onload=b,document.head.appendChild(c)}function b(b){"md5"in window?b():a("http://www.myersdaily.org/joseph/javascript/md5.js",b)}function c(b){"visualCaptchaBot"in window?b():a("https://raw.githubusercontent.com/valeriangalliat/visualcaptcha-bot/master/bot.js",b)}function d(){visualCaptchaBot.main()}b(c.bind(this,d))}());

Actual bookmarklet source:

(function () {
    function addScript(src, cb) {
        var script = document.createElement('script');
        script.src = src;
        script.onload = cb;
        document.head.appendChild(script);
    }

    function a(cb) {
        if (!('md5' in window)) {
            addScript('http://www.myersdaily.org/joseph/javascript/md5.js', cb);
        } else {
            cb();
        }
    }

    function b(cb) {
        if (!('visualCaptchaBot' in window)) {
            addScript('https://raw.githubusercontent.com/valeriangalliat/visualcaptcha-bot/master/bot.js', cb);
        } else {
            cb();
        }
    }

    function c() {
        visualCaptchaBot.main();
    }

    a(b.bind(this, c));
}());

Process

To begin, the list of challenge images associated to their MD5 sum is retrieved with the following shell script:

git clone https://github.com/emotionLoop/visualCaptcha-packagist.git
cd visualCaptcha-packagist/src/visualCaptcha/assets/images

find . -not -name '*@2x.png' -name '*.png' \
    | xargs md5sum \
    | awk '
        BEGIN {
            print "{"
        }

        {
            print " \"" $1 "\": \"" substr($2, 3, length($2) - 6) "\","
        }

        END {
            print "}"
        }
    '

The bookmarklet loads a JavaScript MD5 function, needed to compare an image data to the previously computed list.

Then, the bot.js script will loop through all .visualCaptcha elements and try to fill them.

The target MD5 sum is the precomputed sum for the current challenge; if the challenge says to find a clip, we can lookup for the clip key in the static list.

Then, the steps are the following:

  • get each image URL,
  • get the binary image data in a blob,
  • compute the MD5 sum,
  • compare it to the target MD5 sum.

When the sum match, we can just simulate a click on the right image.

visualcaptcha-bot's People

Contributors

valeriangalliat avatar

Stargazers

 avatar

Watchers

James Cloos avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.