% telnet www.google.com 80
Trying 64.233.169.104...
Connected to www.l.google.com.
Escape character is '^]'.
GET / HTTP/1.0
HTTP/1.0 200 OK
Cache-Control: private
Content-Type: text/html; charset=ISO-8859-1
Server: gws
Date: Tue, 18 Sep 2007 02:16:00 GMT
Connection: Close
<html><head><meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"><title>Google</title>
...
</body></html>Connection closed by foreign host.
%
You can use this technique to see the unvarnished HTML payload without doing a View>Page Source, as well as the HTTP headers. Best way to find out who's running Apache, who's running IIS, who's running something custom.
It's easy to run telnet from a Mac OS Terminal window: just remember to hit the enter key twice after you type type the GET line. I was less successful running telnet from a Windows Command Prompt window.
% telnet www.microsoft.com 80
Trying 207.46.19.254...
Connected to toggle.www.ms.akadns.net.
Escape character is '^]'.
GET / HTTP/1.0
HTTP/1.1 302 Found
Cache-Control: private
Content-Type: text/html; charset=utf-8
Location: /en/us/default.aspx
Server: Microsoft-IIS/7.0
X-AspNet-Version: 2.0.50727
P3P: CP="ALL IND DSP COR ADM CONo CUR CUSo IVAo IVDo PSA PSD TAI TELo OUR SAMo CNT COM INT NAV ONL PHY PRE PUR UNI"
X-Powered-By: ASP.NET
Date: Tue, 18 Sep 2007 02:26:39 GMT
Connection: keep-alive
Content-Length: 136
<html><head><title>Object moved</title></head><body>
<h2>Object moved to <a href="/en/us/default.aspx">here</a>.</h2>
</body></html>
Connection closed by foreign host.
%
When I hit the server at Amazon.com, the last line of HTML consisted of the comment string <!-- MEOW -->. Go figure.
1 comment:
In the Windows console, try "set localecho", "set crlf", then open the connection with "o [hostname] 80".
Post a Comment