blob: 8c51722651d225f6df5e776c90384e8bbe095953 [file] [log] [blame]
Adrian Lopezd496d5c2016-08-16 17:49:49 +02001Demonstrations of sslsniff.py
2
3
jeromemarchand8b17dc32018-08-04 07:09:36 +02004This tool traces the write/send and read/recv functions of OpenSSL,
5GnuTLS and NSS. Data passed to this functions is printed as plain
6text. Useful, for example, to sniff HTTP before encrypted with SSL.
Adrian Lopezd496d5c2016-08-16 17:49:49 +02007
8
9Output of tool executing in other shell "curl https://example.com"
10
11% sudo python sslsniff.py
12FUNC TIME(s) COMM PID LEN
jeromemarchand8b17dc32018-08-04 07:09:36 +020013WRITE/SEND 0.000000000 curl 12915 75
Adrian Lopezd496d5c2016-08-16 17:49:49 +020014----- DATA -----
15GET / HTTP/1.1
16Host: example.com
17User-Agent: curl/7.50.1
18Accept: */*
19
20
21----- END DATA -----
22
jeromemarchand8b17dc32018-08-04 07:09:36 +020023READ/RECV 0.127144585 curl 12915 333
Adrian Lopezd496d5c2016-08-16 17:49:49 +020024----- DATA -----
25HTTP/1.1 200 OK
26Cache-Control: max-age=604800
27Content-Type: text/html
28Date: Tue, 16 Aug 2016 15:42:12 GMT
29Etag: "359670651+gzip+ident"
30Expires: Tue, 23 Aug 2016 15:42:12 GMT
31Last-Modified: Fri, 09 Aug 2013 23:54:35 GMT
32Server: ECS (iad/18CB)
33Vary: Accept-Encoding
34X-Cache: HIT
35x-ec-custom-error: 1
36Content-Length: 1270
37
38
39----- END DATA -----
40
jeromemarchand8b17dc32018-08-04 07:09:36 +020041READ/RECV 0.129967972 curl 12915 1270
Adrian Lopezd496d5c2016-08-16 17:49:49 +020042----- DATA -----
43<!doctype html>
44<html>
45<head>
46 <title>Example Domain</title>
47
48 <meta charset="utf-8" />
49 <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
50 <meta name="viewport" content="width=device-width, initial-scale=1" />
51 <style type="text/css">
52 body {
53 background-color: #f0f0f2;
54 margin: 0;
55 padding: 0;
56 font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
57
58 }
59 div {
60 w
61----- END DATA (TRUNCATED, 798 bytes lost) -----
Adrian Lopezd9cc3de2016-08-17 14:08:08 +020062
63
64
65
66USAGE message:
67
jeromemarchand8b17dc32018-08-04 07:09:36 +020068usage: sslsniff.py [-h] [-p PID] [-c COMM] [-o] [-g] [-n] [-d]
Adrian Lopezd9cc3de2016-08-17 14:08:08 +020069
70Sniff SSL data
71
72optional arguments:
73 -h, --help show this help message and exit
74 -p PID, --pid PID sniff this PID only.
75 -c COMM, --comm COMM sniff only commands matching string.
76 -o, --no-openssl do not show OpenSSL calls.
77 -g, --no-gnutls do not show GnuTLS calls.
jeromemarchand8b17dc32018-08-04 07:09:36 +020078 -n, --no-nss do not show NSS calls.
Adrian Lopezd9cc3de2016-08-17 14:08:08 +020079 -d, --debug debug mode.
80
81examples:
82 ./sslsniff # sniff OpenSSL and GnuTLS functions
83 ./sslsniff -p 181 # sniff PID 181 only
84 ./sslsniff -c curl # sniff curl command only
85 ./sslsniff --no-openssl # don't show OpenSSL calls
86 ./sslsniff --no-gnutls # don't show GnuTLS calls
jeromemarchand8b17dc32018-08-04 07:09:36 +020087 ./sslsniff --no-nss # don't show NSS calls