TaoGOGO的技术博客,关注LAMP,Web编程,前端开发和网络赚钱。

php版字体扭曲的验证码及web验证码破解

十二月 7th, 2009 | 评论:(11)

最近对验证码破解比较感兴趣,找到这个比较好的文章,不敢独享,给大家看看:

1.比较难破解的验证码网站
最近在看一些验证码的知识,看起来很不起眼的东西,想要做的美观,不被人破解,还是有一定难度的
比如yahoo,微软和gmail等,他们验证码都有一些相视的地方如字体紧凑,扭曲,简介明了等以下为注册链接地址

google注册地址:https://www.google.com/accounts/NewAccount?service=mail
微软msn注册地址:https://accountservices.passport.net/reg.srf?roid=2&sl=1&vv=700&lc=2052
yahoo注册地址:https://member.cn.yahoo.com/cnreg/reginfo.html?id=20001&prop=&done=

每一个环节多破解它都有一定的难度,我也在网上找了一写比较好的破解文章在这与大家分享。

2.如何破解验证码
比较不错的文章链接,他们做的很好,尤其是geekso

http://www.geekso.com/Valite/
http://www.geekso.com/post/393/
http://huaidan.org/archives/2085.html

3.如何制作字体扭曲的验证码

<?php
$string="welcome to my webside";
getAuthImage($string);
function getAuthImage( $string , $im_x = 120 , $im_y = 60) {
ob_start();
$im_x = 120;
$im_y = 60;

$im = imagecreatetruecolor ($im_x, $im_y);
imagefill($im, 0, 0, imagecolorallocate($im,255,255,255) );

//注意以下字体文件需要有
$stringColor = imagecolorallocate($im, 17, 158, 20);
imagettftext ($im, 24, rand(-6 , 6), $im_x*0.1, $im_y*0.7, $stringColor, '/usr/local/share/fonts/georgia.ttf', $string);

//扭曲,变形

$distortion_im = imagecreatetruecolor ($im_x*1.5 , $im_y);
imagefill($distortion_im, 0, 0, imagecolorallocate($distortion_im,255,255,255) );
for ( $i=0; $i<$im_x; $i++) {
for ( $j=0; $j<$im_y; $j++) {
$rgb = imagecolorat($im, $i , $j);
if( (int)($i+20+sin($j/$im_y*2*M_PI)*10) <= imagesx($distortion_im) && (int)($i+20+sin($j/$im_y*2*M_PI)*10) >=0 ) {
imagesetpixel ($distortion_im, (int)($i+20+sin($j/$im_y*2*M_PI-M_PI*0.4)*8) , $j , $rgb);
}
}
}

//pixel

for($i=0; $i <= 64; $i++) {
$pointcolor = imagecolorallocate($distortion_im, 17, 158, 20);
imagesetpixel($distortion_im, rand(0, imagesx($distortion_im)), rand(0, imagesy($distortion_im)), $pointcolor);
}


ob_clean();
header('Content-type: image/jpeg');
imagejpeg ($distortion_im);
imagedestroy($im);
imagedestroy($distortion_im);
}

?>

类别: web编程 | 关键字: php 验证码 验证码破解 | 阅读:(1340)

想收藏或者和大家分享这篇好文章→

“php版字体扭曲的验证码及web验证码破解”共有11条留言

  1. lostab 2009-12-22 at 22:35回复

    @TaoGOGO
    英语...四级勉强才过.
    学日语的.

  2. TaoGOGO 2009-12-21 at 12:21回复

    @lostab 哈哈,英语不错

  3. lostab 2009-12-19 at 16:15回复

    @TaoGOGO
    Me too.

  4. TaoGOGO 2009-12-15 at 16:29回复

    @ngshaozhu 一直想学Python,可惜也是坚持不了多久……╮(╯▽╰)╭一起努力啊

  5. ngshaozhu 2009-12-13 at 21:42回复

    去年还买过几本PHP的书来看,但今年来很少在碰了,现在很多都忘记了。还有Python也扔了好多
    坚持不下去,老是给自己找借口

  6. TaoGOGO 2009-12-07 at 18:04回复

    @houkai 我对php研究的多……python还远征呢……

  7. TaoGOGO 2009-12-07 at 18:04回复

    @kangzj 他们那些人的脑筋不是一般的XX……

  8. TaoGOGO 2009-12-07 at 18:03回复

    @WooGooo 最近做了个刷票的小软件 ,无奈那个汉字验证码只能靠人来输入~准备学习一下这个方面的东西

  9. houkai 2009-12-07 at 17:14回复

    怎么玩起php了 用python弄个呀!

  10. kangzj 2009-12-07 at 13:08回复

    备案那个网站的验证码最变态,人都不认识。。。

  11. WooGooo 2009-12-07 at 12:57回复

    字体扭了是不好破解,因为人都认不出来!
    就像Google,yahoo的验证,有时候我要刷新好几次!
    呵呵,我还是喜欢做算术

发表评论

姓名:

邮箱:

网址:

请输入计算结果:7+1

Tao公告

好消息!co.cc免费域名国内可以注册使用啦@2010.05.10
推荐免费英语学习+聊天室软件@2010.07.21

搜索

加工中~马上就好 加载中…