安云网 - AnYun.ORG | 专注于网络信息收集、网络数据分享、网络安全研究、网络各种猎奇八卦。
当前位置: 安云网 > 技术关注 > WooYun > WooYun-Zone > JS破解乌云验证码 (WOOYUN)

JS破解乌云验证码 (WOOYUN)

时间:2017-09-07来源: 作者:点击:
网络安全资讯、讨论,跨站师,渗透师,结界师聚集之地
p.z (谈钞票伤感情 谈感情又伤钞票又伤感情) | 2015-01-17 15:35

以后盲打乌云后台有验证码也不怕啦

(function(){
    function decaptcha(image){
        var canvas = document.createElement("canvas").getContext('2d');
        var result = '';
        var letter = [[],[],[],[]];
        var letterArea = {
            '0': {'x1':14, 'x2':21, 'y1': 4, 'y2': 13}, //本文来自安云网
            '1': {'x1':23, 'x2':30, 'y1': 4, 'y2': 13},
            '2': {'x1':32, 'x2':39, 'y1': 4, 'y2': 13},
            '3': {'x1':41, 'x2':50, 'y1': 4, 'y2': 13},
        }
        var captchaData = {
            '2':[[0,0,1,1,1,1,0,0],[0,1,1,0,0,1,1,0],[1,1,0,1,0,0,1,1],[0,0,0,0,0,0,1,1],[0,0,0,0,0,1,1,0],[0,0,0,0,1,1,0,0],[0,1,0,1,1,0,0,0],[0,0,1,1,0,0,0,0],[0,1,1,0,0,0,0,0],[1,1,1,1,1,1,1,1]],
            '3':[[0,1,1,1,1,1,0,0],[1,1,0,0,0,1,1,0],[0,0,0,0,0,0,1,1],[0,0,0,0,0,1,1,0],[0,0,0,1,1,1,0,0],[0,0,0,0,0,1,1,0],[0,0,0,0,0,0,1,1],[0,0,0,0,0,0,1,1],[1,1,0,0,0,1,1,0],[0,1,1,1,1,1,0,0]],

//安云网咨询系统


            '4': [[0,0,0,0,0,1,1,0],[0,0,0,0,1,1,1,0],[0,0,0,1,1,1,1,0],[0,0,1,1,0,1,1,0],[0,1,1,0,0,1,1,0],[1,1,0,0,0,1,1,0],[1,1,1,1,1,1,1,1],[0,0,0,0,0,1,1,0],[0,0,0,0,0,1,1,0],[0,0,0,0,0,1,1,0]],
            '5': [[1,1,1,1,1,1,1,0],[1,1,0,0,0,0,0,0],[1,1,0,0,0,0,0,1],[1,1,1,1,1,1,0,0],[1,1,1,0,0,1,1,0],[0,0,0,0,0,0,1,1],[0,0,0,0,0,0,1,1],[1,1,0,0,0,0,1,1],[0,1,1,0,0,1,1,0],[0,0,1,1,1,1,0,0]],
            '6': [[0,0,1,1,1,1,0,0],[0,1,1,0,0,1,1,0],[1,1,0,0,0,0,1,0],[1,1,0,1,0,0,0,0],[1,1,0,1,1,1,0,0],[1,1,1,0,0,1,1,0],[1,1,0,0,0,0,1,1],[1,1,0,0,0,0,1,1],[0,1,1,0,0,1,1,0],[0,0,1,1,1,1,0,0]],
            '7': [[1,1,1,1,1,1,1,1],[0,0,0,0,0,0,1,1],[0,0,0,0,0,0,1,1],[0,0,0,0,0,1,1,0],[0,0,0,0,1,1,0,0],[0,0,0,1,1,0,0,0],[0,0,1,1,0,0,0,0],[0,1,1,0,0,0,0,0],[1,1,0,0,0,0,0,0],[1,1,0,0,0,0,0,0]],
//本文来自安云网

            '8': [[0,0,1,1,1,1,0,0],[0,1,1,0,0,1,1,0],[1,1,0,0,0,0,1,1],[0,1,1,0,0,1,1,0],[0,0,1,1,1,1,0,0],[0,1,1,0,0,1,1,0],[1,1,0,0,0,0,1,1],[1,1,0,0,0,0,1,1],[0,1,1,0,0,1,1,0],[0,0,1,1,1,1,0,0]],
            '9': [[0,0,1,1,1,1,0,0],[0,1,1,0,0,1,1,0],[1,1,0,0,0,0,1,1],[1,1,0,1,0,0,1,1],[0,1,1,0,0,1,1,1],[0,0,1,1,1,0,1,1],[0,0,0,0,0,0,1,1],[0,1,0,0,0,0,1,1],[0,1,1,0,0,1,1,0],[0,0,1,1,1,1,0,0]],
            'a': [[0,0,0,1,1,0,0,0],[0,0,1,1,1,1,0,0],[0,1,1,0,0,1,1,0],[1,1,0,0,0,0,1,1],[1,1,0,0,0,0,1,1],[1,1,0,0,0,0,1,1],[1,1,1,1,1,1,1,1],[1,1,0,0,0,0,1,1],[1,1,0,0,0,0,1,1],[1,1,0,0,0,0,1,1]],
            'b': [[1,1,1,1,1,1,0,0],[1,1,0,0,0,1,1,0],[1,1,0,0,0,0,1,1],[1,1,0,0,0,1,1,0],[1,1,1,1,1,1,0,0],[1,1,0,0,0,1,1,0],[1,1,0,0,0,0,1,1],[1,1,0,0,0,0,1,1],[1,1,0,0,0,1,1,0],[1,1,1,1,1,1,0,0]], //内容来自安云网
            'c': [[0,0,1,1,1,1,1,0],[0,1,1,0,0,0,1,1],[1,1,1,0,0,0,0,1],[1,1,0,0,0,0,0,0],[1,1,0,0,0,0,0,0],[1,1,0,0,0,0,0,0],[1,1,0,0,0,0,0,0],[1,1,0,0,0,0,0,1],[0,1,1,0,0,0,1,1],[0,0,1,1,1,1,1,0]],
            'd': [[1,1,1,1,1,1,0,0],[1,1,0,0,0,1,1,0],[1,1,0,0,0,0,1,1],[1,1,0,0,0,0,1,1],[1,1,0,0,1,0,1,1],[1,1,0,0,0,1,1,1],[1,1,0,0,0,0,1,1],[1,1,0,0,0,0,1,1],[1,1,0,0,0,1,1,0],[1,1,1,1,1,1,0,0]],
            'e': [[1,1,1,1,1,1,1,0],[1,1,0,0,0,0,0,0],[1,1,0,0,0,0,1,0],[1,1,0,0,0,0,0,0],[1,1,1,1,1,1,0,1],[1,1,0,1,0,0,0,0],[1,1,0,0,0,0,0,0],[1,1,0,0,0,0,0,0],[1,1,0,0,0,0,0,0],[1,1,1,1,1,1,1,0]],
            'f': [[1,1,1,1,1,1,1,1],[1,1,0,0,0,0,0,0],[1,1,0,0,0,0,0,0],[1,1,0,0,0,0,0,0],[1,1,1,1,1,1,0,0],[1,1,0,0,0,0,0,0],[1,1,0,0,0,0,0,0],[1,1,0,0,0,0,0,0],[1,1,0,0,0,0,0,0],[1,1,0,0,0,0,0,0]],
//安云网,anyun.org

            'g': [[0,0,1,1,1,1,1,0],[0,1,1,0,0,1,1,1],[1,1,0,0,0,0,0,0],[1,1,0,0,0,0,0,0],[1,1,0,0,0,0,0,0],[1,1,0,0,0,1,1,1],[1,1,0,0,0,0,1,1],[1,1,0,0,0,0,1,1],[0,1,1,0,0,0,1,1],[0,0,1,1,1,1,1,0]],
            'h': [[1,1,0,0,0,0,1,1],[1,1,0,0,0,0,1,1],[1,1,0,0,0,0,1,1],[1,1,0,0,0,0,1,1],[1,1,1,1,1,1,1,1],[1,1,0,0,0,0,1,1],[1,1,0,0,0,0,1,1],[1,1,0,0,0,0,1,1],[1,1,0,0,0,0,1,1],[1,1,0,0,0,0,1,1]],
            'j': [[0,0,0,1,1,1,1,0],[0,0,0,0,0,1,1,0],[0,0,0,0,1,1,1,0],[1,0,0,0,0,1,1,0],[0,0,0,0,0,1,1,0],[0,1,0,0,0,1,1,0],[0,0,0,0,0,1,1,0],[0,1,0,0,0,1,1,0],[0,1,1,0,1,1,0,0],[0,0,1,1,1,0,0,0]],
            'k': [[1,1,0,0,0,0,1,1],[1,1,0,0,0,1,1,0],[1,1,0,0,1,1,0,0],[1,1,0,1,1,0,0,0],[1,1,1,1,0,0,0,0],[1,1,1,1,0,0,0,0],[1,1,0,1,1,0,0,0],[1,1,0,0,1,1,0,0],[1,1,0,0,0,1,1,0],[1,1,0,0,0,0,1,1]], //ANYUN.ORG
            'l': [[1,1,0,0,0,0,0,0],[1,1,0,0,0,0,0,0],[1,1,0,0,0,0,0,0],[1,1,0,0,0,0,0,0],[1,1,0,0,0,0,0,0],[1,1,0,0,0,0,0,0],[1,1,0,0,0,0,0,0],[1,1,0,0,0,0,0,0],[1,1,0,0,0,0,0,0],[1,1,1,1,1,1,1,0]],
            'm': [[1,1,0,0,0,0,1,1],[1,1,1,0,0,1,1,1],[1,1,1,1,1,1,1,1],[1,1,0,1,1,0,1,1],[1,1,0,1,1,0,1,1],[1,1,0,1,1,0,1,1],[1,1,0,0,0,0,1,1],[1,1,0,0,0,0,1,1],[1,1,0,0,0,0,1,1],[1,1,0,0,0,0,1,1]],
            'n': [[1,1,0,0,0,0,1,1],[1,1,1,0,0,0,1,1],[1,1,1,1,0,0,1,1],[1,1,1,1,0,0,1,1],[1,1,0,1,1,0,1,1],[1,1,0,1,1,0,1,1],[1,1,0,0,1,1,1,1],[1,1,0,0,0,1,1,1],[1,1,0,0,0,1,1,1],[1,1,0,0,1,0,1,1]],
            'p': [[1,1,1,1,1,1,1,0],[1,1,0,0,0,0,1,1],[1,1,0,0,0,0,1,1],[1,1,0,0,0,0,1,1],[1,1,1,1,1,1,1,0],[1,1,0,0,0,0,0,0],[1,1,0,0,0,0,0,0],[1,1,0,0,0,0,0,0],[1,1,0,0,0,0,0,0],[1,1,0,0,0,0,0,0]],
//copyright AnYun.ORG

            'q': [[0,0,1,1,1,1,0,0],[0,1,1,0,0,1,1,0],[1,1,0,1,0,0,1,1],[1,1,0,0,0,0,1,1],[1,1,0,0,0,0,1,1],[1,1,0,0,0,0,1,1],[1,1,0,1,1,0,1,1],[1,1,0,0,1,1,1,1],[0,1,1,0,0,1,1,0],[0,0,1,1,1,1,0,1]],
            'r': [[1,1,1,1,1,1,1,0],[1,1,0,0,0,0,1,1],[1,1,0,0,0,0,1,1],[1,1,0,0,0,0,1,1],[1,1,1,1,1,1,1,0],[1,1,1,1,1,0,0,0],[1,1,1,0,1,1,0,0],[1,1,0,0,0,1,1,0],[1,1,0,0,0,0,1,1],[1,1,0,0,0,0,1,1]],
            's': [[0,1,1,1,1,1,1,0],[1,1,0,0,0,0,1,1],[1,1,0,0,0,0,0,0],[1,1,0,0,0,0,0,0],[0,1,1,1,1,1,1,0],[0,0,0,0,0,0,1,1],[0,0,0,0,0,0,1,1],[0,0,0,0,0,0,1,1],[1,1,0,0,0,0,1,1],[0,1,1,1,1,1,1,0]],
            't': [[1,1,1,1,1,1,1,1],[0,0,0,1,1,0,0,0],[0,0,0,1,1,0,0,0],[0,0,0,1,1,0,0,0],[0,0,0,1,1,0,0,0],[0,0,0,1,1,0,0,0],[0,0,0,1,1,0,0,0],[0,0,0,1,1,0,0,0],[0,0,0,1,1,0,0,0],[0,0,0,1,1,0,0,0]],

//内容来自AnYun.ORG


            'u': [[1,1,0,0,0,0,1,1],[1,1,0,0,0,0,1,1],[1,1,0,0,0,0,1,1],[1,1,0,0,0,0,1,1],[1,1,0,0,0,0,1,1],[1,1,0,0,0,0,1,1],[1,1,0,0,0,0,1,1],[1,1,0,0,0,0,1,1],[0,1,1,0,0,1,1,0],[0,0,1,1,1,1,0,0]],
            'v': [[1,1,0,0,0,0,1,1],[1,1,1,0,0,1,1,1],[1,1,0,0,0,0,1,1],[0,1,1,0,0,1,1,0],[0,1,1,0,0,1,1,0],[0,1,1,0,0,1,1,0],[0,0,1,1,1,1,0,0],[0,0,1,1,1,1,0,0],[0,0,0,1,1,0,0,0],[0,0,0,1,1,0,0,0]],
            'w': [[1,1,0,0,0,0,1,1],[1,1,0,0,0,0,1,1],[1,1,0,0,0,0,1,1],[1,1,0,0,0,0,1,1],[1,1,0,1,1,0,1,1],[1,1,0,1,1,0,1,1],[1,1,0,1,1,0,1,1],[1,1,1,1,1,1,1,1],[1,1,1,0,0,1,1,1],[1,1,0,0,0,0,1,1]],
            'x': [[1,1,0,0,0,0,1,1],[1,1,0,0,0,0,1,1],[0,1,1,0,0,1,1,0],[0,0,1,1,1,1,0,0],[0,0,0,1,1,0,0,0],[0,0,0,1,1,0,0,0],[0,0,1,1,1,1,0,0],[0,1,1,0,0,1,1,0],[1,1,0,0,0,0,1,1],[1,1,0,0,0,0,1,1]], //copyright AnYun.ORG
            'y': [[1,1,0,0,0,0,1,1],[1,1,0,0,0,0,1,1],[0,1,1,0,0,1,1,0],[0,0,1,1,1,1,0,0],[0,0,0,1,1,0,0,0],[0,0,0,1,1,0,0,0],[0,0,0,1,1,0,0,0],[0,0,0,1,1,0,0,0],[0,0,0,1,1,0,0,0],[0,0,0,1,1,0,0,0]],
            'z': [[1,1,1,1,1,1,1,0],[0,0,0,0,0,1,1,0],[0,0,0,0,0,1,1,0],[0,0,0,0,1,1,0,0],[0,0,0,1,1,0,0,0],[0,0,1,1,0,0,0,0],[0,1,1,0,0,0,0,0],[1,1,0,0,0,0,0,0],[1,1,0,0,0,0,0,0],[1,1,1,1,1,1,1,0]],
        }

        var imageWidth = image.width;
        var imageHeight = image.height;

        canvas.drawImage(image, 0, 0)
        var imageData = canvas.getImageData(0, 0, imageWidth, imageHeight);
        var pixels = imageData.data;
//本文来自安云网


        var isLetter = function(pixeldata){
            var sum = pixeldata[0] + pixeldata[1] + pixeldata[2];
            if (sum<6*3 || sum>250*3){
                return 1;
            }else{
                return 0;
            }
        }

        for(var _h=0; _h<imageHeight; _h++){
            for(var _w=0; _w<imageWidth; _w++){
                var i = 4*(_w + _h*imageWidth); //安云网,anyun.org
                for(var _offset in letterArea){
                    var areaData = letterArea[_offset]
                    if((_w>=areaData['x1']&&_w<=areaData['x2']) && (_h>=areaData['y1']&&_h<=areaData['y2'])){
                        var _x = _w - areaData['x1'];
                        var _y = _h - areaData['y1'];  
                        if(letter[_offset][_y] == undefined){
//本文来自安云网

                            letter[_offset][_y] = [];
                        }
                        letter[_offset][_y][_x] = isLetter([].slice.call(pixels, i,i+4));
                    }
                }
            }
        }
        for(var i=0;i<letter.length;i++){
            var maxError = 1000;

//安云网咨询系统


            var bestResult = ' ';
            for(var _letter in captchaData){
                var _error = 0;
                for(var _i=0; _i<letter[i].length; _i++){
                    for(var _j=0; _j<letter[i][_i].length; _j++){
                        if(letter[i][_i][_j] != captchaData[_letter][_i][_j]){
                            _error += 1; //安云网,anyun.org
                        }
                    }
                }
                if(_error < maxError){
                    maxError = _error;
                    bestResult = _letter;
                }
            }
            result += bestResult; //安云网,anyun.org
        }

        return result
    }

    function main(target){
        if(!self.$) return;
        target.forEach(function(item){
            var cpt = $(item['cpt']);
            var ipt = $(item['ipt']);
            if(cpt.length && ipt.length){
                ipt.val(decaptcha(cpt[0]));
            }
        })
    }

    var target = [
//本文来自安云网

        //评论/提交
        {'cpt': 'img[id^=captcha]','ipt':'input#captcha'},
        //集市
        {'cpt': 'img#captchabuy_img','ipt':'input#captchabuy'},
        //控制面板/登陆
        {'cpt': 'img[src^=http://www.wooyun.org/captcha.php]','ipt':'input[name=captcha]'}
    ];
    main(target);
})();
//安云网咨询系统

分享到:
  1. 1#
    回复此人 感谢
    Sogili (.) 长短短 (.) | 2015-01-17 15:36

    //安云网咨询系统

  2. 2#
    回复此人 感谢
    好基友一辈子 | 2015-01-17 15:38

    //内容来自安云网

  3. 3#
    回复此人 感谢
    小马达 | 2015-01-17 15:38

    火钳刘明

    //copyright AnYun.ORG

  4. 4#
    回复此人 感谢
    园长 (喵~) | 2015-01-17 15:44

    围观 //ANYUN.ORG

  5. 5#
    回复此人 感谢
    刘海哥 (‮moc.ghuil.www) | 2015-01-17 15:47

    屌个不停! //安云网,anyun.org

  6. 6#
    回复此人 感谢
    泳少 (此号被射!by U神) | 2015-01-17 15:53

    一直觉得乌云验证码就是个问题。 //copyright AnYun.ORG

  7. 7#
    回复此人 感谢
    whale | 2015-01-17 15:53

    怎么用。。。

    //安云网咨询系统

  8. 8#
    回复此人 感谢
    猪猪侠 (每次有人骂我是猪我都说自己是猪猪侠) | 2015-01-17 15:58

    厉害 //copyright AnYun.ORG

  9. 9#
    回复此人 感谢
    July | 2015-01-17 16:03

    膜拜

    //copyright AnYun.ORG

  10. 10#
    回复此人 感谢
    ljhj (但愿低调,好好学习。) | 2015-01-17 16:05

    已经无力吐槽了好么,大乌云的验证码居然连干扰都没有。 //ANYUN.ORG

  11. 11#
    回复此人 感谢
    B1uH4ck | 2015-01-17 16:32

    怎么用看起来diao //安云网咨询系统

  12. 12#
    回复此人 感谢
    M4ster (Black || White) | 2015-01-17 17:01

    厉害

    //内容来自安云网

  13. 13#
    回复此人 感谢
    xiaoxin (己所不欲,勿施于人) | 2015-01-17 17:04

    今天说吊的人,改天估计会说,我擦我的wb

    //安云网,anyun.org

  14. 14#
    回复此人 感谢
    风情万种 (JJ好痒) | 2015-01-17 19:04

    牛哇 //ANYUN.ORG

  15. 15#
    回复此人 感谢
    蓝哆 (我是作(zhao)死(shi)哆~) | 2015-01-17 20:26

    厉害

    //copyright AnYun.ORG

  16. 16#
    回复此人 感谢
    sky (啪啪啪啪脸好疼是不是?) | 2015-01-17 21:19

    。。真叼。。 //安云网,anyun.org

  17. 17#
    回复此人 感谢
    zeracker (多乌云、多机会!!! 微信公众号:301在路上) | 2015-01-17 21:52

    贱人就是矫情...  过来我保证不打死你。

    //安云网咨询系统

  18. 18#
    回复此人 感谢
    PING | 2015-01-17 22:14

    猴犀利!

    //安云网咨询系统

  19. 19#
    回复此人 感谢
    动后河 (☭) | 2015-01-17 22:48

    这是要先安装node嘛

    //安云网,anyun.org

  20. 20#
    回复此人 感谢
    Me_Fortune (老子是要进土豪榜的男人。) | 2015-01-17 23:39

    好厉害  =  =

    //ANYUN.ORG

  21. 21#
    回复此人 感谢
    0x12 (帽子掉了|多逛,少说话。|小学生                                                                                                                                                                                                                                               ) | 2015-01-18 01:49

    6 //copyright AnYun.ORG

  22. 22#
    回复此人 感谢
    我了个去 | 2015-01-18 01:52

    点lz名字,直接把我重定向到 http://zone.wooyun.org/login ,完了,lz把我号给盗了。。。 //安云网,anyun.org

  23. 23#
    回复此人 感谢
    我了个去 | 2015-01-18 01:55

    我擦,是我网络问题 //本文来自安云网

    http://xxx.xxx.xxx.8:83/1Q2W3E4R5T6Y7U8I9O0P1Z2X3C4V5B/zone.wooyun.org/user/p.z

    铁通的网络,代理把它当作一个文件下载了。。。 //内容来自安云网

  24. 24#
    回复此人 感谢
    我了个去 | 2015-01-18 01:58

    用大天朝的网络,真是一点都不省心啊。lz屌爆了,已顶。 //安云网咨询系统

  25. 25#
    回复此人 感谢
    xsser (十根阳具有长短!!) | 2015-01-18 08:04

    屌丝何必为难屌丝 //内容来自安云网

  26. 26#
    回复此人 感谢
    cat73 | 2015-01-18 09:03

    @xsser - -要花时间改验证码了么 //内容来自安云网

  27. 27#
    回复此人 感谢
    cat73 | 2015-01-18 09:05

    @xsser http://cat73.coding.io/phps/verify.html

    //内容来自安云网

    以前写的东东- - //本文来自安云网

  28. 28#
    回复此人 感谢
    cat73 | 2015-01-18 09:06

    数学渣 实在是做不来模糊算法- -

    //内容来自AnYun.ORG

  29. 29#
    回复此人 感谢
    coms | 2015-01-18 09:48

    @我了个去 这是我们公司的产品,您告诉我具体设备IP,我上去把乌云整站放行掉

    //安云网咨询系统

  30. 30#
    回复此人 感谢
    溯雪 | 2015-01-18 10:03

    好屌 这个要顶

    //内容来自AnYun.ORG

  31. 31#
    回复此人 感谢
    RainShine (I'm your angel of music.) | 2015-01-18 10:13

    叼啊!JS破解乌云验证码……火钳刘明

    //内容来自AnYun.ORG

  32. 32#
    回复此人 感谢
    我了个去 | 2015-01-18 11:18

    @coms  。。。 //内容来自AnYun.ORG

  33. 33#
    回复此人 感谢
    cat73 | 2015-01-18 12:00

    //仿造大牛的做了个EMS验证码识别 //安云网咨询系统
    //http://www.ems.com.cn/mailtracking/you_jian_cha_xun.html

    function decaptcha(image){
        var letterArea = {
            '0': {'x1': 7, 'x2': 15, 'y1': 3, 'y2': 15},
            '1': {'x1': 20, 'x2': 28, 'y1': 3, 'y2': 15},
            '2': {'x1': 33, 'x2': 41, 'y1': 3, 'y2': 15},
            '3': {'x1': 46, 'x2': 54, 'y1': 3, 'y2': 15},
            '4': {'x1': 59, 'x2': 67, 'y1': 3, 'y2': 15},
            '5': {'x1': 72, 'x2': 80, 'y1': 3, 'y2': 15} //ANYUN.ORG
        };

        var captchaData = {
            '0': [
                [0, 0, 0, 1, 1, 1, 0, 0, 0],
                [0, 1, 1, 1, 1, 1, 1, 1, 0],
                [0, 1, 1, 0, 0, 0, 1, 1, 0],
                [1, 1, 0, 0, 0, 0, 0, 1, 1],
                [1, 1, 0, 0, 0, 0, 0, 1, 1],
                [1, 1, 0, 0, 0, 0, 0, 1, 1],
                [1, 1, 0, 0, 0, 0, 0, 1, 1],
                [1, 1, 0, 0, 0, 0, 0, 1, 1],
                [1, 1, 0, 0, 0, 0, 0, 1, 1],

    //内容来自AnYun.ORG


                [1, 1, 0, 0, 0, 0, 0, 1, 1],
                [0, 1, 1, 0, 0, 0, 1, 1, 0],
                [0, 1, 1, 1, 1, 1, 1, 1, 0],
                [0, 0, 0, 1, 1, 1, 0, 0, 0]
            ],
          
            '1': [
                [0, 0, 1, 1, 1, 0, 0, 0, 2],
                [1, 1, 1, 1, 1, 0, 0, 0, 2],
                [1, 1, 1, 1, 1, 0, 0, 0, 2],
                [0, 0, 0, 1, 1, 0, 0, 0, 2],
                [0, 0, 0, 1, 1, 0, 0, 0, 2],
    //copyright AnYun.ORG

                [0, 0, 0, 1, 1, 0, 0, 0, 2],
                [0, 0, 0, 1, 1, 0, 0, 0, 2],
                [0, 0, 0, 1, 1, 0, 0, 0, 2],
                [0, 0, 0, 1, 1, 0, 0, 0, 2],
                [0, 0, 0, 1, 1, 0, 0, 0, 2],
                [0, 0, 0, 1, 1, 0, 0, 0, 2],
                [1, 1, 1, 1, 1, 1, 1, 1, 2],
                [1, 1, 1, 1, 1, 1, 1, 1, 2]
            ],
          
            '2': [
                [0, 1, 1, 1, 1, 1, 0, 0, 2],
    //内容来自安云网

                [1, 1, 1, 1, 1, 1, 1, 0, 2],
                [1, 0, 0, 0, 0, 0, 1, 1, 2],
                [0, 0, 0, 0, 0, 0, 1, 1, 2],
                [0, 0, 0, 0, 0, 0, 1, 1, 2],
                [0, 0, 0, 0, 0, 1, 1, 0, 2],
                [0, 0, 0, 0, 1, 1, 0, 0, 2],
                [0, 0, 0, 1, 1, 0, 0, 0, 2],
                [0, 0, 1, 1, 0, 0, 0, 0, 2],
                [0, 1, 1, 0, 0, 0, 0, 0, 2],
                [1, 1, 0, 0, 0, 0, 0, 0, 2],
    //内容来自AnYun.ORG

                [1, 1, 1, 1, 1, 1, 1, 1, 2],
                [1, 1, 1, 1, 1, 1, 1, 1, 2]
            ],
          
            '3': [
                [0, 1, 1, 1, 1, 1, 0, 0, 2],
                [1, 1, 1, 1, 1, 1, 1, 1, 2],
                [1, 0, 0, 0, 0, 0, 1, 1, 2],
                [0, 0, 0, 0, 0, 0, 1, 1, 2],
                [0, 0, 0, 0, 0, 0, 1, 1, 2],
                [0, 1, 1, 1, 1, 1, 1, 0, 2],
                [0, 1, 1, 1, 1, 1, 1, 1, 2],
    //copyright AnYun.ORG

                [0, 0, 0, 0, 0, 1, 1, 1, 2],
                [0, 0, 0, 0, 0, 0, 1, 1, 2],
                [0, 0, 0, 0, 0, 0, 1, 1, 2],
                [1, 0, 0, 0, 0, 1, 1, 1, 2],
                [1, 1, 1, 1, 1, 1, 1, 0, 2],
                [0, 1, 1, 1, 1, 1, 0, 0, 2]
            ],
          
            '4': [
                [0, 0, 0, 0, 0, 1, 1, 0, 0],
                [0, 0, 0, 0, 1, 1, 1, 0, 0],
                [0, 0, 0, 0, 1, 1, 1, 0, 0], //安云网,anyun.org
                [0, 0, 0, 1, 1, 1, 1, 0, 0],
                [0, 0, 1, 1, 0, 1, 1, 0, 0],
                [0, 0, 1, 1, 0, 1, 1, 0, 0],
                [0, 1, 1, 0, 0, 1, 1, 0, 0],
                [0, 1, 1, 0, 0, 1, 1, 0, 0],
                [1, 1, 1, 1, 1, 1, 1, 1, 1],
                [1, 1, 1, 1, 1, 1, 1, 1, 1],
                [0, 0, 0, 0, 0, 1, 1, 0, 0],
                [0, 0, 0, 0, 0, 1, 1, 0, 0],
                [0, 0, 0, 0, 0, 1, 1, 0, 0]

    //copyright AnYun.ORG


            ],
          
            '5': [
                [1, 1, 1, 1, 1, 1, 1, 1, 2],
                [1, 1, 1, 1, 1, 1, 1, 1, 2],
                [1, 1, 0, 0, 0, 0, 0, 0, 2],
                [1, 1, 0, 0, 0, 0, 0, 0, 2],
                [1, 1, 0, 0, 0, 0, 0, 0, 2],
                [1, 1, 1, 1, 1, 0, 0, 0, 2],
                [1, 1, 1, 1, 1, 1, 1, 0, 2],
                [0, 0, 0, 0, 0, 1, 1, 1, 2],
                [0, 0, 0, 0, 0, 0, 1, 1, 2],

    //安云网,anyun.org


                [0, 0, 0, 0, 0, 0, 1, 1, 2],
                [1, 0, 0, 0, 0, 1, 1, 1, 2],
                [1, 1, 1, 1, 1, 1, 1, 0, 2],
                [0, 1, 1, 1, 1, 1, 0, 0, 2]
            ],
          
            '6': [
                [0, 0, 0, 1, 1, 1, 1, 0, 0],
                [0, 0, 1, 1, 1, 1, 1, 1, 0],
                [0, 1, 1, 0, 0, 0, 0, 1, 0],
                [0, 1, 1, 0, 0, 0, 0, 0, 0],
                [1, 1, 0, 0, 0, 0, 0, 0, 0], //本文来自安云网
                [1, 1, 0, 1, 1, 1, 1, 0, 0],
                [1, 1, 1, 1, 1, 1, 1, 1, 0],
                [1, 1, 1, 0, 0, 0, 1, 1, 1],
                [1, 1, 0, 0, 0, 0, 0, 1, 1],
                [1, 1, 0, 0, 0, 0, 0, 1, 1],
                [0, 1, 1, 0, 0, 0, 1, 1, 1],
                [0, 1, 1, 1, 1, 1, 1, 1, 0],
                [0, 0, 0, 1, 1, 1, 1, 0, 0]
            ],
          
            '7': [
                [1, 1, 1, 1, 1, 1, 1, 1, 2], //内容来自AnYun.ORG
                [1, 1, 1, 1, 1, 1, 1, 1, 2],
                [0, 0, 0, 0, 0, 0, 1, 1, 2],
                [0, 0, 0, 0, 0, 0, 1, 0, 2],
                [0, 0, 0, 0, 0, 1, 1, 0, 2],
                [0, 0, 0, 0, 1, 1, 0, 0, 2],
                [0, 0, 0, 0, 1, 0, 0, 0, 2],
                [0, 0, 0, 1, 1, 0, 0, 0, 2],
                [0, 0, 0, 1, 0, 0, 0, 0, 2],
                [0, 0, 1, 1, 0, 0, 0, 0, 2],
                [0, 0, 1, 1, 0, 0, 0, 0, 2],

    //内容来自AnYun.ORG


                [0, 1, 1, 0, 0, 0, 0, 0, 2],
                [0, 1, 1, 0, 0, 0, 0, 0, 2]
            ],
          
            '8': [
                [0, 0, 1, 1, 1, 1, 1, 0, 0],
                [0, 1, 1, 1, 1, 1, 1, 1, 0],
                [0, 1, 1, 0, 0, 0, 1, 1, 0],
                [0, 1, 1, 0, 0, 0, 1, 1, 0],
                [0, 1, 1, 1, 0, 0, 1, 0, 0],
                [0, 0, 1, 1, 1, 1, 1, 0, 0],
                [0, 0, 1, 1, 1, 1, 1, 0, 0], //内容来自安云网
                [0, 1, 1, 0, 0, 1, 1, 1, 0],
                [1, 1, 0, 0, 0, 0, 0, 1, 1],
                [1, 1, 0, 0, 0, 0, 0, 1, 1],
                [1, 1, 1, 0, 0, 0, 1, 1, 1],
                [0, 1, 1, 1, 1, 1, 1, 1, 0],
                [0, 0, 1, 1, 1, 1, 1, 0, 0]
            ],
          
            '9': [
                [0, 0, 1, 1, 1, 1, 0, 0, 0],
                [0, 1, 1, 1, 1, 1, 1, 1, 0],
                [1, 1, 1, 0, 0, 0, 1, 1, 0], //内容来自AnYun.ORG
                [1, 1, 0, 0, 0, 0, 0, 1, 1],
                [1, 1, 0, 0, 0, 0, 0, 1, 1],
                [1, 1, 1, 0, 0, 0, 1, 1, 1],
                [0, 1, 1, 1, 1, 1, 1, 1, 1],
                [0, 0, 1, 1, 1, 1, 0, 1, 1],
                [0, 0, 0, 0, 0, 0, 0, 1, 1],
                [0, 0, 0, 0, 0, 0, 1, 1, 0],
                [0, 1, 0, 0, 0, 0, 1, 1, 0],
                [0, 1, 1, 1, 1, 1, 1, 0, 0],
                [0, 0, 1, 1, 1, 1, 0, 0, 0] //本文来自安云网
            ]
        };

        var canvas = document.createElement("canvas").getContext('2d');
        canvas.drawImage(image, 0, 0);

        var isLetter = function(pixeldata) {
            var sum = pixeldata[0] + pixeldata[1] + pixeldata[2];
            if (sum < 150 * 3) {
                return 1;
            } else {
                return 0;
            }
        }

        var letter = [[], [], [], [], [], []];
        for(var id in letterArea) {
            var charWidth = letterArea[id].x2 - letterArea[id].x1;

    //内容来自安云网


            var charHeight = letterArea[id].y2 - letterArea[id].y1;
            var imageData = canvas.getImageData(letterArea[id].x1, letterArea[id].y1, charWidth, charHeight).data;


            for(var h = 0; h <= charHeight; h++) {
                letter[id][h] = [];
                for(var w = 0; w <= charWidth; w++) {
                    var i = 4 * (w + h * charWidth);
                    letter[id][h][w] = isLetter([].slice.call(imageData, i, i + 4));
                }
            }
        }
    //内容来自AnYun.ORG


        var result = '';
        for(var i = 0; i < letter.length; i++){
            var maxError = 1000;
            var bestResult = ' ';
            for(var id in captchaData){
                var error = 0;
                for(var y = 0; y < letter[i].length; y++){
                    for(var x = 0; x < letter[i][y].length; x++){
                        if(captchaData[id][y][x] != 2 && letter[i][y][x] != captchaData[id][y][x]){
                            error += 1;
    //安云网咨询系统

                        }
                    }
                }

                console.log("[" + i + ", " + id + "] " + error);

                if(error < maxError){
                    maxError = error;
                    bestResult = id;
                }
            }
            result += bestResult; //本文来自安云网
        }

        return result;
    }

    function main(target) {
        for(var id in target) {
            if(target[id]['img'] != undefined && target[id]['img'] != null && target[id]['input'] != undefined && target[id]['input'] != null) {
                target[id]['input'].value = decaptcha(target[id]['img']);
            }
        }
    }

    main([
        //速递查询
        {'img': document.getElementById("checkCode"), 'input':document.getElementsByName("checkCode")[0]}
    ]); //内容来自AnYun.ORG

  34. 34#
    回复此人 感谢
    铜锣湾 | 2015-01-18 19:22

    碉堡,还可以这样玩

    //内容来自AnYun.ORG

  35. 35#
    回复此人 感谢
    香草 (离骚) | 2015-01-18 20:15

    js无所不能啊

    //ANYUN.ORG

  36. 36#
    回复此人 感谢
    KamiSama | 2015-01-19 00:16

    测试一下 //copyright AnYun.ORG

  37. 37#
    回复此人 感谢
    NaiBa | 2015-01-19 11:15

    niu

    //内容来自安云网

  38. 38#
    回复此人 感谢
    Tank (梦想创造奇迹!) | 2015-01-19 11:20

    //本文来自安云网

  39. 39#
    回复此人 感谢
    Neeke | 2015-01-19 11:50

    牛逼啊 //内容来自安云网

  40. 40#
    回复此人 感谢
    风花雪月 (多喜欢我自己!) | 2015-01-19 12:33

    @cat73 敢不敢不要这么蛋疼! //copyright AnYun.ORG

  41. 41#
    回复此人 感谢
    肉肉 (我我我我我我是乌云头号美男子) | 2015-01-19 12:35

    pz姐姐好厉害

    //安云网咨询系统

  42. 42#
    回复此人 感谢
    by灰客 | 2015-01-19 12:55

    @cat73 你的验证码也能秒识别。。。 //copyright AnYun.ORG
    取出颜色大于 你验证码字的
    直接就无干扰了
    然后建字摸 //内容来自AnYun.ORG

  43. 43#
    回复此人 感谢
    金属狂人 (你狂我不狂,谁为狂人?) | 2015-01-19 13:05

    PZ无敌,混脸熟。 //ANYUN.ORG

  44. 44#
    回复此人 感谢
    Fireweed | 2015-01-19 20:22

    niubi //copyright AnYun.ORG

  45. 45#
    回复此人 感谢
    浮生若梦 | 2015-01-22 09:21

    一个验证码识别而已。。。 //内容来自AnYun.ORG

  46. 46#
    回复此人 感谢
    Ivan (Null.) | 2015-01-22 10:02

    屌炸天 //copyright AnYun.ORG

  47. 47#
    回复此人 感谢
    眼神 | 2015-01-28 01:13

    人艰不拆

    //ANYUN.ORG

  48. 48#
    回复此人 感谢
    px1624 (aaaaaaaaa) | 2015-03-16 11:26

    怎么用,来个帮助文档啊。。。

    //ANYUN.ORG

顶一下
(0)
0%
踩一下
(0)
0%
------分隔线----------------------------
发表评论
请自觉遵守互联网相关的政策法规,严禁发布色情、暴力、反动的言论。
评价:
验证码: 点击我更换图片
相关内容
推荐内容