telnet 80
执行
telnet guoshuang.com 80
返回
Connected to guoshuang.com.
Escape character is ‘^]’.
然后执行
GET / HTTP/1.1
host: guoshuang.com
两次回车,得到类似 curl 的 html 代码。
注意:大小写和换行、两次回车 都必须。(拷贝执行,否则回车会退出 telnet)
只显示头信息
HEAD /index.html HTTP/1.1
host: guoshuang.com
telnet ftp
telnet xxxx.com 21
Trying 113.141.31.3…
Connected to tcstv.com.
Escape character is ‘^]’.
220-FileZilla Server version 0.9.43 beta
220 hi,welcome back david guoshuang
USER guoshuang
PASS 密码
更多ftp命令(help):
- CWD - 等于 cd
- PASV – 被动模式,客户端连接服务器
- RETR – 下载文件
- QUIT – 退出
USER PASS QUIT CWD PWD PORT PASV TYPE
LIST REST CDUP RETR STOR SIZE DELE RMD
MKD RNFR RNTO ABOR SYST NOOP APPE NLST
MDTM XPWD XCUP XMKD XRMD NOP EPSV EPRT
AUTH ADAT PBSZ PROT FEAT MODE OPTS HELP
ALLO MLST MLSD SITE P@SW STRU CLNT MFMT
HASH
这些属于 rawftp command,和 ftp shell 不一样!
list(NLST) 之前必须先 pasv
Tells the server to enter “passive mode”. In passive mode, the server will wait for the client to establish a connection with it rather than attempting to connect to a client-specified port. The server will respond with the address of the port it is listening on, with a message like:
227 Entering Passive Mode (a1,a2,a3,a4,p1,p2)
where a1.a2.a3.a4 is the IP address and p1*256+p2 is the port number.