Skip to content

Instantly share code, notes, and snippets.

@nl5887
Created September 11, 2015 16:36
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save nl5887/33e1347ac7424b49a757 to your computer and use it in GitHub Desktop.
Save nl5887/33e1347ac7424b49a757 to your computer and use it in GitHub Desktop.
grapviz tcpdump
tcpdump -nnt -r ~/Downloads/packets-758949d7-b01e-4c91-8792-90653d72be5d.pcap port not ssh and tcp > /tmp/b.txt
make
LAYOUT=circo
SOURCES = $(wildcard *.dot)
TARGETS = $(SOURCES:.dot=.svg)
%.svg:%.dot
dot -Tsvg -K${LAYOUT} "$^" -o "$@"
all: $(TARGETS)
clean:
rm -f $(TARGETS)
grep -E "IP\ " /tmp/b.txt | awk ' BEGIN { e="(([0-9]{1,3}.){3})([0-9]{1,3}).*" }
{
printf "\"%s\" -> \"%s\";\n", gensub(e, "\\1\\3", "1", $2), gensub(e, "\\1\\3", "1", $4)
}' >> /tmp/b.txt2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment