summaryrefslogtreecommitdiff
path: root/doc/note/tcpdump/tcpdump.txt
diff options
context:
space:
mode:
authorAndreas Fankhauser hiddenalpha.ch2024-05-12 12:55:07 +0200
committerAndreas Fankhauser hiddenalpha.ch2024-05-12 12:55:07 +0200
commit5cc4c2b95df9bf6998d92496ca0e0064314fba39 (patch)
treeac7d979f81a86703508ff23e2694a6b4d6bfe4d5 /doc/note/tcpdump/tcpdump.txt
parent1dc9f8c9db499a326ceee6cb3b48878ee17ff9fa (diff)
parent95d934e8e3918832c03f05b2fc32cb5d5272cb83 (diff)
downloadUnspecifiedGarbage-5cc4c2b95df9bf6998d92496ca0e0064314fba39.zip
UnspecifiedGarbage-5cc4c2b95df9bf6998d92496ca0e0064314fba39.tar.gz
Merge remote-tracking branch 'ha-public/master' into wip-LatitudeReSetup-20230620wip-LatitudeReSetup-20230620
Diffstat (limited to 'doc/note/tcpdump/tcpdump.txt')
-rw-r--r--doc/note/tcpdump/tcpdump.txt26
1 files changed, 25 insertions, 1 deletions
diff --git a/doc/note/tcpdump/tcpdump.txt b/doc/note/tcpdump/tcpdump.txt
index 9c9feb6..71ffb02 100644
--- a/doc/note/tcpdump/tcpdump.txt
+++ b/doc/note/tcpdump/tcpdump.txt
@@ -16,8 +16,13 @@ Tcpdump
redis=6379, brox=7022, fluentd=7099
- cd /tmp && timeout --foreground -s INT 180 tcpdump -ni any -C 50M -W 999 -w houston-STAGE-tcp-`date -u +%Y%m%d-%H%M%S`.pcap "not port 443 and not port 6379 and not port 7022 and not port 7099" -z gzip
+ cd /usr/local/vertx/houston-storage-file && timeout --foreground -s INT 180 tcpdump -ni any -C 50M -W 999 -w houston-STAGE-tcp-`date -u +%Y%m%d-%H%M%S`.pcap "not port 443 and not port 6379 and not port 7022 and not port 7099" -z gzip
+ cd /tmp && timeout --foreground -s INT 180 tcpdump -ni any -C 50M -W 999 -w houston-prod-tcp-`date -u +%Y%m%d-%H%M%S`.pcap "not port 443 and not port 6379 and not port 7022 and not port 7099" -z gzip
+
+ ocprod exec -i "$(ocprod get pods|egrep ston-[1-9]|cut -f1 -d' ')" -- sh -c 'cd /tmp && tar c "houston-prod-tcp-20231114-165243.pcap*.gz"' > houston-prod-tcp-20231114-165243.pcap.gz.tar
+
+ ocprod exec -ti "$(ocprod get pods|egrep ston-[1-9]|cut -f1 -d' ')" -- sh -c 'cd /tmp && watch ls -Ahl'
## pcap cli PreProcessing
@@ -31,6 +36,11 @@ Tips: "https://chrissanders.org/2018/06/large-captures4-filter-whittling/"
+## Local dumps isa-only filter
+
+ "portrange 6000-9999 and not port 7778"
+
+
## Accept HTTP POST requests:
"tcp[((tcp[12:1] & 0xf0) >> 2):4] = 0x504F5354"
@@ -52,6 +62,15 @@ Tips: "https://chrissanders.org/2018/06/large-captures4-filter-whittling/"
"net 172.18.0.0/16"
+## Filter kube-probes "GET /houston/server/info" or '{"name":"houston",'
+
+ tcpdump -nni any -w /tmp/houston-${PAISA_ENV:?}-tcp-$(date -u +%Y%m%d-%H%M%SZ)-%s.pcap -C 8M -W 99 -G 600 "(tcp[((tcp[12:1]&0xf0)>>2)+0:4] = 0x47455420 && tcp[((tcp[12:1]&0xf0)>>2)+4:4] = 0x2F686F75 && tcp[((tcp[12:1]&0xf0)>>2)+8:4] = 0x73746F6E && tcp[((tcp[12:1]&0xf0)>>2)+12:4] = 0x2F736572 && tcp[((tcp[12:1]&0xf0)>>2)+16:4] = 0x7665722F && tcp[((tcp[12:1]&0xf0)>>2)+20:4] = 0x696E666F && tcp[((tcp[12:1]&0xf0)>>2)+24:1] = 0x20) or (tcp[((tcp[12:1]&0xf0)>>2)+115:4] = 0x7B226E61 && tcp[((tcp[12:1]&0xf0)>>2)+119:4] = 0x6D65223A && tcp[((tcp[12:1]&0xf0)>>2)+123:4] = 0x22686F75 && tcp[((tcp[12:1]&0xf0)>>2)+127:4] = 0x73746F6E && tcp[((tcp[12:1]&0xf0)>>2)+131:2] = 0x222C)"
+
+
+## Try dump kube-probes fully
+
+ timeout --foreground 900 tcpdump -nni any -w /tmp/houston-${PAISA_ENV:?}-tcp-$(date -u +%Y%m%d-%H%M%SZ)-%s.pcap -C 42M -W 42 -G 600 "host 10.127.73.1 and port 7012"
+
## Extract hosts file from DNS traffic
@@ -61,3 +80,8 @@ Not perfect because needs manual fine-tuning. But can be helpful anyway.
Vielleicht auch mal option "-zhosts" ausprobieren. Sollte auch sowas tun.
+
+[man tcpdump](https://www.tcpdump.org/manpages/tcpdump.1.html)
+[no name port numbers rhel patch](https://superuser.com/a/587304/1123359)
+[complex filter by byte contents](https://security.stackexchange.com/a/121013/179017)
+