-
Notifications
You must be signed in to change notification settings - Fork 3
net debug
stanislaw_jakiel edited this page Dec 20, 2020
·
1 revision
Normally packets received must have destination MAC address equal to NIC's MAC address. Exceptions:
- Broadcast destination:
0xFFFFFFFFFFFF - Multicast destination: for IPv4
0x01....., for IPv60x3333....
Tool based on libpcap for packet capture. Traffic dumping takes place at specific points in time:
- Incoming traffic:
wire -> NIC -> tcpdump -> netfilter/iptables -> application - Outgoing traffic:
application -> iptables -> tcpdump -> NIC -> wire
Dump local traffic using tcpdump:
tcpdump -i eth0 -w /tmp/outfile.pcap host 1.1.1.1
Dump traffic on remote (eth0) host and visualize it locally with wireshark:
- Without access to
tcpdumpbinary on remotemkfifo /tmp/dump ssh user@remote "sudo tcpdump -s0 -U -n -w - -i eth0 'not port 22'" > /tmp/dump wireshark -k -i <(cat /tmp/dump) - Having user access to
tcpdumpbinary on remote, it is as simple as:
ssh -C user@remote "tcpdump -i any -s0 -U -w - host 1.2.3.4" | wireshark -k -i -
Ifsudois available remotely, perform:groupadd pcapusermod -a -G pcap $USERchgrp pcap /usr/sbin/tcpdumpchmod 750 /usr/sbin/tcpdumpsetcap cap_net_raw,cap_net_admin=eip /usr/sbin/tcpdump
- General
- OS
- Networks
- Configuration
- Protocols
- Link layer
- Sockets
- Routing
- Tunneling
- Debugging
- LoRa
- Virtualization
- Infrastructure as a code
- Desktop environments
- Monitoring
- Benchmarking