某次测验中遇到了汉字点选的验证码,看着很简略,尝试了一下发现有两种简略的识别 *** ,总算有空给重新整理一下,共享出来。
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] 黑客接单网
public void ShowWebConfig(HttpContext context) { context.Response.Write(System.I...
「免费监控微信聊天记录_黑客大神联系-网上的黑客找车怎么样」别的,如果把UNION SELECT FROM 三个关键字别离放在GET/POST/COOKIE的方位,经过ASPX的特性连起来,我信任这是...
2019年,咱们猜测网络违法分子针对内容管理体系注入歹意挖矿代码的活动会削减,而其他Web要挟会变得愈加遍及与常见,比如说Web skimmer。 它根本上就像运用任何其他JavaScript数组相同...
这儿有两个上传点,一个是ewebeditor的,别的一个是网站自带的,这儿咱们先测验一下打破网站自带的编辑器。 # cp CVE-2019-0199_POC.rtf /var/www/html/wor...
— FireEye (@FireEye) December 15, 2018有 GetStatus(int32 host_id) => (AppCacheStatus status);不收定金...
struct chunk {与前面将测验动作编码为字节序列的办法比较,运用protos对有状况API进行含糊测验时,不只速度要慢一些,并且,测验进程也更杂乱一些。 不过,这种办法也有其长处:这种办法愈...