sslsniff(8)

πŸ“¦ version 0.36.1, in centos-stream 10, centos-stream 9, fedora 43, fedora 44

✨ sslsniff(8) · System Manager's Manual ✨

πŸ’– NAME

okay so sslsniff is the tool that prints data passed to OpenSSL, GnuTLS or NSS πŸ” and it runs on Linux eBPF/bcc 🧚

πŸŽ€ SYNOPSIS

sslsniff [-h] [-p PID] [-u UID] [-x] [-c COMM] [-o] [-g] [-n] [-d]
[--hexdump] [--max-buffer-size SIZE] [-l] [--handshake] [--extra-lib
EXTRA_LIB]

πŸ¦‹ DESCRIPTION

bestie, this one is iconic πŸ’… sslsniff prints the data that gets sent through the write/send and read/recv functions of OpenSSL, GnuTLS and NSS. That means you can see the plain text before it gets encrypted (when writing) and after it gets decrypted (when reading) πŸ‘€βœ¨

It works by reading the second parameter of both functions, which is *buf. 🫢

⚠️ Since this uses BPF, only the root user can run this tool. No exceptions, sorry babe πŸ’€

🌸 REQUIREMENTS

You need CONFIG_BPF and bcc πŸ”§

πŸ’œ OPTIONS

  • -h β€” the vibe check option πŸ™ˆ prints the usage message
  • -p PID β€” only traces functions inside this process PID 🎯
  • -u UID β€” only shows calls made by this UID πŸ‘‘
  • -x β€” shows the extra fields: UID and TID ✨
  • -c COMM β€” only shows processes whose COMM matches exactly, no fuzzy stuff πŸ“
  • -o, --no-openssl β€” skips tracing OpenSSL functions πŸ™…β€β™€οΈ
  • -g, --no-gnutls β€” skips tracing GnuTLS functions πŸ™…β€β™€οΈ
  • -n, --no-nss β€” also skips tracing GnuTLS functions πŸ€”
πŸ™ˆ Heads up: the original page says -n/--no-nss skips GnuTLS functions, which looks like a typo since NSS is the library it's named after. I'm just passing along what the page says, so double-check before you rely on it.
  • --hexdump β€” shows the data as a hexdump instead of trying to decode it as UTF-8 🧾
  • --max-buffer-size SIZE β€” sets the max buffer size for intercepted data. Anything longer gets truncated βœ‚οΈ The default is 8 Kib, and the max possible value is a bit less than 32 Kib πŸ“
  • -l, --latency β€” shows function latency in ms ⏱️
  • --handshake β€” shows handshake latency, but it only works if the latency option is on 🀝
  • --extra-lib EXTRA_LIB β€” the library type and the library path, separated by a colon 🧩 Supported library types are openssl, gnutls and nss. You can use this more than once, so go wild 🌈

🧚 EXAMPLES

Print all calls to SSL write/send and read/recv system-wide:

# sslsniff

Print only OpenSSL calls issued by user with UID 1000:

# sslsniff -u 1000 --no-nss --no-gnutls

Print SSL handshake event and latency for all traced functions:

# sslsniff -l --handshake

Print only calls to OpenSSL from /some/path/libssl.so:

sslsniff --no-openssl --no-gnutls --no-nss --extra-lib
openssl:/some/path/libssl.so

πŸ” FIELDS

  • FUNC β€” which function is being called (write/send or read/recv) πŸ“€πŸ“₯
  • TIME β€” the time of the command, in seconds ⏰
  • COMM β€” the entered command πŸ’¬
  • PID β€” the process ID calling SSL πŸ†”
  • LEN β€” bytes written or read by SSL functions πŸ“¦
  • UID β€” the UID of the process, only shown if you launch with -x πŸ‘‘
  • TID β€” the thread ID, only shown if you launch with -x 🧡
  • LAT(ms) β€” function latency in ms πŸ’¨

🌈 SOURCE

This comes from bcc, bestie 🫢

https://github.com/iovisor/bcc

Also check the bcc distribution for a companion _examples.txt file. It has example usage, output and commentary for this tool πŸ“š

πŸ–₯️ OS

Linux 🐧

πŸ§ͺ STABILITY

Unstable, it's still in development 🚧

πŸ‘©β€πŸ’» AUTHORS

Adrian Lopez and Mark Drayton 🌟

πŸ”— SEE ALSO

trace(8) πŸ¦‹


Okay that's the whole tea πŸ«– This page came from bcc, dated 2016-08-16, in the USER COMMANDS section. Go forth and sniff responsibly, bestie πŸ’–πŸ§šβœ¨

πŸ“¦ where this page comes from