Skip to content

Instantly share code, notes, and snippets.

@13Cubed
Last active March 2, 2017 16:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 13Cubed/27f496ef830c78ee0dcbbf9a3c47f32f to your computer and use it in GitHub Desktop.
Save 13Cubed/27f496ef830c78ee0dcbbf9a3c47f32f to your computer and use it in GitHub Desktop.
A Bash script to call tcpdump for DNS traffic capture.
#!/bin/bash
# Note: Do not run this script as root. You know better than that. Allow the standard user under which it runs the ability to execute /usr/sbin/tcpdump.
# Example: setcap 'CAP_NET_RAW+eip CAP_NET_ADMIN+eip' /usr/sbin/dumpcap
/usr/sbin/tcpdump -i [INTERFACE] -s0 -G 300 -w '/capture/dns_%Y-%m-%d_%H:%M:%S.pcap' 'port 53'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment