kaitoy / pcap4j

A Java library for capturing, crafting, and sending packets.
https://www.pcap4j.org/
Other
1.16k stars 309 forks source link

Get specific fields of beacons #139

Closed alchimia closed 6 years ago

alchimia commented 6 years ago

Hi,

I'm currently using ReadPacketFile.java , i need for example this field. How can i parse it? Here you can find my test pcap file.

Thank you!

kaitoy commented 6 years ago

Could you show what ReadPacketFile print for the packet?

alchimia commented 6 years ago

This:

PACCHETTO NUMERO: 3940

2017-11-23 15:51:42.804325 [Radiotap header (18 bytes)] Version: 0 Pad: 0 Length: 18 Present Bitmask (2e 48 00 00): Present Fields: 1 (Flags) 2 (Rate) 3 (Channel) 5 (Antenna signal) 11 (Antenna) 14 (RX flags) Radiotap NS Next: false Vendor NS Next: false Another Bitmap Follows: false Data Fields: Flags: CFP: false Short Preamble: false WEP: false Fragmented: false FCS: false PAD: false Bad FCS: false Short Guard Interval: false Rate: Rate: 11000 Kbps Channel: Frequency: 2412 MHz LSB of flags: false 2nd LSB of flags: false 3rd LSB of flags: false 4th LSB of flags: false Turbo: false CCK: true OFDM: false 2 GHz spectrum: true 5 GHz spectrum: false Only passive scan: false Dynamic CCK-OFDM: false GFSK: false GSM: false Static Turbo: false Half rate: false Quarter rate: false Antenna signal: Antenna signal: -75 dBm Antenna: Antenna: 1 RX flags: LSB: false Bad PLCP CRC: false 3rd LSB: false 4th LSB: false 5th LSB: false 6th LSB: false 7th LSB: false 8th LSB: false 9th LSB: false 10th LSB: false 11th LSB: false 12th LSB: false 13th LSB: false 14th LSB: false 15th LSB: false 16th LSB: false [data (322 bytes)] Hex stream: 80 00 00 00 ff ff ff ff ff ff f4 7f 35 99 48 b2 f4 7f 35 99 48 b2 80 a6 8a c1 01 da 30 00 00 00 66 00 31 14 00 07 54 55 54 2d 57 50 41 01 07 96 18 24 30 48 60 6c 03 01 01 05 07 00 01 00 00 00 00 00 07 06 46 49 20 01 0d 14 0b 05 03 00 18 8d 5b 2a 01 00 2d 1a 2c 18 1b fe ff 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 30 14 01 00 00 0f ac 02 01 00 00 0f ac 04 01 00 00 0f ac 01 28 00 3d 16 01 08 04 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 7f 06 00 10 00 00 00 40 85 1e 04 00 8f 00 0f 00 ff 03 59 00 74 74 2e 77 61 70 2d 33 64 00 00 00 00 00 00 00 03 00 00 36 96 06 00 40 96 00 0b 00 dd 1c 00 50 f2 01 01 00 00 50 f2 02 02 00 00 50 f2 02 00 50 f2 04 01 00 00 50 f2 01 00 00 dd 18 00 50 f2 02 01 01 80 00 03 a4 00 00 27 a4 00 00 42 43 5e 00 62 32 2f 00 dd 06 00 40 96 01 01 04 dd 05 00 40 96 03 05 dd 05 00 40 96 0b 09 dd 05 00 40 96 14 01 dd 1d 00 40 96 0c 03 82 d8 13 76 a4 dc 5f 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

kaitoy commented 6 years ago

Currently Pcap4J supports only probe request. You need to write packet classes to parse your beacon packets. Dot11ProbeRequestPacket class (and relevant classes) would be a good sample to refer to when you write them.