pktanon(1)

πŸ’– pktanon πŸ’–

okay so bestie, welcome to the pktanon manual page β€” that's section 1 of the manuals, the "run this in your shell" section, and trust me this one is a whole vibe πŸ¦‹


✨ NAME ✨

pktanon β€” profile-based traffic anonymizer πŸ’…


🌸 SYNOPSIS 🌸

pktanon [-c profile_file] input_file output_file
pktanon [options] [input_file] [output_file]

πŸŽ€ DESCRIPTION πŸŽ€

So like, pktanon is a generic framework for network traffic anonymization ✨ Its whole thing β€” its main character energy, if you will β€” is making it possible for people to actually share realistic network traces without doxxing everybody in them, by doing fine-grained, profile-based anonymization πŸ’–

And the way you steer it? anonymization profiles. Those profiles are literally where you define how the network traffic should be made anonymous, so you get to decide exactly how much information actually gets scrubbed πŸ‘‘

ngl the reason profiles are so iconic is that they make it super easy to adapt which info gets anonymized to different environments or local legislation. like, different place, different rules, same tool. slay 🌈


πŸ’… OPTIONS πŸ’…

Configuration 🫢

  • -c, --config <config_file> β€” the anonymization profile, aka the file that tells pktanon what to hide ✨

Input Parameters πŸ“

  • -s, --snaplen <number> β€” read the first snaplen bytes from each packet (works for both captures and files) β€” [default: 256]
  • -i, --interface <interface> β€” capture packets from this interface 🌸
  • -p, --no-promiscuous-mode β€” do not set the interface in promiscuous mode
  • -e, --pcap-filter <filter> β€” filter specification for libpcap
  • -r, --use-raw-sockets β€” use linux raw sockets instead of libpcap (heads up: the -e option is not available when you do this 😭)

Output Parameters 🌈

  • -U, --packet-buffered β€” output (to file) is flushed every N packets
  • -n, --network <interface> β€” send packets to <interface> using libpcap-inject β€” ⚠️ EXPERIMENTAL, bestie, you've been warned
  • -o, --socket <Addr:Port> β€” send packets to Addr:Port using sockets

(if '--socket' option is set:) πŸ”₯

  • -6, --use-ipv6 β€” Use IPv6
  • -u, --use-udp β€” Use UDP

Miscellaneous πŸ’œ

  • -l, --use-libpcap β€” use libpcap for file i/o
  • -h, --help, --usage β€” print this message and exit πŸ‘‹
  • -q, --quiet β€” Reduce output 🀫
  • -v, --verbose β€” Increase output πŸ—£οΈ

🧚 RUNNING PKTANON 🧚

okay so first thing's first: PktAnon needs a configuration file. periodt. πŸ’…

Sample configuration files live in the profiles directory in the distribution β€” and that same directory also includes a sample network trace, so you can play immediately πŸŽ€

Two of the included configuration files are profile-identity.xml and profile.xml:

  • the first one copies all the fields from original packets into anonymized packets, except that the packets content is cropped βœ‚οΈ
  • the second one anonymizes mac addresses, ip addresses, and ports in the packets πŸ”

To anonymize the sample trace using the sample configuration files, run:

pktanon -c /usr/share/doc/pktanon/examples/profiles/profile-identity.xml profiles/sample.pcap out.pcap

or

pktanon -c /usr/share/doc/pktanon/examples/profiles/identity.xml profiles/sample.pcap out.pcap

The output should look like this:

-----------------------------------------------
pktanon --- profile-based traffic anonymization
-----------------------------------------------
initializing PktAnon,  configuration =  /usr/share/doc/pktanon/examples/profiles/profile-identity.xml
istream: opened file profiles/sample.pcap
ostream: opened output file out.pcap
initialized
complete

statistics for input file 'profiles/sample.pcap'
  processed packets: 9
  errors in packets: 0
  elapsed time:      22us
  Mpps:              0.409

The anonymized trace out.pcap will be created in the root directory of the distribution πŸ“

🚨 bestie listen β€” if the output file already exists, it will be trimmed and rewritten without any warning πŸ’€ no prompt, no vibe check, nothing. know that before you run it, fr fr.

that's it, that's the page 🫢 this was the pktanon entry from the section 1 manuals β€” version 2~git20240314.84e136f..., dated 16 March 2026. go forth and anonymize responsibly, icon πŸ’–βœ¨

πŸ“¦ where this page comes from