ホームページ  >  記事  >  バックエンド開発  >  PHP はユーザーのログインを模倣し、DZ フォーラムのコード検証プログラムを読み取ります_PHP チュートリアル

PHP はユーザーのログインを模倣し、DZ フォーラムのコード検証プログラムを読み取ります_PHP チュートリアル

WBOY
WBOYオリジナル
2016-07-20 11:07:091106ブラウズ

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( "/(?<=charset=).*?(?=")/",$html,$charset);
if($charset[0]!=="utf-8")
{
$html =iconv($charset[0],"utf-8",$html);
}
curl_close($ch);
preg_match("/(?<=formhash" value=").*?(?= ")/",$html,$outs);
$_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,CURLOP) T_COOKIEJAR、 $_SESSION["cookie_jar"]);
$html=curl_exec($ch);
curl_close($ch);
echo $html;


www.bkjia.comtru​​ehttp://www.bkjia.com/PHPjc/444997.html技術記事エラー報告(0);セッション開始(); require(config.php); if(!is_dir(temp)) { mkdir(temp,0777); $c=tempnam(temp,c); $url=DZ.logging.php?action=ログイン; $ch=curl_init(); curl_setopt...
声明:
この記事の内容はネチズンが自主的に寄稿したものであり、著作権は原著者に帰属します。このサイトは、それに相当する法的責任を負いません。盗作または侵害の疑いのあるコンテンツを見つけた場合は、admin@php.cn までご連絡ください。