>  기사  >  php教程  >  php 模仿用户登陆读取DZ 论坛验码程序

php 模仿用户登陆读取DZ 论坛验码程序

WBOY
WBOY원래의
2016-06-13 11:23:111195검색

error_reporting(0);
session_start();
require("config.php");
if(!is_dir("temp"))
{
 mkdir("temp",0777);
}
$c=tempnam("temp","c");
$url=DZ."logging.php?action=login";
 $ch=curl_init();
 curl_setopt($ch,CURLOPT_URL,$url);
 curl_setopt($ch,CURLOPT_USERAGENT,$_SERVER["HTTP_USER_AGENT"]);
 curl_setopt($ch,CURLOPT_COOKIEJAR,$c);
 curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
 $html=curl_exec($ch);
 preg_match("/(? if($charset[0]!=="utf-8")
 {
  $html=iconv($charset[0],"utf-8",$html);
 }
 curl_close($ch);
 preg_match("/(? $_SESSION["hash"]=$outs[0];
 

$c1=tempnam("temp","c1");
$re_url=DZ."ajax.php?action=updateseccode&secchecktype=&inajax=1&ajaxtarget=seccodeverify_menu";
$ch=curl_init();
curl_setopt($ch,CURLOPT_URL,$re_url);
curl_setopt($ch,CURLOPT_USERAGENT,$_SERVER["HTTP_USER_AGENT"]);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch,CURLOPT_COOKIEFILE,$c);
curl_setopt($ch,CURLOPT_COOKIEJAR,$c1);
$html=curl_exec($ch);
curl_close($ch);
preg_match("/(?

$_SESSION["cookie_jar"]=tempnam("temp","C1_");
$url=DZ.$outs[0];
$ch=curl_init();
curl_setopt($ch,CURLOPT_REFERER,$re_url);
curl_setopt($ch,CURLOPT_URL,$url);
curl_setopt($ch,CURLOPT_USERAGENT,$_SERVER["HTTP_USER_AGENT"]);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch,CURLOPT_COOKIEFILE,$c1);
curl_setopt($ch,CURLOPT_COOKIEJAR,$_SESSION["cookie_jar"]);
$html=curl_exec($ch);
curl_close($ch);
echo $html;


성명:
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.