PHP Curl Forgery

Source: Internet
Author: User
http://www.yygh.net/index.php

Direct form submission, always indicates that the account does not exist. Validation should be required in the background.


I want to forge the origin of origin. I don't know how to set the origin of Origin

$ch = Curl_init (); Initialization
$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);//set to POST mode
curl_setopt ($ch, Curlopt_postfields, $fields);

curl_setopt ($ch, here);

curl_setopt ($ch, curlopt_http_version, CURL_HTTP_VERSION_1_0); Mandatory Agreement is 1.0
curl_setopt ($ch, Curlopt_httpheader, Array (' Expect: ')); Head to send out ' Expect: '
curl_setopt ($ch, Curlopt_ipresolve, CURL_IPRESOLVE_V4); Forcing a domain name to be resolved using the IPV4 protocol
curl_setopt ($ch, Curlopt_url, $this->url);


curl_setopt ($ch, Curlopt_returntransfer, true); Returns a string rather than a direct output

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


Reply to discussion (solution)

Print_r (get_headers (' http://www.yygh.net/usercenter/userinfo_action.php '));

Array
(
[0] = = http/1.1-OK
[1] = Date:fri, Oct 00:41:47 GMT
[2] = server:apache/2.2.8 (WIN32)
[3] = = SET-COOKIE:PHPSESSID=E5DADD27A2C2387E05C077AB1C0141E5; path=/
[4] = Expires:thu, 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=/
[Ten] = content-length:1073
[One] = Connection:close
[[] = content-type:text/html
)

How can you succeed if you neither receive nor send his cookie?

Print_r (get_headers (' http://www.yygh.net/usercenter/userinfo_action.php '));

Array
(
[0] = = http/1.1-OK
[1] = Date:fri, Oct 00:41:47 GMT
[2] = server:apache/2.2.8 (WIN32)
[3] = = SET-COOKIE:PHPSESSID=E5DADD27A2C2387E05C077AB1C0141E5; path=/
[4] = Expires:thu, 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=/
[Ten] = content-length:1073
[One] = Connection:close
[[] = content-type:text/html
)

How can you succeed if you neither receive nor send his cookie?




$cookie _file = dirname (__file__). ' /cookie.txt ';//$cookie _file = Tempnam ("tmp", "Cookie");//curl only recognizes single quote string $ch = Curl_init (); Initialize $this->url = "http://www.yygh.net/usercenter/userinfo_action.php"; curl_setopt ($ch, Curlopt_cookiejar, $ Cookie_file); Storage cookiescurl_setopt ($ch, curlopt_http_version, CURL_HTTP_VERSION_1_0); The mandatory protocol is 1.0curl_setopt ($ch, Curlopt_httpheader, Array (' Expect: ')); Head to send out ' Expect: ' curl_setopt ($ch, Curlopt_ipresolve, CURL_IPRESOLVE_V4); Enforces the use of the IPV4 protocol to resolve domain name curl_setopt ($ch, Curlopt_url, $this->url); curl_setopt ($ch, Curlopt_returntransfer, true); Returns a string rather than a direct output $this->content=curl_exec ($ch);      Curl_close ($ch); $cookie _file = dirname (__file__). ' /cookie.txt ';//$cookie _file = Tempnam ("tmp", "Cookie");//curl only recognizes single quote string $ch = Curl_init (); Initialize $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);//set to POST mode curl_setopt ($ch, Curlopt_postfields, $fields); curl_setopt ($ch, Curlopt_cookiefile, $cookie _file); Using the cookiescurl_setopt obtained above ($ch, curlopt_http_version, CURL_HTTP_VERSION_1_0); The mandatory protocol is 1.0curl_setopt ($ch, Curlopt_httpheader, Array (' Expect: ')); Head to send out ' Expect: ' curl_setopt ($ch, Curlopt_ipresolve, CURL_IPRESOLVE_V4); Enforces the use of the IPV4 protocol to resolve domain name curl_setopt ($ch, Curlopt_url, $this->url); curl_setopt ($ch, Curlopt_returntransfer, true);  Returns a string rather than a direct output $this->content=curl_exec ($ch); Print_r (get_headers (' http://www.yygh.net/usercenter/userinfo_action.php ')); Curl_close ($ch); Echo $this->content;


It's not a good use of cookies. Moderators help me see where the problem is

$cookie _file = dirname (__file__). ' /cookie.txt ';
$cookie _file = Tempnam ("tmp", "Cookie");

Curl only recognizes single-quote strings
$ch = Curl_init (); Initialization
$this->url = "http://www.yygh.net/usercenter/userinfo_action.php";


curl_setopt ($ch, Curlopt_cookiejar, $cookie _file); Storing cookies



curl_setopt ($ch, curlopt_http_version, CURL_HTTP_VERSION_1_0); Mandatory Agreement is 1.0
curl_setopt ($ch, Curlopt_httpheader, Array (' Expect: ')); Head to send out ' Expect: '
curl_setopt ($ch, Curlopt_ipresolve, CURL_IPRESOLVE_V4); Forcing a domain name to be resolved using the IPV4 protocol
curl_setopt ($ch, Curlopt_url, $this->url);


curl_setopt ($ch, Curlopt_returntransfer, true); Returns a string rather than a direct output

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





$cookie _file = dirname (__file__). ' /cookie.txt ';
$cookie _file = Tempnam ("tmp", "Cookie");

Curl only recognizes single-quote strings
$ch = Curl_init (); Initialization
$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);//set to POST mode
curl_setopt ($ch, Curlopt_postfields, $fields);

curl_setopt ($ch, Curlopt_cookiefile, $cookie _file); Use the cookies obtained above



curl_setopt ($ch, curlopt_http_version, CURL_HTTP_VERSION_1_0); Mandatory Agreement is 1.0
curl_setopt ($ch, Curlopt_httpheader, Array (' Expect: ')); Head to send out ' Expect: '
curl_setopt ($ch, Curlopt_ipresolve, CURL_IPRESOLVE_V4); Forcing a domain name to be resolved using the IPV4 protocol
curl_setopt ($ch, Curlopt_url, $this->url);


curl_setopt ($ch, Curlopt_returntransfer, true); Returns a string rather than a direct output

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

Print_r (get_headers (' http://www.yygh.net/usercenter/userinfo_action.php '));
Curl_close ($ch);
Echo $this->content;

He has a verification code, how do you deal with it?

He has a verification code, how do you deal with it?




I need to enter a verification code. Change the path of its verification code to full path

 ' Login ', ' Logintype ' + 0, ' cardtype ' and ' 1 ', ' userid ' = ' 330724197712316212 ', ' pwd ' = ' 123qwe ',  ' Validate ' = $_post[' code ',//cndm&imagesfield.x=32&imagefield.y=11 ';  );   curl_setopt ($ch, Curlopt_post, 1);//set to POST mode curl_setopt ($ch, Curlopt_postfields, $fields); curl_setopt ($ch, Curlopt_cookiefile, $cookie _file); Using the cookies obtained above curl_setopt ($ch, curlopt_http_version, CURL_HTTP_VERSION_1_0); The mandatory Protocol is 1.0 curl_setopt ($ch, Curlopt_httpheader, Array (' Expect: ')); Head to send out ' Expect: ' curl_setopt ($ch, Curlopt_ipresolve, CURL_IPRESOLVE_V4);  Force the use of IPV4 protocol to resolve domain name curl_setopt ($ch, Curlopt_url, $url); curl_setopt ($ch, Curlopt_returntransfer, true);  Returns a string rather than a direct output $content = curl_exec ($ch);  Curl_close ($ch);  Echo $content; }

Please verify the correctness of user information

 ' Login ', ' Logintype ' + 0, ' cardtype ' and ' 1 ', ' userid ' = ' 330724197712316212 ', ' pwd ' = ' 123qwe ',  ' Validate ' = $_post[' code ',//cndm&imagesfield.x=32&imagefield.y=11 ';  );   curl_setopt ($ch, Curlopt_post, 1);//set to POST mode curl_setopt ($ch, Curlopt_postfields, $fields); curl_setopt ($ch, Curlopt_cookiefile, $cookie _file); Using the cookies obtained above curl_setopt ($ch, curlopt_http_version, CURL_HTTP_VERSION_1_0); The mandatory Protocol is 1.0 curl_setopt ($ch, Curlopt_httpheader, Array (' Expect: ')); Head to send out ' Expect: ' curl_setopt ($ch, Curlopt_ipresolve, CURL_IPRESOLVE_V4);  Force the use of IPV4 protocol to resolve domain name curl_setopt ($ch, Curlopt_url, $url); curl_setopt ($ch, Curlopt_returntransfer, true);  Returns a string rather than a direct output $content = curl_exec ($ch);  Curl_close ($ch);  Echo $content; }

Please verify the correctness of user information




The last word reminds me that the original is Cardtype wrote the wrong card_type.
What is this, a day of doing ...
Last Thank you Moderator
  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.