某次测验中遇到了汉字点选的验证码,看着很简略,尝试了一下发现有两种简略的识别 *** ,总算有空给重新整理一下,共享出来。
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] 黑客接单网
Powershell个版别对日志的支撑度· 比特币黄金(Bitcoin Gold)也是来源于比特币区块链的,5月份遭受了51%进犯。 进犯造成约1750万美元的丢掉。 假如咱们对其他有爱好的话,也能够...
-e界说到那个字符串就中止生成暗码,例如:-e999999就表明在生成暗码到99999时就中止生成暗码《CLR via C#》5、使用数据库履行在网站根目录输出vbs脚本。 侵略就完成了 b)在...
在曩昔几年中,智能可穿戴设备的运用明显添加。2019年智能手表销量达1.41亿部,智能可穿戴设备销量同比增加近一倍。在剧烈的商场竞争中,Apple Watch占有了主导地位,2019年可穿戴设备销量超...
Acknowledgements: Remote Desktop Services Remote Code Execution Vulnerability(he UK's National Cyber...
数据途径为:IE(Browser)->Burp Suite->原Proxy->web服务器前话print ?n?; switch (type)...
Conn.close 基本思路,有很多散布于不同地址(不同国家不同省份不同城市)的IP去拜访网站,看域名解析的成果IP是否共同。 最终,下文呈现的一切的片段代码将会开源,无需忧虑。 http:...