scapy icon indicating copy to clipboard operation
scapy copied to clipboard

Incorrect values in Dot11FCS

Open ash09 opened this issue 7 years ago • 3 comments

Brief description

This bug has already been reported previously #1811 but I'm still getting the same problem with management frames with subtype 10.

addr3 and fcs are incorrect.

Environment

  • Scapy version: 2.4.2.dev186
  • Python version: 3.5.3
  • Operating System: Debian 9

How to reproduce

payload = b'\x00\x00 \x00\xae@\x00\xa0 \x08\x00\xa0 \x08\x00\x00\x10\x02\x85\t\xa0\x00\xe2\x00d\x00\x00\x00\x00\x00\x00\x01\xa0@:\x01\x00\xc0\xca\xa4}PLfA\xac\xe4\xb3\x00\xc04\xeb\xca\xa4}P\x00 \x08 \x00\x00\x00\x00\x0f)\x1d\xd4\xd49\x00\x03\x1f>'
RadioTap(payload)[Dot11FCS].show()

Actual result

###[ 802.11-FCS ]### 
  subtype   = 10
  type      = Management
  proto     = 0
  FCfield   = protected
  ID        = 14849
  addr1     = 00:c0:ca:a4:7d:50
  addr2     = 4c:66:41:ac:e4:b3
  addr3     = 00:c0:34:eb:ca:a4
  SC        = 20605
  fcs       = 0x3e1f0300
###[ 802.11 TKIP packet ]### 
     iv        = '\x00 \x08 '

Expected result

image

ash09 avatar Mar 01 '19 10:03 ash09

Hi & thanks for the report, Sorry but I cannot reproduce.

The following starts wireshark without parsing the packet: raw data is directly sent without scapy interfering

>>> payload = b'\x00\x00 \x00\xae@\x00\xa0 \x08\x00\xa0 \x08\x00\x00\x10\x02\x85\t\xa0\x00\xe2\x00d\x00\x00\x00\x00\x00
...: \x00\x01\xa0@:\x01\x00\xc0\xca\xa4}PLfA\xac\xe4\xb3\x00\xc04\xeb\xca\xa4}P\x00 \x08 \x00\x00\x00\x00\x0f)\x1d\xd4\
...: xd49\x00\x03\x1f>'
>>> wireshark(Raw(payload), linktype=DLT_IEEE802_11_RADIO)
>>>

image

Are you studying the same packet ?

gpotter2 avatar Mar 01 '19 14:03 gpotter2

The payload is actually something that was printed in the terminal while sniffing from a raw socket as follows: payload = raw(RadioTap(payload_from_socket))

Opening the payload in wireshark gives me the same output as you.

The original payload that I got from Wireshark is w_payload.
disas_pkt.zip

In [24]: w_payload = hex_bytes('00002000ae4000a0200800a02008000010028509a000e2006400000000000001a0403a0100c0caa47d504c6641ace4b300c0caa47d50000300200820000000000f291dd4d4391f3e34eb')
In [25]:  raw(RadioTap(w_payload)) == w_payload
Out[25]: False

ash09 avatar Mar 01 '19 15:03 ash09

Thanks a lot for your help ! I was able to reproduce, it should be fixed in https://github.com/secdev/scapy/pull/1884

Could you please try it out ? Thanks !

gpotter2 avatar Mar 04 '19 21:03 gpotter2