diff --git a/modules/wlan_recon.go b/modules/wlan_recon.go index f002253e..010d4317 100644 --- a/modules/wlan_recon.go +++ b/modules/wlan_recon.go @@ -11,6 +11,7 @@ import ( "time" "github.com/evilsocket/bettercap-ng/core" + "github.com/evilsocket/bettercap-ng/network" "github.com/evilsocket/bettercap-ng/session" "github.com/google/gopacket" @@ -20,12 +21,6 @@ import ( "github.com/olekukonko/tablewriter" ) -const IPV4_MULTICAST_ADDR_START = "01:00:5e:00:00:00" -const IPV4_MULTICAST_ADDR_END = "01:00:5e:7f:ff:ff" -const BROADCAST_MAC = "ff:ff:ff:ff:ff:ff" - -const MAC48Validator = "((?:[0-9A-Fa-f]{2}[:-]){5}(?:[0-9A-Fa-f]{2}))" - type WDiscovery struct { session.SessionModule Stations *WiFi @@ -357,7 +352,7 @@ func (w *WDiscovery) Configure() error { var err error w.Stations = NewWiFi(w.Session, w.Session.Interface) - w.BroadcastMac, _ = net.ParseMAC(BROADCAST_MAC) + w.BroadcastMac, _ = net.ParseMAC(network.BroadcastMac) inactive, err := pcap.NewInactiveHandle(w.Session.Interface.Name()) defer inactive.CleanUp() diff --git a/network/net.go b/network/net.go index 1afabc5f..79c6b897 100644 --- a/network/net.go +++ b/network/net.go @@ -10,7 +10,12 @@ import ( "github.com/evilsocket/bettercap-ng/core" ) -const MonitorModeAddress = "0.0.0.0" +const ( + MonitorModeAddress = "0.0.0.0" + BroadcastMac = "ff:ff:ff:ff:ff:ff" + IPv4MulticastStart = "01:00:5e:00:00:00" + IPv4MulticastEnd = "01:00:5e:7f:ff:ff" +) var ( IPv4Validator = regexp.MustCompile("^[0-9\\.]+/?\\d*$")