Содержание

Wireshark

Capture Filters

Источник: Wireshark Capture Filters

Настройки Capture Filters задаются при запуске и применяются на выбранном сетевом интерфейсе.

Фильтр Описание
host 172.18.5.4 Захватывать трафик на и с IP-адреса 172.18.5.4
net 192.168.0.0/24 Захватывать трафик из/в диапазон IP адресов
net 192.168.0.0 mask 255.255.255.0 То же самое, использование маски

Capture traffic from a range of IPs

Capture traffic to a range of IPs


Capture only DNS traffic

port 53

Capture non-HTTP and non-SMTP for a specific host

Оба варианта эквивалентны:


Exclude ARP and DNS

port not 53 and not arp

Capture traffic within port range

Старый вариант:

(tcp[0:2] > 1500 and tcp[0:2] < 1550) or (tcp[2:2] > 1500 and tcp[2:2] < 1550)

Новый вариант (libpcap >= 0.9.1):

tcp portrange 1501-1549

Capture only Ethernet type EAPOL

ether proto 0x888e

Reject LLDP multicast

not ether dst 01:80:c2:00:00:0e

Capture only IPv4

ip

Полезно для отсеивания ARP/STP.


Capture only unicast

not broadcast and not multicast

Capture IPv6 all-nodes traffic

Используется для поиска rogue RA:

dst host ff02::1


Capture HTTP GET requests

Отбор по сигнатуре GET :

port 80 and tcp[((tcp[12:1] & 0xf0) >> 2):4] = 0x47455420

Useful Filters

Blaster worm

dst port 135 and tcp port 135 and ip[2:2]==48

Welchia worm

icmp[icmptype]==icmp-echo and ip[2:2]==92 and icmp[8:4]==0xAAAAAAAA

Описание: Фильтр ищет ICMP Echo длиной 92 байта с первым 4-байтовым payload AAAAAAAA.


Generic worm SYN scanner (ports 135/445/1433)

dst port 135 or dst port 445 or dst port 1433 and tcp[tcpflags] & (tcp-syn) != 0 and tcp[tcpflags] & (tcp-ack) = 0 and src net 192.168.0.0/24

Heartbleed Exploit

%%tcp src port 443 and (tcp[((tcp[12] & 0xF0) >> 4 ) * 4] = 0x18) and (tcp[((tcp[12] & 0xF0) >> 4 ) * 4 + 1] = 0x03) and (tcp[((tcp[12] & 0xF0) >> 4 ) * 4 + 2] < 0x04) and ((ip[2:2] - 4 * (ip[0] & 0x0F)  - 4 * ((tcp[12] & 0xF0) >> 4) > 69))%%

Default Capture Filters

Wireshark определяет, запущен ли он удалённо (SSH, RDP) и применяет фильтр для сокрытия трафика удалённой сессии.

Переменная окружения Применяемый фильтр
SSH_CONNECTION not (tcp port srcport and addr_family host srchost and tcp port dstport and addr_family host dsthost)
SSH_CLIENT not (tcp port srcport and addr_family host srchost and tcp port dstport)
REMOTEHOST not addr_family host host
DISPLAY not addr_family host host
CLIENTNAME not tcp port 3389