new: implemented wifi probes tracking (closes #78)

This commit is contained in:
evilsocket 2018-02-24 23:03:37 +01:00
commit ef172c1b01
2 changed files with 88 additions and 33 deletions

View file

@ -21,31 +21,41 @@ func (s EventsStream) viewLogEvent(e session.Event) {
e.Data.(session.LogMessage).Message)
}
func (s EventsStream) viewApEvent(e session.Event) {
ap := e.Data.(*network.AccessPoint)
vend := ""
if ap.Vendor != "" {
vend = fmt.Sprintf(" (%s)", ap.Vendor)
}
func (s EventsStream) viewWiFiEvent(e session.Event) {
if e.Tag == "wifi.ap.new" {
fmt.Printf("[%s] [%s] WiFi access point %s detected as %s%s.\n",
if strings.HasPrefix(e.Tag, "wifi.ap.") {
ap := e.Data.(*network.AccessPoint)
vend := ""
if ap.Vendor != "" {
vend = fmt.Sprintf(" (%s)", ap.Vendor)
}
if e.Tag == "wifi.ap.new" {
fmt.Printf("[%s] [%s] WiFi access point %s detected as %s%s.\n",
e.Time.Format(eventTimeFormat),
core.Green(e.Tag),
core.Bold(ap.ESSID()),
core.Green(ap.BSSID()),
vend)
} else if e.Tag == "wifi.ap.lost" {
fmt.Printf("[%s] [%s] WiFi access point %s (%s) lost.\n",
e.Time.Format(eventTimeFormat),
core.Green(e.Tag),
core.Red(ap.ESSID()),
ap.BSSID())
} else {
fmt.Printf("[%s] [%s] %s\n",
e.Time.Format(eventTimeFormat),
core.Green(e.Tag),
ap.String())
}
} else if e.Tag == "wifi.client.probe" {
probe := e.Data.(WiFiProbe)
fmt.Printf("[%s] [%s] Station %s is probing for SSID %s\n",
e.Time.Format(eventTimeFormat),
core.Green(e.Tag),
core.Bold(ap.ESSID()),
core.Green(ap.BSSID()),
vend)
} else if e.Tag == "wifi.ap.lost" {
fmt.Printf("[%s] [%s] WiFi access point %s (%s) lost.\n",
e.Time.Format(eventTimeFormat),
core.Green(e.Tag),
core.Red(ap.ESSID()),
ap.BSSID())
} else {
fmt.Printf("[%s] [%s] %s\n",
e.Time.Format(eventTimeFormat),
core.Green(e.Tag),
ap.String())
probe.From.String(),
core.Bold(probe.SSID))
}
}
@ -142,8 +152,8 @@ func (s *EventsStream) View(e session.Event, refresh bool) {
s.viewLogEvent(e)
} else if strings.HasPrefix(e.Tag, "endpoint.") {
s.viewEndpointEvent(e)
} else if strings.HasPrefix(e.Tag, "wifi.ap.") {
s.viewApEvent(e)
} else if strings.HasPrefix(e.Tag, "wifi.") {
s.viewWiFiEvent(e)
} else if strings.HasPrefix(e.Tag, "mod.") {
s.viewModuleEvent(e)
} else if strings.HasPrefix(e.Tag, "net.sniff.") {