<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://aznot.com/index.php?action=history&amp;feed=atom&amp;title=Telnet</id>
	<title>Telnet - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://aznot.com/index.php?action=history&amp;feed=atom&amp;title=Telnet"/>
	<link rel="alternate" type="text/html" href="https://aznot.com/index.php?title=Telnet&amp;action=history"/>
	<updated>2026-05-03T15:25:43Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://aznot.com/index.php?title=Telnet&amp;diff=8427&amp;oldid=prev</id>
		<title>Kenneth: /* Interactive telnet session with a Web server */</title>
		<link rel="alternate" type="text/html" href="https://aznot.com/index.php?title=Telnet&amp;diff=8427&amp;oldid=prev"/>
		<updated>2025-02-28T17:51:23Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Interactive telnet session with a Web server&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 17:51, 28 February 2025&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l251&quot;&gt;Line 251:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 251:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;We will first explore the HTTP protocol by using a good old program called telnet, that can connect on any port service by just providing the port number as an argument on the command line. This will let us see what is normally hidden by a standard Web browser: actual request and server responses, before being handled by a graphical end-user browser.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;We will first explore the HTTP protocol by using a good old program called telnet, that can connect on any port service by just providing the port number as an argument on the command line. This will let us see what is normally hidden by a standard Web browser: actual request and server responses, before being handled by a graphical end-user browser.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; % telnet example.com 80&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; GET / HTTP/1.0&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Exercise 1.1. Fetch a document==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Exercise 1.1. Fetch a document==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key aznot:diff:1.41:old-1150:rev-8427:php=table --&gt;
&lt;/table&gt;</summary>
		<author><name>Kenneth</name></author>
	</entry>
	<entry>
		<id>https://aznot.com/index.php?title=Telnet&amp;diff=1150&amp;oldid=prev</id>
		<title>Kenneth: Created page with &quot;== Telnet ==  == Interactive telnet session with Mail server ==  &lt;pre&gt; $ telnet auth.oeey.com 25 Trying 50.50.251.110... Connected to auth.oeey.com. Escape character is &#039;^]&#039;. ...&quot;</title>
		<link rel="alternate" type="text/html" href="https://aznot.com/index.php?title=Telnet&amp;diff=1150&amp;oldid=prev"/>
		<updated>2014-09-30T14:47:16Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;== Telnet ==  == Interactive telnet session with Mail server ==  &amp;lt;pre&amp;gt; $ telnet auth.oeey.com 25 Trying 50.50.251.110... Connected to auth.oeey.com. Escape character is &amp;#039;^]&amp;#039;. ...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== Telnet ==&lt;br /&gt;
&lt;br /&gt;
== Interactive telnet session with Mail server ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ telnet auth.oeey.com 25&lt;br /&gt;
Trying 50.50.251.110...&lt;br /&gt;
Connected to auth.oeey.com.&lt;br /&gt;
Escape character is &amp;#039;^]&amp;#039;.&lt;br /&gt;
ehlo bob&lt;br /&gt;
220 ******************************&lt;br /&gt;
250-auth.oeey.com&lt;br /&gt;
250-PIPELINING&lt;br /&gt;
250-SIZE 10240000&lt;br /&gt;
250-VRFY&lt;br /&gt;
250-ETRN&lt;br /&gt;
250-AUTH CRAM-MD5 LOGIN DIGEST-MD5 GSSAPI NTLM PLAIN&lt;br /&gt;
250-AUTH=CRAM-MD5 LOGIN DIGEST-MD5 GSSAPI NTLM PLAIN&lt;br /&gt;
250 8BITMIME&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The contents of your message file should resemble this example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
HELO host.example.com&lt;br /&gt;
MAIL FROM: &amp;lt;test@host.example.com&amp;gt;&lt;br /&gt;
RCPT TO: &amp;lt;bob@example.com&amp;gt;&lt;br /&gt;
DATA&lt;br /&gt;
From: [Alice] &amp;lt;alice@geek.com&amp;gt;&lt;br /&gt;
To: &amp;lt;bob@example.com&amp;gt;&lt;br /&gt;
Date: Mon, 12 Apr 2010 14:21:26 -0400&lt;br /&gt;
Subject: Test Message&lt;br /&gt;
&lt;br /&gt;
Hi there! This is supposed to be a real email...&lt;br /&gt;
&lt;br /&gt;
Have a good day!&lt;br /&gt;
Alice&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
.&lt;br /&gt;
QUIT&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now feed message to netcat:&lt;br /&gt;
 /usr/bin/nc smtp.domain.com 25 &amp;lt; /tmp/message&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# telnet auth.oeey.com 25&lt;br /&gt;
Trying 50.50.251.110...&lt;br /&gt;
Connected to auth.oeey.com.&lt;br /&gt;
Escape character is &amp;#039;^]&amp;#039;.&lt;br /&gt;
220 ******************************&lt;br /&gt;
EHLO trogdor&lt;br /&gt;
250-auth.oeey.com&lt;br /&gt;
250-PIPELINING&lt;br /&gt;
250-SIZE 10240000&lt;br /&gt;
250-VRFY&lt;br /&gt;
250-ETRN&lt;br /&gt;
250-AUTH CRAM-MD5 LOGIN DIGEST-MD5 GSSAPI NTLM PLAIN&lt;br /&gt;
250-AUTH=CRAM-MD5 LOGIN DIGEST-MD5 GSSAPI NTLM PLAIN&lt;br /&gt;
250 8BITMIME&lt;br /&gt;
AUTH LOGIN&lt;br /&gt;
334 VXNlcm5hbWU6                           ## Username:&lt;br /&gt;
a2VubmV0aC5idXJnZW5lcg==                   ## kenneth.burgener&lt;br /&gt;
334 UGFzc3dvcmQ6                           ## Password:&lt;br /&gt;
SW1CQjE5OTkh                               ## ****&lt;br /&gt;
235 Authentication successful&lt;br /&gt;
RCPT TO: &amp;lt;kenneth.burgener@oeey.com&amp;gt;&lt;br /&gt;
503 Error: need MAIL command&lt;br /&gt;
MAIL FROM: &amp;lt;kenneth.burgener@oeey.com&amp;gt;&lt;br /&gt;
250 Ok&lt;br /&gt;
RCPT TO: &amp;lt;kenneth@kennethburgener.org&amp;gt;&lt;br /&gt;
250 Ok&lt;br /&gt;
DATA&lt;br /&gt;
354 End data with &amp;lt;CR&amp;gt;&amp;lt;LF&amp;gt;.&amp;lt;CR&amp;gt;&amp;lt;LF&amp;gt;&lt;br /&gt;
Subject: This is a test&lt;br /&gt;
From: Kenneth &amp;lt;kenneth.burgener@oeey.com&amp;gt;&lt;br /&gt;
To: Kenneth &amp;lt;kenneth@kennethburgener.org&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is a test&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
250 Ok: queued as 8E2FD52095&lt;br /&gt;
500 Error: bad syntax&lt;br /&gt;
quit&lt;br /&gt;
221 Bye&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== SMTP Authentication ===&lt;br /&gt;
&lt;br /&gt;
* IndiMail: Authenticated SMTP tutorial - http://indimail.blogspot.com/2010/03/authenticated-smtp-tutorial.html&lt;br /&gt;
* Tutorial: SMTP Authentication - http://www.fehcom.de/qmail/smtpauth.html&lt;br /&gt;
* http://jetmore.org/john/code/gen-auth&lt;br /&gt;
* SMTP AUTH for sendmail 8.10: Realms and Examples - http://www.sendmail.org/~ca/email/authrealms.html&lt;br /&gt;
&lt;br /&gt;
Use base64 tool to encode decode:&lt;br /&gt;
 echo -n &amp;quot;[pass]&amp;quot; | /usr/bin/base64&lt;br /&gt;
 echo -n &amp;quot;[encpass]&amp;quot; | /usr/bin/base64 -d&lt;br /&gt;
 printf &amp;quot;\0postmaster@example.com\0pass&amp;quot; | /var/indimail/bin/base64&lt;br /&gt;
 printf &amp;#039;VXNlcm5hbWU6&amp;#039; | mimencode -u ; echo&lt;br /&gt;
&lt;br /&gt;
=== LOGIN Authentication ===&lt;br /&gt;
&lt;br /&gt;
This method accepts username and password as supplemental args.  It simply&lt;br /&gt;
returns each string Base64 encoded.  This provides only minimal advantages&lt;br /&gt;
over using ENCODE twice.  One advantage is hiding the password if you&lt;br /&gt;
provide it on STDIN&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
LOGIN: (base64) [http://www.webpan.com/Customers/Email/SMTP_Authentication_Telnet_Test.htm] [http://technet.microsoft.com/en-us/library/aa995718%28EXCHG.65%29.aspx]&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
EHLO trogdor&lt;br /&gt;
AUTH LOGIN&lt;br /&gt;
334 VXNlcm5hbWU6                           ## Username:&lt;br /&gt;
a2VubmV0aC5idXJnZW5lcg==                   ## kenneth.burgener&lt;br /&gt;
334 UGFzc3dvcmQ6                           ## Password:&lt;br /&gt;
SW1CQjE5OTkh                               ## ****&lt;br /&gt;
235 Authentication successful&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== PLAIN Authentication ===&lt;br /&gt;
&lt;br /&gt;
This type generates a PLAIN (RFC 2595) authentication string.  It accepts&lt;br /&gt;
supplemental arguments of username and password.  It generates a Base64&lt;br /&gt;
encoded string &amp;quot;\0&amp;lt;username&amp;gt;\0&amp;lt;password&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
PLAIN: (base64 on single line) [http://qmail.jms1.net/test-auth.shtml]&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
EHLO trogdor&lt;br /&gt;
AUTH PLAIN&lt;br /&gt;
334&lt;br /&gt;
AGtlbm5ldGguYnVyZ2VuZXIASW1CQjE5OTkh       ## \000kenneth.burgener\000****&lt;br /&gt;
235 Authentication successful&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
 perl -MMIME::Base64 -e &amp;#039;print encode_base64(&amp;quot;\000jms1\@jms1.net\000not.my.real.password&amp;quot;)&amp;#039; &lt;br /&gt;
 perl -MMIME::Base64 -e &amp;#039;print encode_base64(&amp;quot;\000kenneth.burgener\000****&amp;quot;)&amp;#039;&lt;br /&gt;
 AGtlbm5ldGguYnVyZ2VuZXIASW1CQjE5OTkh&lt;br /&gt;
&lt;br /&gt;
This also works:&lt;br /&gt;
 AUTH PLAIN AGtlbm5ldGguYnVyZ2VuZXIASW1CQjE5OTkh       ## \000kenneth.burgener\000****&lt;br /&gt;
&lt;br /&gt;
=== CRAM-MD5 ===&lt;br /&gt;
&lt;br /&gt;
CRAM-MD5 (RFC 2195) accepts three supplemental arguments.  The first is the username and&lt;br /&gt;
the second is the password.  The third is the challenge string provided&lt;br /&gt;
by the server.  This string can be either Base64 encoded or not.  The RFC states&lt;br /&gt;
that all (unencoded) challenge strings must start w/ &amp;#039;&amp;lt;&amp;#039;.  This is used to&lt;br /&gt;
whether the string is Base64 encoded or not.&lt;br /&gt;
&lt;br /&gt;
CRAM-MD5 uses the challenge and the supplied password to generate a digest.&lt;br /&gt;
it then returns the Base64 encoded version of the string md5(&amp;quot;&amp;lt;username&amp;gt; &amp;lt;challenge&amp;gt;&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
* http://indimail.blogspot.com/2010/03/authenticated-smtp-tutorial.html&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
3. AUTH CRAM-MD5&lt;br /&gt;
&lt;br /&gt;
The CRAM-MD5 is a challenge-response method where the password is not sent over the network. It is expected that the password is stored in the clear in IndiMail&amp;#039;s backend database MySQL.&lt;br /&gt;
&lt;br /&gt;
% sudo /var/indimail/bin/vpasswd postmaster@example.com -e pass&lt;br /&gt;
&lt;br /&gt;
Next step is to write a script named cram-md5&lt;br /&gt;
&lt;br /&gt;
% cat &amp;gt; cram-md5 &amp;lt;&amp;lt;&amp;gt;&amp;quot;&lt;br /&gt;
sys.exit(1)&lt;br /&gt;
str=cram_md5_response(sys.argv[1], sys.argv[2], sys.argv[3]);&lt;br /&gt;
print &amp;quot;%s&amp;quot; %str&lt;br /&gt;
EOF&lt;br /&gt;
&lt;br /&gt;
% sudo chmod +x ./cram-md5&lt;br /&gt;
&lt;br /&gt;
Now when you do (see below) auth cram-md5, the server will issue a challenge&lt;br /&gt;
e.g. in the below example, the challenge is&lt;br /&gt;
&lt;br /&gt;
PDIwMTM3LjEyNjc1ODUxMDBAaW5kaW1haWwub3JnPg==&lt;br /&gt;
&lt;br /&gt;
if you decode this, i.e.&lt;br /&gt;
&lt;br /&gt;
% echo PDIwMTM3LjEyNjc1ODUxMDBAaW5kaW1haWwub3JnPg== | base64 -d&lt;br /&gt;
&amp;lt;20137.1267585100@indimail.org&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The response for the challenge can be generated using the cram-md5 shell script which we created above. i.e.&lt;br /&gt;
&lt;br /&gt;
% ./cram-md5 PDIwMTM3LjEyNjc1ODUxMDBAaW5kaW1haWwub3JnPg==&lt;br /&gt;
cG9zdG1hc3RlckBleGFtcGxlLmNvbSBjZWU4Mzk3YWIxMjNhMGQ0ZjNhN2ZkZGJiOWNiODcxOQ==&lt;br /&gt;
&lt;br /&gt;
% telnet 0 smtp&lt;br /&gt;
Trying 0.0.0.0...&lt;br /&gt;
Connected to 0.&lt;br /&gt;
Escape character is &amp;#039;^]&amp;#039;.&lt;br /&gt;
220 indimail.org (NO UCE) ESMTP IndiMail 1.137 3 Mar 2010 08:28:17 +0530&lt;br /&gt;
auth cram-md5&lt;br /&gt;
334 PDIwMTM3LjEyNjc1ODUxMDBAaW5kaW1haWwub3JnPg==&lt;br /&gt;
cG9zdG1hc3RlckBleGFtcGxlLmNvbSBjZWU4Mzk3YWIxMjNhMGQ0ZjNhN2ZkZGJiOWNiODcxOQ==&lt;br /&gt;
235 ok, go ahead (#2.0.0)&lt;br /&gt;
&lt;br /&gt;
Please do take a look at Erwin Hoffman&amp;#039;s excellent tutorial on the same subject at&lt;br /&gt;
http://www.fehcom.de/qmail/smtpauth.html&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== CRAM-SHA1 ===&lt;br /&gt;
&lt;br /&gt;
This behaves the same as CRAM-MD5 but uses SHA1 digesting rather than MD5.&lt;br /&gt;
&lt;br /&gt;
=== DIGEST-MD5 ===&lt;br /&gt;
&lt;br /&gt;
* http://www.sendmail.org/~ca/email/authrealms.html&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
250-AUTH LOGIN PLAIN CRAM-MD5 DIGEST-MD5&lt;br /&gt;
250 HELP&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; AUTH DIGEST-MD5&lt;br /&gt;
334 bm9uY2U9IkFKUlVjNUp4MFVRYnY1U0o5Rm95VW5hWnBxWklIRGhMVFUrQXduL0swVXc9Iixxb3A9ImF1dGgsYXV0aC1pbnQsYXV0aC1jb25mIixjaXBoZXI9InJjNC00MCxyYzQtNTYscmM0LGRlcywzZGVzIixjaGFyc2V0PXV0Zi04LGFsZ29yaXRobT1tZDUtc2Vzcw==&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; dXNlcm5hbWU9InRlc3QiLHJlYWxtPSJ3aXouZXhhbXBsZS5jb20iLG5vbmNlPSJBSlJVYzVKeDBVUWJ2NVNKOUZveVVuYVpwcVpJSERoTFRVK0F3bi9LMFV3PSIsY25vbmNlPSJBSlJVYzVKeDBVUWJ2NVNKOUZveVVuYVpwcVpJSERoTFRVK0F3bi9LMFV3PSIsbmM9MDAwMDAwMDEscW9wPWF1dGgtY29uZixjaXBoZXI9InJjNCIsY2hhcnNldD11dGYtOCxkaWdlc3QtdXJpPSJzbXRwL2xvY2FsaG9zdC5zZW5kbWFpbC5jb20uIixyZXNwb25zZT0wZTdjZmNhZTcxN2VlYWM5NzJmYzlkNTYwNmExMDgzZA==&lt;br /&gt;
334 cnNwYXV0aD03NDM5ODBjODQ0MmRiYjcxNmQ0ZWE5ZTQ5OTNiMDFkMA==&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; &lt;br /&gt;
235 2.0.0 OK Authenticated&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Decoded:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
nonce=&amp;quot;AJRUc5Jx0UQbv5SJ9FoyUnaZpqZIHDhLTU+Awn/K0Uw=&amp;quot;,qop=&amp;quot;auth,auth-int,auth-conf&amp;quot;,cipher=&amp;quot;rc4-40,rc4-56,rc4,des,3des&amp;quot;,charset=utf-8,algorithm=md5-sess&lt;br /&gt;
&lt;br /&gt;
username=&amp;quot;test&amp;quot;,realm=&amp;quot;wiz.example.com&amp;quot;,nonce=&amp;quot;AJRUc5Jx0UQbv5SJ9FoyUnaZpqZIHDhLTU+Awn/K0Uw=&amp;quot;,cnonce=&amp;quot;AJRUc5Jx0UQbv5SJ9FoyUnaZpqZIHDhLTU+Awn/K0Uw=&amp;quot;,nc=00000001,qop=auth-conf,cipher=&amp;quot;rc4&amp;quot;,charset=utf-8,digest-uri=&amp;quot;smtp/localhost.sendmail.com.&amp;quot;,response=0e7cfcae717eeac972fc9d5606a1083d&lt;br /&gt;
&lt;br /&gt;
rspauth=743980c8442dbb716d4ea9e4993b01d0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== GSSAPI ===&lt;br /&gt;
&lt;br /&gt;
* http://en.wikipedia.org/wiki/Generic_Security_Services_Application_Program_Interface&lt;br /&gt;
&lt;br /&gt;
=== NTLM ===&lt;br /&gt;
&lt;br /&gt;
Although it may be advertised as one of the above types, this method of authentication if refered to singularly as NTLM.  This is a multi-step authentication type.  The first 3 arguments must be supplied up front.  They are username, password, and domain, in that order.  These three strings are used to generate an &amp;quot;Auth Request&amp;quot; string.  This string should be passed verbatim to the server.  The server will then respond with a challenge.  This challenge is the fourth argument.  After receiving the server challenge, gen-auth will produce an &amp;quot;Auth Response&amp;quot;.  Posting this response to the server completes the NTLM authentication transaction.&lt;br /&gt;
&lt;br /&gt;
This authentication method requires the Authen::NTLM perl module to be installed.  See EXAMPLES for an example of this transaction.  Note also that &amp;#039;domain&amp;#039; is often blank from client or ignored by server.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Complicated challenge response:&lt;br /&gt;
* http://curl.haxx.se/rfc/ntlm.html&lt;br /&gt;
* http://davenport.sourceforge.net/ntlm.html&lt;br /&gt;
* [http://www.google.com/url?sa=t&amp;amp;source=web&amp;amp;cd=2&amp;amp;sqi=2&amp;amp;ved=0CB4QFjAB&amp;amp;url=http%3A%2F%2Fdownload.microsoft.com%2Fdownload%2F9%2F5%2Fe%2F95ef66af-9026-4bb0-a41d-a4f81802d92c%2F%255BMS-SMTP%255D.pdf&amp;amp;rct=j&amp;amp;q=telnet%20smtp%20auth%20NTML&amp;amp;ei=gwxCTYTRCo2LswadqtSdDg&amp;amp;usg=AFQjCNFj1yvCOttxEsT1iRQzJ4Y8iT3TrQ&amp;amp;cad=rja]&lt;br /&gt;
&lt;br /&gt;
==Interactive telnet session with a Web server==&lt;br /&gt;
[http://www.pasteur.fr/formation/infobio/web/cours/ch01.html Interactive telnet session with a Web server]&lt;br /&gt;
&lt;br /&gt;
We will first explore the HTTP protocol by using a good old program called telnet, that can connect on any port service by just providing the port number as an argument on the command line. This will let us see what is normally hidden by a standard Web browser: actual request and server responses, before being handled by a graphical end-user browser.&lt;br /&gt;
&lt;br /&gt;
==Exercise 1.1. Fetch a document==&lt;br /&gt;
&lt;br /&gt;
Let us fetch a document from the Pasteur Institute Web server:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
% telnet www.pasteur.fr 80&lt;br /&gt;
Trying 157.99.64.12...&lt;br /&gt;
Connected to www.pasteur.fr.&lt;br /&gt;
Escape character is &amp;#039;^]&amp;#039;.&lt;br /&gt;
GET /formation/infobio/web/cours/data/page1.html HTTP/1.0&lt;br /&gt;
&lt;br /&gt;
HTTP/1.1 200 OK&lt;br /&gt;
Date: Tue, 24 Feb 2004 18:01:05 GMT&lt;br /&gt;
Server: Apache/1.3.26 (Unix) mod_perl/1.24_01 mod_ssl/2.8.10 OpenSSL/0.9.5a&lt;br /&gt;
Last-Modified: Tue, 18 Feb 2003 13:40:14 GMT&lt;br /&gt;
ETag: &amp;quot;101e6a1-cd-3e5237be&amp;quot;&lt;br /&gt;
Accept-Ranges: bytes&lt;br /&gt;
Content-Length: 205&lt;br /&gt;
Connection: close&lt;br /&gt;
Content-Type: text/html; charset=iso-8859-1&lt;br /&gt;
&lt;br /&gt;
&amp;lt;html&amp;gt;&lt;br /&gt;
  &amp;lt;head&amp;gt;&lt;br /&gt;
    &amp;lt;title&amp;gt;A sample Web page&amp;lt;/title&amp;gt;&lt;br /&gt;
  &amp;lt;/head&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;body&amp;gt;&lt;br /&gt;
    &amp;lt;h1&amp;gt;A first header&amp;lt;/h1&amp;gt;&lt;br /&gt;
    And some text...&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;/html&amp;gt;&lt;br /&gt;
Connection closed by foreign host.&lt;br /&gt;
%&lt;br /&gt;
&amp;lt;/pre&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
You can as well get important information from the Web server, before getting the entire document:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
% telnet www.pasteur.fr 80&lt;br /&gt;
Trying 157.99.64.12...&lt;br /&gt;
Connected to www.pasteur.fr.&lt;br /&gt;
Escape character is &amp;#039;^]&amp;#039;.&lt;br /&gt;
HEAD /formation/infobio/web/cours/data/page1.html HTTP/1.0&lt;br /&gt;
&lt;br /&gt;
HTTP/1.1 200 OK&lt;br /&gt;
Date: Tue, 24 Feb 2004 18:01:05 GMT&lt;br /&gt;
Server: Apache/1.3.26 (Unix) mod_perl/1.24_01 mod_ssl/2.8.10 OpenSSL/0.9.5a&lt;br /&gt;
Last-Modified: Tue, 18 Feb 2003 14:38:31 GMT&lt;br /&gt;
ETag: &amp;quot;101e6a1-cd-3e5237be&amp;quot;&lt;br /&gt;
Accept-Ranges: bytes&lt;br /&gt;
Content-Length: 205&lt;br /&gt;
Connection: close&lt;br /&gt;
Content-Type: text/html; charset=iso-8859-1&lt;br /&gt;
&lt;br /&gt;
Connection closed by foreign host.&lt;br /&gt;
%&lt;br /&gt;
&amp;lt;/pre&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
What could this kind of information be useful for?&lt;br /&gt;
&lt;br /&gt;
==Exercise 1.2. HTTP headers==&lt;br /&gt;
&lt;br /&gt;
Let us use date information from the server. For instance, say you do not want a too recently modified file: you can use an HTTP header for this purpose.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
% telnet www.pasteur.fr 80&lt;br /&gt;
Trying 157.99.64.12...&lt;br /&gt;
Connected to www.pasteur.fr.&lt;br /&gt;
Escape character is &amp;#039;^]&amp;#039;.&lt;br /&gt;
GET /formation/infobio/web/cours/data/page1.html HTTP/1.0&lt;br /&gt;
If-Modified-Since: Tue, 18 Feb 2003 14:38:31 GMT&lt;br /&gt;
&lt;br /&gt;
HTTP/1.1 304 Not Modified&lt;br /&gt;
Date: Tue, 24 Feb 2004 18:01:05 GMT&lt;br /&gt;
Server: Apache/1.3.26 (Unix) mod_perl/1.24_01 mod_ssl/2.8.10 OpenSSL/0.9.5a&lt;br /&gt;
Last-Modified: Tue, 18 Feb 2003 14:38:31 GMT&lt;br /&gt;
Connection: close&lt;br /&gt;
ETag: &amp;quot;101e6a1-cd-3e5237be&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Connection closed by foreign host.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another useful header let you chain several requests. Try:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
% telnet www.pasteur.fr 80&lt;br /&gt;
Trying 157.99.64.12...&lt;br /&gt;
Connected to www.pasteur.fr.&lt;br /&gt;
Escape character is &amp;#039;^]&amp;#039;.&lt;br /&gt;
GET /formation/infobio/web/cours/data/page1.html HTTP/1.0&lt;br /&gt;
Connection: keep-alive&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
What can you do after server&amp;#039;s reposnse?&lt;br /&gt;
&lt;br /&gt;
==Exercise 1.3. HTTP status code==&lt;br /&gt;
&lt;br /&gt;
HTTP return codes help you know whether a request has been successful. Explain what happens in the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
% telnet bioweb.pasteur.fr 80&lt;br /&gt;
Trying 157.99.64.11...&lt;br /&gt;
Connected to rosalind.sis.pasteur.fr.&lt;br /&gt;
Escape character is &amp;#039;^]&amp;#039;.&lt;br /&gt;
GET /formation/infobio/web/cours/data/page1.html HTTP/1.0&lt;br /&gt;
&lt;br /&gt;
HTTP/1.1 404 Not Found&lt;br /&gt;
Date: Tue, 24 Feb 2004 18:01:05 GMT&lt;br /&gt;
Server: Apache/1.3.20 (Unix)&lt;br /&gt;
Last-Modified: Tue, 18 Feb 2003 14:38:31 GMT&lt;br /&gt;
Connection: close&lt;br /&gt;
Content-Type: text/html; charset=iso-8859-1&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!DOCTYPE HTML PUBLIC &amp;quot;-//IETF//DTD HTML 2.0//EN&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;HTML&amp;gt;&amp;lt;HEAD&amp;gt;&lt;br /&gt;
&amp;lt;TITLE&amp;gt;404 Not Found&amp;lt;/TITLE&amp;gt;&lt;br /&gt;
&amp;lt;/HEAD&amp;gt;&amp;lt;BODY&amp;gt;&lt;br /&gt;
&amp;lt;H1&amp;gt;Not Found&amp;lt;/H1&amp;gt;&lt;br /&gt;
The requested URL /formation/infobio/web/cours/data/page1.html was not found on this server.&amp;lt;P&amp;gt;&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
&amp;lt;ADDRESS&amp;gt;Apache/1.3.20 Server at bioweb.pasteur.fr Port 80&amp;lt;/ADDRESS&amp;gt;&lt;br /&gt;
&amp;lt;/BODY&amp;gt;&amp;lt;/HTML&amp;gt;&lt;br /&gt;
Connection closed by foreign host.&lt;br /&gt;
%&lt;br /&gt;
&amp;lt;/pre&amp;gt;	  &lt;br /&gt;
&lt;br /&gt;
And here:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
% telnet www.pasteur.fr 80&lt;br /&gt;
Trying 157.99.64.12...&lt;br /&gt;
Connected to www.pasteur.fr.&lt;br /&gt;
Escape character is &amp;#039;^]&amp;#039;.&lt;br /&gt;
HEAD /formation/infobio/web/cours/data/page2.html HTTP/1.0&lt;br /&gt;
&lt;br /&gt;
HTTP/1.1 403 Forbidden&lt;br /&gt;
Date: Tue, 24 Feb 2004 18:01:05 GMT&lt;br /&gt;
Server: Apache/1.3.26 (Unix) mod_perl/1.24_01 mod_ssl/2.8.10 OpenSSL/0.9.5a&lt;br /&gt;
Last-Modified: Tue, 26 Nov 2002 15:21:19 GMT&lt;br /&gt;
ETag: &amp;quot;ee325-c4c-3de3916f&amp;quot;&lt;br /&gt;
Accept-Ranges: bytes&lt;br /&gt;
Content-Length: 3148&lt;br /&gt;
Connection: close&lt;br /&gt;
Content-Type: text/html; charset=iso-8859-1&lt;br /&gt;
&lt;br /&gt;
Connection closed by foreign host.&lt;br /&gt;
&amp;lt;/pre&amp;gt;	&lt;br /&gt;
&lt;br /&gt;
==Exercise 1.4. HTTP GET: dynamic content==&lt;br /&gt;
&lt;br /&gt;
A Web server does not only serve static document. You can also issue request to get dynamically computed document. At the HTTP protocol level, there are several ways to achieve this. Firstly, try:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
% telnet www.pasteur.fr 80&lt;br /&gt;
Trying 157.99.64.12...&lt;br /&gt;
Connected to www.pasteur.fr.&lt;br /&gt;
Escape character is &amp;#039;^]&amp;#039;.&lt;br /&gt;
GET /cgi-bin/biology/bnb_s.pl?query=biopython HTTP/1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
what do you get?&lt;br /&gt;
&lt;br /&gt;
Try another one (put your own email in place of YOUR_EMAIL):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
% telnet bioweb.pasteur.fr 80&lt;br /&gt;
Trying 157.99.64.11...&lt;br /&gt;
Connected to rosalind.sis.pasteur.fr.&lt;br /&gt;
Escape character is &amp;#039;^]&amp;#039;.&lt;br /&gt;
GET /cgi-bin/seqanal/pdbsearch.pl?email=YOUR_EMAIL&amp;amp;query=1crn HTTP/1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;	  &lt;br /&gt;
&lt;br /&gt;
==Exercise 1.5. HTTP POST==&lt;br /&gt;
&lt;br /&gt;
Describe the difference between Exercise 1.4 and the following (do not forget to reset the &amp;lt;variable&amp;gt;Content-length&amp;lt;/variable&amp;gt; according to the total length of the request character string, e.g: ):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
% telnet bioweb.pasteur.fr 80&lt;br /&gt;
Trying 157.99.64.11...&lt;br /&gt;
Connected to rosalind.sis.pasteur.fr.&lt;br /&gt;
Escape character is &amp;#039;^]&amp;#039;.&lt;br /&gt;
POST /cgi-bin/seqanal/pdbsearch.pl HTTP/1.0&lt;br /&gt;
Content-type: application/x-www-form-urlencoded&lt;br /&gt;
Content-length: 35&lt;br /&gt;
&lt;br /&gt;
email=YOUR_EMAIL&amp;amp;query=1crn&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Kenneth</name></author>
	</entry>
</feed>