Telnet Impersonation HTTP Request:
CMD enter after entering: Telnet 127.0.0.1 80 back to the car (if the program does not use, then go to the Control Panel, programs and functions, turn on or off the Windows feature, check the Telnet client can), and then press CTRL +], enter the
-------------------------
GET Request:
GET http://localhost/test.php http/1.1
Host:localhost
Note to have more than one line of space
------------------------
Next is the POST request:
POST http://localhost/test.php http/1.1
Host:localhost
content-type:application/x-www-form-urlencoded
Act=query&name=zzz
--------------------------
File_get_contents Demo Form submission (here is post submission)
<?PHP$postData=Array( ' Title ' = ' I'm file_get_contents's structure data ', ' content ' = ' I'm file_get_contents's structured data content ', ' publish ' and ' release ', ); $postData=Http_build_query($postData); $opts=Array( ' http ' =Array( ' Method ' = ' POST ', ' header ' = ' host:localhost\r\n '. "Content-type:application/x-www-form-urlencoded\r\n". "Content-length:".strlen($postData) . "\ r \ n", ' content ' =$postData, ) ); $context=stream_context_create($opts); file_get_contents("http://localhost/http/index.php",false,$context);
Fopen Simulation Form Submission
<?PHP$postData=Array( ' Title ' = ' I'm fopen's structure data ', ' content ' = ' I'm fopen's structured data content ', ' publish ' and ' release ', ); $postData=Http_build_query($postData); $opts=Array( ' http ' =Array( ' Method ' = ' POST ', ' header ' = ' host:localhost\r\n '. "Content-type:application/x-www-form-urlencoded\r\n". "Content-length:".strlen($postData) . "\ r \ n", ' content ' =$postData, ) ); $context=stream_context_create($opts); $fp=fopen("http://localhost/http/index.php", "R",false,$context); $fclose($fp);
Curl mode to simulate form submission
$url= "http://localhost/http/index.php"; $postData=Array( ' Title ' = ' I'm curl's construction data ', ' content ' = ' I'm curl's structuring data ', ' publish ' + ' release ', ); //initializing a Curl session $ch=Curl_init (); //set the appropriate session optionscurl_setopt ($ch, Curlopt_url,$url);//set up submission URLscurl_setopt ($ch, Curlopt_post, 1);//set the Commit method with a value of 1 for positivecurl_setopt ($ch, Curlopt_postfields,$postData);//setting up submission data $output= curl_setopt ($ch, Curlopt_returntransfer, 1);//returns data as String//execution after successful submissionCurl_exec ($ch); //CloseCurl_close ($ch); Echo $output;
Edit not completed, continuous update in ...
Telnet using HTTP protocol + Rare form submission + Chat