Visualização de pacotes capturados (e filtrados) remotamente com o tcpdump através de uma ligação segura por ssh no wireshark numa máquina local

Por eduardo

ssh lxc_web3 '/usr/sbin/tcpdump -K -U -n -w - -ni eth1 -s 65535 not port 22 and not port 443 and not port 53 and not icmp and not port 80 and not arp and not stp and not port 137 and not igmp and not ip6 and not port 138 and not port 587 and not udp and host 10.116.102.11' | wireshark -k -i -

Utilizar o wireshark e o etherape com captura remota no debian

Por eduardo

é 1:45 e eu aqui fo**** porque o raio do comando não funciona!
ssh -p 2222 -i ~/.ssh/routers/id_dsa root@localhost “tcpdump -K -U -n -w – -i eth0.2 not port 22″ | wireshark -k -i -

mas este já rula!
é preciso ter olho pra coisa:
ssh -p 2222 -i ~/.ssh/routers/id_dsa root@localhost '/usr/sbin/tcpdump -s 100 -K -U -n -w - -i eth0.2 not port 22' | wireshark -k -i -

para o etherape:

Wireshark como utilizador normal no debian

Por eduardo

permitir a captura por parte dos utilizadores do grupo wireshark:
dpkg-reconfigure wireshark-common
e escolher a opção "yes".
adicionar o utilizador ao grupo wireshark:
usermod -a -G wireshark utilizador

ver em /usr/share/doc/wireshark-common/README.Debian

http://wiki.wireshark.org/CaptureSetup/CapturePrivileges

https://blog.wireshark.org/2010/02/running-wireshark-as-you/