验证码本来就反正远程暴力提交数据的,但我就要远程提交数据。远程获取目标网站的验证码
再人工填写验证码提交数据。
这样用到PHP的GD扩展库来实现这个问题,实现原理并你想的还简单
set_time_limit(0);//设置PHP超时时间
$url = "http://218.75.208.58:83/CheckCode.aspx";
if(empty($url)){
echo "没有图片";
exit;
}
$imginfo = getimagesize ( $url );
$type = $imginfo["mime"];
$imgw = $imginfo [0];
$imgh = $imginfo [1];
$bg = imagecreatetruecolor($imgw,$imgh);
$image = imagecreatefromgif($url);
imagecolorallocate($image,255,255,255);
imagecopy($bg,$image,0,0, 0,0,$imgw,$imgh);
imagedestroy($image);
header("Content-type:".$type);
imagegif($bg);
这样就可以远程获取都这台服务器的验证码了?
我现在考虑的不是这个问题。我一直在想,我这样获取到了验证码,我下次用curl提交的时候,是不是还是这个验证码呢?
所以我现在也很期待我的第二个实验。
远程提交验证加数据。