Graphics Programs Reference
In-Depth Information
From /etc/services
finger 79/tcp # Finger
finger 79/udp
h ttp
80/tcp www www-http # World Wide Web HTTP
HTTP exists in the application layer—the top layer—of the OSI model.
At this layer, all of the networking details have already been taken care of by
the lower layers, so HTTP uses plaintext for its structure. Many other
application layer protocols also use plaintext, such as POP3, SMTP, IMAP,
and FTP's control channel. Since these are standard protocols, they are all
well documented and easily researched. Once you know the syntax of these
various protocols, you can manually talk to other programs that speak the
same language. There's no need to be fluent, but knowing a few important
phrases will help you when traveling to foreign servers. In the language of
HTTP, requests are made using the command GET , followed by the resource
path and the HTTP protocol version. For example, GET / HTTP/1.0 will request
the root document from the webserver using HTTP version 1.0. The request
is actually for the root directory of /, but most webservers will automatically
search for a default HTML document in that directory of index.html. If the
server finds the resource, it will respond using HTTP by sending several
headers before sending the content. If the command HEAD is used instead of
GET , it will only return the HTTP headers without the content. These headers
are plaintext and can usually provide information about the server. These
headers can be retrieved manually using telnet by connecting to port 80 of a
known website, then typing HEAD / HTTP/1.0 and pressing ENTER twice. In the
output below, telnet is used to open a TCP-IP connection to the webserver at
http://www.internic.net. Then the HTTP application layer is manually
spoken to request the headers for the main index page.
reader@hacking:~/booksrc $ telnet www.internic.net 80
Trying 208.77.188.101...
Connected to www.internic.net.
Escape character is '^]'.
HEAD / HTTP/1.0
HTTP/1.1 200 OK
Date: Fri, 14 Sep 2007 05:34:14 GMT
Server: Apache/2.0.52 (CentOS)
Accept-Ranges: bytes
Content-Length: 6743
Connection: close
Content-Type: text/html; charset=UTF-8
Connection closed by foreign host.
reader@hacking:~/booksrc $
Search WWH ::




Custom Search