JS破解乌云验证码
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],[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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]], '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); 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; } } } if(_error < maxError){ maxError = _error; bestResult = _letter; } } result += bestResult; } 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#
Sogili (.) 长短短 (.) | 2015-01-17 15:36
屌
2#
好基友一辈子 | 2015-01-17 15:38
屌
3#
小马达 | 2015-01-17 15:38
火钳刘明
4#
园长 (但愿你是狗,牵你一起走。@z7y @小胖子 噢,最怕你是狗喔,我最怕你不走。@saline @Anonymous 从前 @z7y 有个表弟 @VIP 后来死了。) | 2015-01-17 15:44
围观
5#
刘海哥 (www.liuhg.com) | 2015-01-17 15:47
屌个不停!
6#
泳少 (此号被射!by U神) | 2015-01-17 15:53
一直觉得乌云验证码就是个问题。
7#
whale (棱镜信息安全http://9720.org,招版主) | 2015-01-17 15:53
怎么用。。。
8#
猪猪侠 (A) | 2015-01-17 15:58
厉害
9#
July | 2015-01-17 16:03
膜拜
10#
ljhj (但愿低调,好好学习。) | 2015-01-17 16:05
已经无力吐槽了好么,大乌云的验证码居然连干扰都没有。
11#
B1uH4ck | 2015-01-17 16:32
怎么用看起来diao
12#
M4ster (knownsec & WSL) | 2015-01-17 17:01
厉害
13#
xiaoxin (己所不欲,勿施于人) | 2015-01-17 17:04
今天说吊的人,改天估计会说,我擦我的wb
14#
风情万种 (JJ好痒) | 2015-01-17 19:04
牛哇
15#
蓝哆 | 2015-01-17 20:26
厉害
16#
sky (z7y首席收银员) | 2015-01-17 21:19
。。真叼。。
17#
zeracker (他就是301,多乌云、多机会!我只关注真实!) | 2015-01-17 21:52
贱人就是矫情... 过来我保证不打死你。
18#
PING | 2015-01-17 22:14
猴犀利!
19#
动后河 (类的继承) | 2015-01-17 22:48
这是要先安装node嘛
20#
Me_Fortune | 2015-01-17 23:39
好厉害 = =
21#
0x12 (帽子掉了|多逛,少说话。|小学生) | 2015-01-18 01:49
6
22#
我了个去 (看啥,头像不是我) | 2015-01-18 01:52
点lz名字,直接把我重定向到 http://zone.wooyun.org/login ,完了,lz把我号给盗了。。。
23#
我了个去 (看啥,头像不是我) | 2015-01-18 01:55
我擦,是我网络问题
http://xxx.xxx.xxx.8:83/1Q2W3E4R5T6Y7U8I9O0P1Z2X3C4V5B/zone.wooyun.org/user/p.z
铁通的网络,代理把它当作一个文件下载了。。。
24#
我了个去 (看啥,头像不是我) | 2015-01-18 01:58
用大天朝的网络,真是一点都不省心啊。lz屌爆了,已顶。
25#
xsser (十根阳具有长短!!) | 2015-01-18 08:04
屌丝何必为难屌丝
26#
cat73 | 2015-01-18 09:03
@xsser - -要花时间改验证码了么
27#
cat73 | 2015-01-18 09:05
@xsser http://cat73.coding.io/phps/verify.html
以前写的东东- -
28#
cat73 | 2015-01-18 09:06
数学渣 实在是做不来模糊算法- -
29#
coms | 2015-01-18 09:48
@我了个去 这是我们公司的产品,您告诉我具体设备IP,我上去把乌云整站放行掉
30#
溯雪 | 2015-01-18 10:03
好屌 这个要顶
31#
RainShine (I'm your angel of music.) | 2015-01-18 10:13
叼啊!JS破解乌云验证码……火钳刘明
32#
我了个去 (看啥,头像不是我) | 2015-01-18 11:18
@coms 。。。
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} }; 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], [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], [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], [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 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], [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], [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)); } } } 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]} ]);
34#
铜锣湾 | 2015-01-18 19:22
碉堡,还可以这样玩
35#
香草 | 2015-01-18 20:15
js无所不能啊
36#
KamiSama | 2015-01-19 00:16
测试一下
37#
NaiBa | 2015-01-19 11:15
niu
38#
Tank (梦想创造奇迹!) | 2015-01-19 11:20
赞
39#
Neeke | 2015-01-19 11:50
牛逼啊
40#
风花雪月 (多喜欢我自己!) | 2015-01-19 12:33
@cat73 敢不敢不要这么蛋疼!
41#
肉肉 (我我我我我我是乌云头号美男子) | 2015-01-19 12:35
pz姐姐好厉害
42#
by灰客 (要种子先评分) | 2015-01-19 12:55
@cat73 你的验证码也能秒识别。。。
取出颜色大于 你验证码字的
直接就无干扰了
然后建字摸
43#
金属狂人 (你狂我不狂,谁为狂人?) | 2015-01-19 13:05
PZ无敌,混脸熟。
44#
Fireweed | 2015-01-19 20:22
niubi
45#
浮生若梦 | 2015-01-22 09:21
一个验证码识别而已。。。
46#
Ivan (Null.) | 2015-01-22 10:02
屌炸天