Inhaltsverzeichnis
回复讨论(解决方案)

php curl 伪造

Jun 23, 2016 pm 01:46 PM

http://www.yygh.net/index.php

直接表格提交,一直提示账号不存在。应该后台需要验证。


我想伪造Origin的来源。不知道这么设置origin的来源

$ch = curl_init(); //初始化
$this->url = "http://www.yygh.net/usercenter/userinfo_action.php";
$fields = 'actionpost=login&logintype=0&cardtype=1&userid=34262619702200379&pwd=123qwe&validate=cndm&imagesField.x=32&imageField.y=11';
curl_setopt($ch, CURLOPT_POST, 1);//设置为POST方式
curl_setopt($ch, CURLOPT_POSTFIELDS,$fields); 

curl_setopt($ch, 这里);
        
curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0); //强制协议为1.0
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Expect: ')); //头部要送出'Expect: '
curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4 ); //强制使用IPV4协议解析域名
curl_setopt($ch, CURLOPT_URL, $this->url);


curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); //返回字符串,而非直接输出

 $this->content=curl_exec($ch);
 curl_close($ch);


回复讨论(解决方案)

print_r(get_headers('http://www.yygh.net/usercenter/userinfo_action.php'));
Nach dem Login kopieren
Nach dem Login kopieren

Array
(
[0] => HTTP/1.1 200 OK
[1] => Date: Fri, 31 Oct 2014 00:41:47 GMT
[2] => Server: Apache/2.2.8 (Win32)
[3] => Set-Cookie: PHPSESSID=e5dadd27a2c2387e05c077ab1c0141e5; path=/
[4] => Expires: Thu, 19 Nov 1981 08:52:00 GMT
[5] => Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
[6] => Pragma: no-cache
[7] => Set-Cookie: JamesID=deleted; expires=Thu, 31-Oct-2013 00:41:46 GMT; path=/
[8] => Set-Cookie: JamesUserID=deleted; expires=Thu, 31-Oct-2013 00:41:46 GMT; path=/
[9] => Set-Cookie: JamesLoginTime=deleted; expires=Thu, 31-Oct-2013 00:41:46 GMT; path=/
[10] => Content-Length: 1073
[11] => Connection: close
[12] => Content-Type: text/html
)

你既不接收,也不发送他的 cookie,如何能成功?

print_r(get_headers('http://www.yygh.net/usercenter/userinfo_action.php'));
Nach dem Login kopieren
Nach dem Login kopieren

Array
(
[0] => HTTP/1.1 200 OK
[1] => Date: Fri, 31 Oct 2014 00:41:47 GMT
[2] => Server: Apache/2.2.8 (Win32)
[3] => Set-Cookie: PHPSESSID=e5dadd27a2c2387e05c077ab1c0141e5; path=/
[4] => Expires: Thu, 19 Nov 1981 08:52:00 GMT
[5] => Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
[6] => Pragma: no-cache
[7] => Set-Cookie: JamesID=deleted; expires=Thu, 31-Oct-2013 00:41:46 GMT; path=/
[8] => Set-Cookie: JamesUserID=deleted; expires=Thu, 31-Oct-2013 00:41:46 GMT; path=/
[9] => Set-Cookie: JamesLoginTime=deleted; expires=Thu, 31-Oct-2013 00:41:46 GMT; path=/
[10] => Content-Length: 1073
[11] => Connection: close
[12] => Content-Type: text/html
)

你既不接收,也不发送他的 cookie,如何能成功?




$cookie_file = dirname(__FILE__).'/cookie.txt';		//$cookie_file = tempnam("tmp","cookie");				//curl 只识别单引号字符串		$ch = curl_init(); //初始化				$this->url = "http://www.yygh.net/usercenter/userinfo_action.php";				curl_setopt($ch, CURLOPT_COOKIEJAR,  $cookie_file); //存储cookies								curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0); //强制协议为1.0		curl_setopt($ch, CURLOPT_HTTPHEADER, array('Expect: ')); //头部要送出'Expect: '		curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4 ); //强制使用IPV4协议解析域名		curl_setopt($ch, CURLOPT_URL, $this->url);						curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); //返回字符串,而非直接输出			 $this->content=curl_exec($ch);		 curl_close($ch);		 		 		 		 		 		 $cookie_file = dirname(__FILE__).'/cookie.txt';		//$cookie_file = tempnam("tmp","cookie");				//curl 只识别单引号字符串		$ch = curl_init(); //初始化				$this->url = "http://www.yygh.net/usercenter/userinfo_action.php";$fields = 'actionpost=login&logintype=0&cardtype=1&userid=330724197712316212&pwd=123qwe&validate=cndm&imagesField.x=32&imageField.y=11';		curl_setopt($ch, CURLOPT_POST, 1);//设置为POST方式		curl_setopt($ch, CURLOPT_POSTFIELDS,$fields); 				curl_setopt($ch, CURLOPT_COOKIEFILE,  $cookie_file); //使用上面获取的cookies								curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0); //强制协议为1.0		curl_setopt($ch, CURLOPT_HTTPHEADER, array('Expect: ')); //头部要送出'Expect: '		curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4 ); //强制使用IPV4协议解析域名		curl_setopt($ch, CURLOPT_URL, $this->url);						curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); //返回字符串,而非直接输出			 $this->content=curl_exec($ch);		 		 print_r(get_headers('http://www.yygh.net/usercenter/userinfo_action.php'));		 curl_close($ch);		 echo $this->content;
Nach dem Login kopieren


用了cookie也不行。版主帮我看看是哪里的问题

$cookie_file = dirname(__FILE__).'/cookie.txt';
//$cookie_file = tempnam("tmp","cookie");

//curl 只识别单引号字符串
$ch = curl_init(); //初始化
$this->url = "http://www.yygh.net/usercenter/userinfo_action.php";


curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie_file); //存储cookies



curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0); //强制协议为1.0
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Expect: ')); //头部要送出'Expect: '
curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4 ); //强制使用IPV4协议解析域名
curl_setopt($ch, CURLOPT_URL, $this->url);


curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); //返回字符串,而非直接输出

$this->content=curl_exec($ch);
curl_close($ch);





$cookie_file = dirname(__FILE__).'/cookie.txt';
//$cookie_file = tempnam("tmp","cookie");

//curl 只识别单引号字符串
$ch = curl_init(); //初始化
$this->url = "http://www.yygh.net/usercenter/userinfo_action.php";
$fields = 'actionpost=login&logintype=0&cardtype=1&userid=330724197712316212&pwd=123qwe&validate=cndm&imagesField.x=32&imageField.y=11';
curl_setopt($ch, CURLOPT_POST, 1);//设置为POST方式
curl_setopt($ch, CURLOPT_POSTFIELDS,$fields);

curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie_file); //使用上面获取的cookies



curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0); //强制协议为1.0
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Expect: ')); //头部要送出'Expect: '
curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4 ); //强制使用IPV4协议解析域名
curl_setopt($ch, CURLOPT_URL, $this->url);


curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); //返回字符串,而非直接输出

$this->content=curl_exec($ch);

print_r(get_headers('http://www.yygh.net/usercenter/userinfo_action.php'));
curl_close($ch);
echo $this->content;

他有验证码,你是如何处理的?

他有验证码,你是如何处理的?




我需要输入验证码。把它的验证码的路径改为全路径

<?php$cookie_file = dirname(__FILE__).'/cookie.txt';if(isset($_GET['verification'])) {  $url = 'http://www.yygh.net/include/validateimg.php?' . rand();  $ch = curl_init(); //初始化         curl_setopt($ch, CURLOPT_COOKIEFILE,  $cookie_file);   curl_setopt($ch, CURLOPT_URL, $url);  curl_exec($ch);  curl_close($ch);  exit;}if(! $_POST) {  $url = "http://www.yygh.net/usercenter/userinfo_action.php";  $ch = curl_init(); //初始化         curl_setopt($ch, CURLOPT_COOKIEJAR,  $cookie_file); //存储cookies  curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0); //强制协议为1.0  curl_setopt($ch, CURLOPT_HTTPHEADER, array('Expect: ')); //头部要送出'Expect: '  curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4 ); //强制使用IPV4协议解析域名  curl_setopt($ch, CURLOPT_URL, $url);  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); //返回字符串,而非直接输出  $content = curl_exec($ch);  curl_close($ch);echo <<< HTML<form method=post><img  src='?verification=1' alt="php curl 伪造" ><input type=text name=code><input type=submit value=ok></form>HTML;  exit;}else {  $ch = curl_init(); //初始化         $url = "http://www.yygh.net/usercenter/userinfo_action.php";  $fields = array(    'actionpost' => 'login',    'logintype' => 0,    'cardtype' => 1,    'userid' => '330724197712316212',    'pwd' => '123qwe',    'validate' => $_POST['code'],    //cndm&imagesField.x=32&imageField.y=11';  );  curl_setopt($ch, CURLOPT_POST, 1);//设置为POST方式  curl_setopt($ch, CURLOPT_POSTFIELDS, $fields);   curl_setopt($ch, CURLOPT_COOKIEFILE,  $cookie_file); //使用上面获取的cookies  curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0); //强制协议为1.0  curl_setopt($ch, CURLOPT_HTTPHEADER, array('Expect: ')); //头部要送出'Expect: '  curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4 ); //强制使用IPV4协议解析域名  curl_setopt($ch, CURLOPT_URL, $url);  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); //返回字符串,而非直接输出  $content = curl_exec($ch);  curl_close($ch);  echo $content;  }
Nach dem Login kopieren
Nach dem Login kopieren

请核实用户信息的正确性

<?php$cookie_file = dirname(__FILE__).'/cookie.txt';if(isset($_GET['verification'])) {  $url = 'http://www.yygh.net/include/validateimg.php?' . rand();  $ch = curl_init(); //初始化         curl_setopt($ch, CURLOPT_COOKIEFILE,  $cookie_file);   curl_setopt($ch, CURLOPT_URL, $url);  curl_exec($ch);  curl_close($ch);  exit;}if(! $_POST) {  $url = "http://www.yygh.net/usercenter/userinfo_action.php";  $ch = curl_init(); //初始化         curl_setopt($ch, CURLOPT_COOKIEJAR,  $cookie_file); //存储cookies  curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0); //强制协议为1.0  curl_setopt($ch, CURLOPT_HTTPHEADER, array('Expect: ')); //头部要送出'Expect: '  curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4 ); //强制使用IPV4协议解析域名  curl_setopt($ch, CURLOPT_URL, $url);  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); //返回字符串,而非直接输出  $content = curl_exec($ch);  curl_close($ch);echo <<< HTML<form method=post><img  src='?verification=1' alt="php curl 伪造" ><input type=text name=code><input type=submit value=ok></form>HTML;  exit;}else {  $ch = curl_init(); //初始化         $url = "http://www.yygh.net/usercenter/userinfo_action.php";  $fields = array(    'actionpost' => 'login',    'logintype' => 0,    'cardtype' => 1,    'userid' => '330724197712316212',    'pwd' => '123qwe',    'validate' => $_POST['code'],    //cndm&imagesField.x=32&imageField.y=11';  );  curl_setopt($ch, CURLOPT_POST, 1);//设置为POST方式  curl_setopt($ch, CURLOPT_POSTFIELDS, $fields);   curl_setopt($ch, CURLOPT_COOKIEFILE,  $cookie_file); //使用上面获取的cookies  curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0); //强制协议为1.0  curl_setopt($ch, CURLOPT_HTTPHEADER, array('Expect: ')); //头部要送出'Expect: '  curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4 ); //强制使用IPV4协议解析域名  curl_setopt($ch, CURLOPT_URL, $url);  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); //返回字符串,而非直接输出  $content = curl_exec($ch);  curl_close($ch);  echo $content;  }
Nach dem Login kopieren
Nach dem Login kopieren

请核实用户信息的正确性




最后一句话提醒我了原来是cardtype 写错了 card_type..
这什么嘛、搞了一天。。。
最后谢谢版主
Erklärung dieser Website
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn

Heiße KI -Werkzeuge

Undresser.AI Undress

Undresser.AI Undress

KI-gestützte App zum Erstellen realistischer Aktfotos

AI Clothes Remover

AI Clothes Remover

Online-KI-Tool zum Entfernen von Kleidung aus Fotos.

Undress AI Tool

Undress AI Tool

Ausziehbilder kostenlos

Clothoff.io

Clothoff.io

KI-Kleiderentferner

AI Hentai Generator

AI Hentai Generator

Erstellen Sie kostenlos Ai Hentai.

Heißer Artikel

R.E.P.O. Energiekristalle erklärten und was sie tun (gelber Kristall)
1 Monate vor By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Beste grafische Einstellungen
1 Monate vor By 尊渡假赌尊渡假赌尊渡假赌
Will R.E.P.O. Crossplay haben?
1 Monate vor By 尊渡假赌尊渡假赌尊渡假赌

Heiße Werkzeuge

Notepad++7.3.1

Notepad++7.3.1

Einfach zu bedienender und kostenloser Code-Editor

SublimeText3 chinesische Version

SublimeText3 chinesische Version

Chinesische Version, sehr einfach zu bedienen

Senden Sie Studio 13.0.1

Senden Sie Studio 13.0.1

Leistungsstarke integrierte PHP-Entwicklungsumgebung

Dreamweaver CS6

Dreamweaver CS6

Visuelle Webentwicklungstools

SublimeText3 Mac-Version

SublimeText3 Mac-Version

Codebearbeitungssoftware auf Gottesniveau (SublimeText3)

Erklären Sie JSON Web Tokens (JWT) und ihren Anwendungsfall in PHP -APIs. Erklären Sie JSON Web Tokens (JWT) und ihren Anwendungsfall in PHP -APIs. Apr 05, 2025 am 12:04 AM

JWT ist ein offener Standard, der auf JSON basiert und zur sicheren Übertragung von Informationen zwischen Parteien verwendet wird, hauptsächlich für die Identitätsauthentifizierung und den Informationsaustausch. 1. JWT besteht aus drei Teilen: Header, Nutzlast und Signatur. 2. Das Arbeitsprinzip von JWT enthält drei Schritte: Generierung von JWT, Überprüfung von JWT und Parsingnayload. 3. Bei Verwendung von JWT zur Authentifizierung in PHP kann JWT generiert und überprüft werden, und die Funktionen und Berechtigungsinformationen der Benutzer können in die erweiterte Verwendung aufgenommen werden. 4. Häufige Fehler sind Signaturüberprüfungsfehler, Token -Ablauf und übergroße Nutzlast. Zu Debugging -Fähigkeiten gehört die Verwendung von Debugging -Tools und Protokollierung. 5. Leistungsoptimierung und Best Practices umfassen die Verwendung geeigneter Signaturalgorithmen, das Einstellen von Gültigkeitsperioden angemessen.

Beschreiben Sie die soliden Prinzipien und wie sie sich für die PHP -Entwicklung anwenden. Beschreiben Sie die soliden Prinzipien und wie sie sich für die PHP -Entwicklung anwenden. Apr 03, 2025 am 12:04 AM

Die Anwendung des soliden Prinzips in der PHP -Entwicklung umfasst: 1. Prinzip der Einzelverantwortung (SRP): Jede Klasse ist nur für eine Funktion verantwortlich. 2. Open and Close Principle (OCP): Änderungen werden eher durch Erweiterung als durch Modifikation erreicht. 3.. Lischs Substitutionsprinzip (LSP): Unterklassen können Basisklassen ersetzen, ohne die Programmgenauigkeit zu beeinträchtigen. 4. Schnittstellen-Isolationsprinzip (ISP): Verwenden Sie feinkörnige Schnittstellen, um Abhängigkeiten und nicht verwendete Methoden zu vermeiden. 5. Abhängigkeitsinversionsprinzip (DIP): Hoch- und niedrige Module beruhen auf der Abstraktion und werden durch Abhängigkeitsinjektion implementiert.

Erklären Sie das Konzept der späten statischen Bindung in PHP. Erklären Sie das Konzept der späten statischen Bindung in PHP. Mar 21, 2025 pm 01:33 PM

In Artikel wird die in PHP 5.3 eingeführte LSB -Bindung (LSB) erörtert, die die Laufzeitauflösung der statischen Methode ermöglicht, um eine flexiblere Vererbung zu erfordern. Die praktischen Anwendungen und potenziellen Perfo von LSB

Wie setze ich nach dem Neustart des Systems automatisch Berechtigungen von Unixsocket fest? Wie setze ich nach dem Neustart des Systems automatisch Berechtigungen von Unixsocket fest? Mar 31, 2025 pm 11:54 PM

So setzen Sie die Berechtigungen von Unixsocket automatisch nach dem Neustart des Systems. Jedes Mal, wenn das System neu startet, müssen wir den folgenden Befehl ausführen, um die Berechtigungen von Unixsocket: sudo ...

Wie sende ich eine Postanforderung mit JSON -Daten mithilfe der Curl -Bibliothek von PHP? Wie sende ich eine Postanforderung mit JSON -Daten mithilfe der Curl -Bibliothek von PHP? Apr 01, 2025 pm 03:12 PM

Senden von JSON -Daten mithilfe der Curl -Bibliothek von PHP in der PHP -Entwicklung müssen häufig mit externen APIs interagieren. Eine der gängigen Möglichkeiten besteht darin, die Curl Library zu verwenden, um Post � ...

Rahmensicherheitsmerkmale: Schutz vor Schwachstellen. Rahmensicherheitsmerkmale: Schutz vor Schwachstellen. Mar 28, 2025 pm 05:11 PM

In Artikel werden wichtige Sicherheitsfunktionen in Frameworks erörtert, um vor Schwachstellen zu schützen, einschließlich Eingabevalidierung, Authentifizierung und regelmäßigen Aktualisierungen.

Anpassung/Erweiterung von Frameworks: So fügen Sie benutzerdefinierte Funktionen hinzu. Anpassung/Erweiterung von Frameworks: So fügen Sie benutzerdefinierte Funktionen hinzu. Mar 28, 2025 pm 05:12 PM

In dem Artikel werden Frameworks hinzugefügt, das sich auf das Verständnis der Architektur, das Identifizieren von Erweiterungspunkten und Best Practices für die Integration und Debuggierung hinzufügen.

See all articles