Beginning with NetWitness Suite 11.0, administrators can configure a Packet Decoder to decrypt incoming packets using the sslKeys command. Enabled parsers will see the unencrypted packet payload and create metadata accordingly. If the Decoder is not configured to decrypt incoming packets, most enabled parsers will see only encrypted garbage and will fail to create meaningful metadata.
The sslKeys command provides a way to upload premaster or private keys to the Decoder, so that captured encrypted packets that match the keys can be decrypted before parsing. Administrators configure the Decoder by entering the sslKeys command using the NwConsole command line interface or the Decoder RESTful interface.
The RESTful interface form at the path: /decoder/sslkeys allows uploading a single PEM-encoded private key, a single file containing multiple private keys concatenated together, or a single file of multiple premaster keys.
Although the packets are decrypted during the parse stage, only the encrypted packets are written to disk. The matching premaster key used for decrypting is written to the tls.premaster meta key, which analysts can use to subsequently view unencrypted packets on demand.
Details for administrators to configure decryption of incoming packets, and for analysts to view unencrypted packets on demand are provided below.
Decrypting packets in real time requires extra work in the parsing stage. Before implementing this feature, plan carefully to ensure the incoming traffic bandwidth does not overwhelm the available compute power. You may need more Decoders to decrypt traffic than you would need if not decrypting.
Packets captured on a Decoder normally have a timeout of ~60 seconds in the assembly stage before they are sent to the parsing step. If the Decoder is under memory pressure due to very high bandwidth, the lifetime of the packets in Assembler may be shortened. To alleviate this situation, you can configure a longer timeout value and increase the amount of memory available to hold packets in Assembly. Also, in order to perform decryption of the packets, the Decoder must receive the decryption key before the parsing stage.
With no feeds loaded, the following parsers enabled, and 50% of the sessions being decrypted,a Decoder can process traffic at 3 Gbps .
The sslKeys command accepts two types of encryption keys:
- Premaster key: the symmetric key used in the TLS payload stream for encryption and decryption.
- Private key: the asymmetric private key used during the TLS handshake that encrypts the premaster.
The premaster key is generated randomly and is ephemeral for the life of one specific TLS session. Normally, there is not a good way to get premaster keys to a Decoder in time for the parsing step. However, both Chrome and Firefox can write the premaster keys they generate to a file. This is useful for testing purposes. To configure your browser to do this, create an environment variable called SSLKEYLOGFILE and assign it the pathname of a file to which the keys will be written. The Decoder will accept the file exactly as written and will use all the decryption keys in the file for any encrypted traffic it captures.
This is a sample NwConsole script that uploads the file to a Decoder:
login <decoder>:50004 <username> <password>
send /decoder sslKeys --file-data=SSLKeys.txt
This is an example using a curl command (with the RESTful port) to upload the file to a Decoder:
curl -u "<username>:<password>" -H "Content-Type: application/octet-stream" --data-binary @"/path/SSLKeys.txt" -X POST "http://<hostname>:50104/decoder?msg=sslKeys"
After the symmetric keys are uploaded, they will immediately be used for any necessary decryption. Symmetric keys are stored in memory and there is a limit to how many can be stored at any point in time. As more keys are added, the earliest keys will be aged out. You can also add premaster keys by just passing the random and premaster parameters to sslKeys.
Private Keys or PEM files
Private keys are normally stored in PEM files and are the asymmetric keys generated by services that accept TLS traffic. These keys are used during the TLS handshake to encrypt the premaster symmetric key that will be used for the rest of the payload encryption.
For example, if you have a web server whose traffic you want visibility into, you need to upload the private key it uses to encrypt traffic. You only need to do this once, as it is stored permanently (or until removed by a delete command). Private keys are automatically encrypted before storing to protect them. After upload, you must issue a parser reload command so that the newly installed key becomes visible to the HTTPS parser. Now, all TLS handshakes that use that private key will be able to be decrypted by the Decoder.
These are some sample commands that upload a PEM file to be used for decryption.
send /decoder sslKeys pemFilename=MyKey.pem --file-data=/path/MyKey.pem
Using the RESTful interface (you must provide the pemFilename parameter in the URL):
curl -u "<username>:<password>" -H "Content-Type: application/octet-stream" --data-binary @"/path/MyKey.pem" -X POST "http://<hostname>:50104/decoder?msg=sslKeys&pemFilename=MyKey.pem"
Upload Multiple Premaster and Private Keys
You can use the RESTful interface form to facilitate uploading of multiple keys, both premaster and private at the same time.
- Open the RESTful API in your browser, and navigate to this path on the Decoder that you want to configure: /decoder/sslkeys.
- Next to Upload File 1, click Choose File and locate the premaster key file or PEM file that you want to upload on you local file system.
- (Optional) repeat for Upload File 2 and Upload File 3.
- Click Upload.
The files are uploaded to the Decoder and results are displayed in the form.
Parameters for Managing Keys
The sslKeys command has several parameters for managing premaster and private keys. This is the full list of parameters:
Most sslKeys commands return name/value pairs of statistics about the premaster keys in memory. The statistics are listed in the following table.
Viewing Unencrypted Traffic
If packets are decrypted during the parse stage, encrypted packets are written to disk, and the matching premaster key used for decrypting is written to the tls.premaster meta key, analysts can view the unencrypted packets using the tls.premaster meta key.
One Decoder API that you can use to see the unencrypted packets is the /sdk/content RESTful service. You need to know the Session ID of the encrypted packets and the flags parameter masked to the value 128 (or 0x80 in hex). Point your browser to the Decoder RESTful interface and type in the following command, substituting the actual Session ID for <id>:
The Decoder returns a simple web page showing the packets after they are decrypted.
If you want to see what the packets look like encrypted, type in one of the following commands, substituting the Session ID for <id>:
For more information on the /sdk/content service, see the manual page for /sdk content.