Created
September 11, 2015 16:36
-
-
Save nl5887/33e1347ac7424b49a757 to your computer and use it in GitHub Desktop.
grapviz tcpdump
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tcpdump -nnt -r ~/Downloads/packets-758949d7-b01e-4c91-8792-90653d72be5d.pcap port not ssh and tcp > /tmp/b.txt | |
make |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
LAYOUT=circo | |
SOURCES = $(wildcard *.dot) | |
TARGETS = $(SOURCES:.dot=.svg) | |
%.svg:%.dot | |
dot -Tsvg -K${LAYOUT} "$^" -o "$@" | |
all: $(TARGETS) | |
clean: | |
rm -f $(TARGETS) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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