某次测验中遇到了汉字点选的验证码,看着很简略,尝试了一下发现有两种简略的识别 *** ,总算有空给重新整理一下,共享出来。
0×01 验证码的获取
首要获取验证码。因为网站比较特别,就不以他们的为例,自己生成验证码吧。这个不是要点,这儿直接贴代码了。
function createImage($word ,$imagePath,$type , $imageName){
$fontPath = 'msyh.ttc' ;//字体
$fontSize = 20 * 0.75;
foreach ($word as $v ) {
$fontarea = imagettfbbox($fontSize, 0 , $fontPath, $v );
$textWidth = $fontarea[2] - $fontarea [0];
$textHeight = $fontarea[1] - $fontarea [7];
$tmp[ 'text'] = $v;
$tmp[ 'size'] = $fontSize;
$tmp[ 'width'] = $textWidth;
$tmp[ 'height'] = $textHeight;
$textArr[] = $tmp;
}
list( $imageWidth , $imageHeight, $imageType) = getimagesize( $imagePath);
for( $i =0;$i list( $x, $y) = randPosition ($textArr, $imageWidth, $imageHeight, $textArr[$i ][ 'width'], $textArr[ $i]['height'], $i,$type);
$textArr[ $i]['x'] = $x;
$textArr[ $i]['y'] = $y;
}
unset( $v );
//创立图片的实例
$image = imagecreatefromstring (file_get_contents( $imagePath));
//字体色彩
$color = imagecolorallocate ($image, 0, 0, 0);
//绘画文字
foreach( $textArr as $v){
imagefttext ( $image, $v ['size' ], 0 , $v[ 'x' ], $v['y' ], $color, $fontPath ,$v ['text']);
}
if (imagepng ( $image,$imageName )){
echo $imageName ." n";
}
}
functionrandPosition ($textArr , $imgW, $imgH , $fontW, $fontH,$i ,$type){
switch ($type ) {
case 0 :// 生成mp
$x = rand ($i* 60 , ($i +1)* 60-$fontW - 3);
$y = rand (40, 80 );
break;
case1 : //生成ap
$x = ( $i )*25+ 5 ;
$y = 25;
[1] [2] [3] [4] 黑客接单网
.text:0000000000466B19 mov , esi本月Apache被公布了一个提权的漏洞,并且前天在GitHub上公布出了利用脚本,这几天我负责漏洞应急这个漏洞。 Spring官方最新版...
前语 靶机主题来自美剧《黑客军团》,这是一部传达极客精力和黑客文明的上佳著作,不同于《硅谷》的搞笑风格,这部剧的主角Eliot患有精力分裂,整部剧的情节都较为压抑,有点类似于电影《搏击沙龙》中双重人格...
首先,通过遍历验证中继帐户所在用户组及权限,发现当前账户可以创建用户、可以修改test.local域的ACL,因为域中的Exchange Windows Permissions用户组被允许修改ACL,...
USB/CD AutoPlay生成运用主动播放运转的木马文件;第1步:依据主机A上的路由表内容,IP确认用于拜访主机B的转发IP地址是192.168.1.2。 然后A主机在自己的本地ARP缓存中检查主...
关于成功率的说法 Windows Server 2008 for Itanium-Based Systems Service Pack 2影响产品:我的钱被亲戚借去赌博一下输了几十万,输的钱怎么, 攻...
微软再次发布对于CVE-2019-0708漏洞做修补的提醒,基于漏洞的严重性强烈建议用户尽快升级修复首先根据cve的信息,确定漏洞1.7.6和1.8.0-rc3上修复结合着反汇编代码看,效果可能更好影...