/
main.go
36 lines (32 loc) · 1.2 KB
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package main
import (
"flag"
"github.com/hkparker/Wave/models"
"strings"
)
var print bool
var port int
var local bool
var certificate string
var key string
var ca string
func main() {
var interface_list string
var host string
flag.StringVar(&interface_list, "interfaces", "mon0", "comma-separated list of network interfaces to collect")
flag.StringVar(&host, "wave", "127.0.0.1", "hostname of Wave server to stream frames to")
flag.IntVar(&port, "port", 444, "port the Wave server is accessible on")
flag.StringVar(&certificate, "certificate", "collector.crt", "path to a TLS client certificate to present to Wave")
flag.StringVar(&key, "key", "collector.key", "path to a TLS client certificate private key")
flag.StringVar(&ca, "ca", "", "path to self-signed wave CA to use for server validation")
flag.BoolVar(&print, "print", false, "print the frames to standard output")
flag.BoolVar(&local, "local", false, "collect frames without streaming them to wave (use with -print)")
flag.Parse()
interfaces := strings.Split(interface_list, ",")
frames := make(chan models.Wireless80211Frame, 100)
go streamFrames(frames, host)
for _, iface := range interfaces {
go sniffInterface(iface, frames)
}
select {}
}