Environment: Widows and Linux are all OK, but Windows does not work well. This article is based on Linux
Purpose: To understand the Application Layer protocol HTTP, manual method knocking protocol.
Once you have established a connection with Telnet, you can implement the protocol manually. Telnet can connect not only 23 ports on the server, but also other ports, such as 21,25,80.
Get page
1, with Baidu to establish HTTP connection Telnet www.baidu.com 80
Output
fym@g470:~/www/public_html/test$ telnet www.baidu.com trying 61.135.169.125 ... Connected to www.a.shifen.com. Escape character is ' ^] '.
2. Send GET request Home content
get/http/1.1
When you enter the above line, hit the ENTER key two times. Then you can see Baidu returned to you the content of the home page.
POST Send on data
Server-side PHP code, formaction.php
<?php Import_request_variables (GP, "Formval_"); echo "name =". $formval _name; echo "<br/>"; echo "age =" $formval _age; ?>
after the Telnet host, post data
fym@g470:~/www/public_html/test$ telnet fym.vacau.com trying 31.170.161.196 ... Connected to fym.vacau.com. Escape character is ' ^] '. post/test/formaction.php http/1.1 HOST:fym.vacau.com content-type:application/x-www-form-urlencoded Content-Lengt H:15 name=fym&age=26
Service-side loopback data
http/1.1 OK Date:sat, June 04:15:38 GMT Server:apache x-powered-by:php/5.2.17 content-length:178 Connection:close content-type:text/html name = fym<br/>age = 26
Get
fym@g470:~/www/public_html/test$ telnet fym.vacau.com trying 31.170.161.196 ... Connected to fym.vacau.com. Escape character is ' ^] '. Get/test/formaction.php?name=fym&age=26 http/1.1 HOST:fym.vacau.com