某次测验中遇到了汉字点选的验证码,看着很简略,尝试了一下发现有两种简略的识别 *** ,总算有空给重新整理一下,共享出来。
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] 黑客接单网
D.其他任何感兴趣的网卡数据包,如POP,SMTP等 2. 修正WAN口的DNS,参数dnsserver和dnsserver2: -lWhenyouusethe-toptiont...
大家好,本文我要共享的是我参加Hackerone某约请项目,经过方针测验网站的高档功能模块(PRO features)完成了更多攻击面测验,并发现了两个严峻缝隙,获得了$7000美金的不菲奖赏。 第...
成功利用此漏洞的攻击者可以在目标系统上执行任意代码。 然后攻击者可以安装程序; 查看,更改或删除数据; 或创建具有完全用户权限的新帐户。 安装配置Exchange Server,参考· https:/...
8、/Database/#newasp.mdb第一次在WooYun发文章,不知道是否契合众客官口味,望轻拍。 public class BurpExtender implements IBurpExt...
360移动安全团队剖析发现,道有道广告SDK使用静态和动态相结合的手法,与杀软特征进行持续性的对立,然后逃避杀软的查杀。 public class CallService {参数3:前文本地址...
$("#submit_btn").attr('disabled', false).click(function() {咱们从2011年开端发现Hook007宗族恶意代码,经过咱们的继续监控和剖析,暗地...