ncaptool(8)

✨ ncaptool(8) ✨

okay bestie, welcome to ncaptool β€” the network capture tool, manual section 8 πŸ’–


πŸŽ€ NAME πŸŽ€

ncaptool β€” Network capture library


🌸 SYNOPSIS 🌸

ncaptool [-h] [-d] [-m] [-f] [-r] [-w] [-v] [-S] [-e] [-i]
         [-b] [-p] [-n] [-l] [-g] [-o] [-s] [-c] [-t] [-1]
         [-2] [-k] [-Dmod] [-H]

like. that's the whole vibe in one block, no cap 🫢


πŸ¦‹ DESCRIPTION πŸ¦‹

so ncaptool is a network capture library β€” same energy as libpcap (which it's literally based on) and tcpdump. It produces binary data in its own ncap format, and that data can either live in a dump file or get yeeted over a UDP socket. πŸ“‘

but here's the twist: unlike libpcap, it discards data link headers and only supports IPv4 and IPv6 packets. however β€” and this is the slay part β€” it can perform reassembly of IP datagrams. iconic behavior fr fr πŸ‘‘


πŸ’… OPTIONS πŸ’…

  • -h β€” display this help text and exit (the "hi bestie, here's the menu" flag)
  • -d β€” increment debugging level
  • -m β€” increment message trace level
  • -f β€” flush outputs after every bufferable write
  • -r β€” destination of -s can be a remote (off-LAN) address
  • -w β€” use wallclock time not NCAP timestamp for -o files
  • -v β€” emit a traffic summary to stderr on exit
  • -S β€” stripe across all -s datasinks, round robin style πŸ”„
  • -e endline β€” specify continuation separator
  • -i ifname[+] β€” add interface as a datasource ('+' = promiscuous)
  • -b bpf β€” use this bpf pattern for any -i or -p datasources
  • -p file β€” add pcap file as a datasource ('-' = stdin)
  • -n file β€” add ncap file as a datasource ('-' = stdin)
  • -l socket β€” add datagram socket as a datasource (addr/port)
  • -g file β€” write msg trace to this file ('-' = stdout)
  • -o file β€” write ncap data to this file ('-' = stdout)
  • -s so[,r[,f]] β€” add this datagram socket as a datasink (addr/port) (optional ,r is the transmit rate in messages/sec) (optional ,f is schedule frequency, default is 100)
  • -c count β€” stop or reopen after this many msgs are processed
  • -t interval β€” stop or reopen after this amount of time has passed
  • -1 [+-]value β€” replace, set (+), or clear (-) user1 to this value
  • -2 [+-]value β€” replace, set (+), or clear (-) user1 to this value
  • -k cmd β€” make -c, -t continuous, run cmd on each new file (cmd can be empty if you just want the continuity)
  • -D mod[,args] β€” add module
  • -H [sd] β€” hide source and/or destination IP addresses πŸ™ˆ

argument to -l and -s can be addr/port or addr/port..port (range)

πŸ’€ heads up bestie: -1 and -2 are listed in the original with the exact same wording β€” both say user1. not me fixing it, i'm keeping it verbatim, periodt. the manpage says what it says.

🌈 EXAMPLE 🌈

Common usage β€” the everyday, main-character pipeline:

$ ncaptool -t 3600 -k gzip -i enp9s0+ -o $FILE

and to inspect a compressed ncap file, run something like this:

$ zcat $FILE | ncaptool -n - -vmg -

lowkey satisfying when a pipe just works 😭✨


πŸ”₯ SEE ALSO πŸ”₯

ncap(3), tcpdump(8).


πŸ‘‘ AUTHOR πŸ‘‘

ncaptool was written by Internet Systems Consortium and Jan Andres <jandres@gmx.net>.

This manual page was written by Thiago Andrade Marques <thmarques@gmail.com> for the Debian project (but may be used by others).


okay that's the whole page, you ate that πŸ“ this was ncaptool version ncaptool-1.9.2, dated 26 Mar 2020, living in manual section ncaptool(8) β€” and that's on periodt, go capture some packets bestie πŸ’œπŸ§š