Page 1 of 1

Ehtereal filter

Posted: 20. Aug 2008 12:22
by Schuffeler
Hallo,

ich mache gerade meine ersten Gehversuche mit etherreal, scheitere aber an meinem ersten Filter.

Ich würde gerne den Verkehr zu zwei bestimmten IP Adressen verfolgen, aber eben den Broadcast rausfiltern und das klappt nicht

meine Filter:

ip.addr == 192.168.10.2 || ip.addr == 192.168.10.2 && ip.addr != 192.168.10.255

Leider sehe ich trotzdem broadcast Anfrage en masse.

Nehme ich:

ip.addr == 192.168.10.2 || ip.addr == 192.168.10.2 && !(ip.addr == 192.168.10.255)

sehe ich gar nichts, obwohl definitv mindestens eine Verbindung zu einer der besagten Adressen besteht. eth.addr == ff:ff:ff:ff:ff:ff tut statt der 10.255 auch nichts.

Vermutlich habe ich einen Denkfehler in der Verkettung, mir geht nur gerade nicht auf, wo


Gewünscht ist eigentlich:

Zeige allen IP Verkehr von und zu den Adressen 192.168.10.2/3, aber blende die Pakete aus, die an die Broadcastadresse gehen, egal woher

Posted: 20. Aug 2008 12:29
by Schuffeler
Vielleicht sollte ich erwähnen, daß ethereal auf einem anderen Rechner läuft, der selber nicht mit überwacht werden soll, aber im gleichen Subnetz sitzt.

Posted: 22. Aug 2008 3:46
by komsomolze
Aus wireshark-filter.html, eigentlich allgemein, paßt aber hier auch speziell:
A special caveat must be given regarding fields that occur more than once
per packet. "ip.addr" occurs twice per IP packet, once for the source
address, and once for the destination address. Likewise, "tr.rif.ring"
fields can occur more than once per packet. The following two expressions
are not equivalent:

ip.addr ne 192.168.4.1
not ip.addr eq 192.168.4.1


The first filter says "show me packets where an ip.addr exists that does
not equal 192.168.4.1". That is, as long as one ip.addr in the packet does
not equal 192.168.4.1, the packet passes the display filter. The other
ip.addr could equal 192.168.4.1 and the packet would still be displayed.
The second filter says "don't show me any packets that have an ip.addr
field equal to 192.168.4.1". If one ip.addr is 192.168.4.1, the packet
does not pass. If neither ip.addr field is 192.168.4.1, then the packet is
displayed.


It is easy to think of the 'ne' and 'eq' operators as having an implict
"exists" modifier when dealing with multiply-recurring fields. "ip.addr ne
192.168.4.1" can be thought of as "there exists an ip.addr that does not
equal 192.168.4.1". "not ip.addr eq 192.168.4.1" can be thought of as
"there does not exist an ip.addr equal to 192.168.4.1".

Be careful with multiply-recurring fields; they can be confusing.

Care must also be taken when using the display filter to remove noise from
the packet trace. If, for example, you want to filter out all IP multicast
packets to address 224.1.2.3, then using:

ip.dst ne 224.1.2.3

may be too restrictive. Filtering with "ip.dst" selects only those IP
packets that satisfy the rule. Any other packets, including all non-IP
packets, will not be displayed. To display the non-IP packets as well, you
can use one of the following two expressions:

not ip or ip.dst ne 224.1.2.3
not ip.addr eq 224.1.2.3

The first filter uses "not ip" to include all non-IP packets and then lets
"ip.dst ne 224.1.2.3" filter out the unwanted IP packets. The second
filter has already been explained above where filtering with multiply
occuring fields was discussed.
Also ist
!(ip.addr == 192.168.10.255)
das gewünschte, statt
ip.addr != 192.168.10.255.

Auch könnte das Format
A || B && C
ein Problem sein.
Ich versuche Gruppierung:

Code: Select all

(ip.addr == 192.168.10.2 || ip.addr == 192.168.10.3) && not ip.addr == 192.168.10.255

Posted: 26. Aug 2008 10:52
by Schuffeler
Vielen Dank, aber das Problem liegt wo anders: Da es sich um ein geschaltetes Netzwerk handelt, kann ich den Verkehr der anderen Rechner natürlich nicht ohne weiteres mithören.

Posted: 26. Aug 2008 16:49
by Janka
Doch. Man kann den ARP-Cache des Switches mit zu vielen ARP-Anforderungen zum Überlaufen bringen, danach gibt der Switch an dem entsprechenden Port oder sogar an allen Ports alles aus.

Janka