mirror of
https://github.com/bettercap/bettercap
synced 2025-08-19 21:13:18 -07:00
wifi module: fix on beacon parsing and multiple channel selection
This commit is contained in:
parent
582e1ae81e
commit
4726c2fc9d
4 changed files with 105 additions and 22 deletions
|
@ -126,3 +126,20 @@ func Dot11IsDataFor(dot11 *layers.Dot11, station net.HardwareAddr) bool {
|
|||
// packet going to this specific BSSID?
|
||||
return bytes.Compare(dot11.Address1, station) == 0
|
||||
}
|
||||
|
||||
func Dot11ParseDSSet(packet gopacket.Packet) (bool, int) {
|
||||
channel := 0
|
||||
found := false
|
||||
for _, layer := range packet.Layers() {
|
||||
info, ok := layer.(*layers.Dot11InformationElement)
|
||||
if ok == true {
|
||||
if info.ID == layers.Dot11InformationElementIDDSSet {
|
||||
channel, _ = Dot11InformationElementIDDSSetDecode(info.Info)
|
||||
found = true
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return found, channel
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue