is an SSL\-aware command\-line proxy\&. It watches TCP connections and displays the data going by\&. If a connection is SSL, the data display includes interpreted SSL records and handshaking
.SH"OPTIONS"
.PP
\-f
.RS4
Turn on fancy printing\&. Output is printed in colored HTML\&. Data sent from the client to the server is in blue; the server\*(Aqs reply is in red\&. When used with looping mode, the different connections are separated with horizontal lines\&. You can use this option to upload the output into a browser\&.
Turn on hex/ASCII printing\&. Instead of outputting raw data, the command interprets each record as a numbered line of hex values, followed by the same data as ASCII characters\&. The two parts are separated by a vertical bar\&. Nonprinting characters are replaced by dots\&.
Turn on SSL parsing and decoding\&. The tool does not automatically detect SSL sessions\&. If you are intercepting an SSL connection, use this option so that the tool can detect and decode SSL structures\&.
.sp
If the tool detects a certificate chain, it saves the DER\-encoded certificates into files in the current directory\&. The files are named cert\&.0x, where x is the sequence number of the certificate\&.
.sp
If the \-s option is used with \-h, two separate parts are printed for each record: the plain hex/ASCII output, and the parsed SSL output\&.
You can use the SSL Debugging Tool to intercept any connection information\&. Although you can run the tool at its most basic by issuing the ssltap command with no options other than hostname:port, the information you get in this way is not very useful\&. For example, assume your development machine is called intercept\&. The simplest way to use the debugging tool is to execute the following command from a command shell:
.sp
.ifn\{\
.RS4
.\}
.nf
$ ssltap www\&.netscape\&.com
.fi
.ifn\{\
.RE
.\}
.PP
The program waits for an incoming connection on the default port 1924\&. In your browser window, enter the URL http://intercept:1924\&. The browser retrieves the requested page from the server at www\&.netscape\&.com, but the page is intercepted and passed on to the browser by the debugging tool on intercept\&. On its way to the browser, the data is printed to the command shell from which you issued the command\&. Data sent from the client to the server is surrounded by the following symbols: \-\-> [ data ] Data sent from the server to the client is surrounded by the following symbols: "left arrow"\-\- [ data ] The raw data stream is sent to standard output and is not interpreted in any way\&. This can result in peculiar effects, such as sounds, flashes, and even crashes of the command shell window\&. To output a basic, printable interpretation of the data, use the \-h option, or, if you are looking at an SSL connection, the \-s option\&. You will notice that the page you retrieved looks incomplete in the browser\&. This is because, by default, the tool closes down after the first connection is complete, so the browser is not able to load images\&. To make the tool continue to accept connections, switch on looping mode with the \-l option\&. The following examples show the output from commonly used combinations of options\&.
10: 56 6f 52 62 fe 3d b3 65 b1 e4 13 0f 52 a3 c8 f6 | VoRb\(Tp=\(S3e\(+-\&.\&.\&.R\(Po\(`E\&.
}
cipher_suite = (0x0003) SSL3/RSA/RC4\-40/MD5
}
0: 0b 00 02 c5 |\&.\&.\&.\(oA
type = 11 (certificate)
length = 709 (0x0002c5)
CertificateChain {
chainlength = 706 (0x02c2)
Certificate {
size = 703 (0x02bf)
data = { saved in file \*(Aqcert\&.001\*(Aq }
}
}
0: 0c 00 00 ca |\&.\&.\&.\&.
type = 12 (server_key_exchange)
length = 202 (0x0000ca)
0: 0e 00 00 00 |\&.\&.\&.\&.
type = 14 (server_hello_done)
length = 0 (0x000000)
}
}
]
\-\-> [
SSLRecord {
0: 16 03 00 00 44 |\&.\&.\&.\&.D
type = 22 (handshake)
version = { 3,0 }
length = 68 (0x44)
handshake {
0: 10 00 00 40 |\&.\&.\&.@
type = 16 (client_key_exchange)
length = 64 (0x000040)
ClientKeyExchange {
message = {\&.\&.\&.}
}
}
}
]
\-\-> [
SSLRecord {
0: 14 03 00 00 01 |\&.\&.\&.\&.\&.
type = 20 (change_cipher_spec)
version = { 3,0 }
length = 1 (0x1)
0: 01 |\&.
}
SSLRecord {
0: 16 03 00 00 38 |\&.\&.\&.\&.8
type = 22 (handshake)
version = { 3,0 }
length = 56 (0x38)
< encrypted >
}
]
<\-\- [
SSLRecord {
0: 14 03 00 00 01 |\&.\&.\&.\&.\&.
type = 20 (change_cipher_spec)
version = { 3,0 }
length = 1 (0x1)
0: 01 |\&.
}
]
<\-\- [
SSLRecord {
0: 16 03 00 00 38 |\&.\&.\&.\&.8
type = 22 (handshake)
version = { 3,0 }
length = 56 (0x38)
< encrypted >
}
]
\-\-> [
SSLRecord {
0: 17 03 00 01 1f |\&.\&.\&.\&.\&.
type = 23 (application_data)
version = { 3,0 }
length = 287 (0x11f)
< encrypted >
}
]
<\-\- [
SSLRecord {
0: 17 03 00 00 a0 |\&.\&.\&.\&.
type = 23 (application_data)
version = { 3,0 }
length = 160 (0xa0)
< encrypted >
}
]
<\-\- [
SSLRecord {
0: 17 03 00 00 df |\&.\&.\&.\&.\(ss
type = 23 (application_data)
version = { 3,0 }
length = 223 (0xdf)
< encrypted >
}
SSLRecord {
0: 15 03 00 00 12 |\&.\&.\&.\&.\&.
type = 21 (alert)
version = { 3,0 }
length = 18 (0x12)
< encrypted >
}
]
Server socket closed\&.
.fi
.ifn\{\
.RE
.\}
.PP
Example 2
.PP
The \-s option turns on SSL parsing\&. Because the \-x option is not used in this example, undecoded values are output as raw data\&. The output is routed to a text file\&.
In this example, the \-s option turns on SSL parsing, and the \-h option turns on hex/ASCII format\&. Both formats are shown for each record\&. The output is routed to a text file\&.
When SSL restarts a previous session, it makes use of cached information to do a partial handshake\&. If you wish to capture a full SSL handshake, restart the browser to clear the session id cache\&.
.PP
If you run the tool on a machine other than the SSL server to which you are trying to connect, the browser will complain that the host name you are trying to connect to is different from the certificate\&. If you are using the default BadCert callback, you can still connect through a dialog\&. If you are not using the default BadCert callback, the one you supply must allow for this possibility\&.
Licensed under the Mozilla Public License, v\&. 2\&.0\&. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla\&.org/MPL/2\&.0/\&.