From 2659a559c9f1d0b0094639e39d31f03b6b23ea8d Mon Sep 17 00:00:00 2001 From: Simone Margaritelli Date: Fri, 9 Aug 2024 18:19:21 +0200 Subject: [PATCH] fix: using proper v2 package suffix (fixes #727) --- firewall/firewall_darwin.go | 4 +- firewall/firewall_linux.go | 4 +- firewall/firewall_windows.go | 4 +- go.mod | 2 +- js/random.go | 5 +- log/log.go | 2 +- main.go | 8 +-- modules/any_proxy/any_proxy.go | 7 +- modules/api_rest/api_rest.go | 4 +- modules/api_rest/api_rest_controller.go | 2 +- modules/api_rest/api_rest_ws.go | 2 +- modules/arp_spoof/arp_spoof.go | 6 +- modules/ble/ble_recon.go | 6 +- modules/ble/ble_show.go | 3 +- modules/ble/ble_show_services.go | 3 +- modules/ble/ble_show_sort.go | 3 +- modules/ble/ble_unsupported.go | 3 +- modules/c2/c2.go | 9 +-- modules/can/can.go | 2 +- modules/can/can_recon.go | 4 +- modules/can/can_show.go | 2 +- modules/caplets/caplets.go | 4 +- modules/dhcp6_spoof/dhcp6_spoof.go | 6 +- modules/dns_spoof/dns_spoof.go | 8 +-- modules/events_stream/events_stream.go | 2 +- modules/events_stream/events_triggers.go | 2 +- modules/events_stream/events_view.go | 8 +-- modules/events_stream/events_view_ble.go | 5 +- .../events_view_ble_unsupported.go | 4 +- modules/events_stream/events_view_can.go | 6 +- modules/events_stream/events_view_gateway.go | 4 +- modules/events_stream/events_view_gps.go | 2 +- modules/events_stream/events_view_hid.go | 4 +- modules/events_stream/events_view_http.go | 4 +- modules/events_stream/events_view_wifi.go | 7 +- modules/events_stream/trigger_list.go | 2 +- modules/gps/gps.go | 2 +- modules/graph/create.go | 3 +- modules/graph/edge.go | 3 +- modules/graph/graph.go | 7 +- modules/graph/js_builtin.go | 2 +- modules/graph/module.go | 8 +-- modules/hid/build_amazon.go | 2 +- modules/hid/build_logitech.go | 2 +- modules/hid/build_microsoft.go | 2 +- modules/hid/builders.go | 2 +- modules/hid/hid.go | 4 +- modules/hid/hid_inject.go | 2 +- modules/hid/hid_show.go | 2 +- modules/hid/hid_show_sort.go | 2 +- modules/hid/hid_sniff.go | 2 +- modules/http_proxy/http_proxy.go | 4 +- modules/http_proxy/http_proxy_base.go | 8 +-- .../http_proxy/http_proxy_base_sslstriper.go | 10 +-- modules/http_proxy/http_proxy_js_request.go | 2 +- modules/http_proxy/http_proxy_script.go | 4 +- modules/http_server/http_server.go | 2 +- modules/https_proxy/https_proxy.go | 6 +- modules/https_server/https_server.go | 4 +- modules/mac_changer/mac_changer.go | 6 +- modules/mdns_server/mdns_server.go | 2 +- modules/modules.go | 66 +++++++++---------- modules/mysql_server/mysql_server.go | 4 +- modules/ndp_spoof/ndp_spoof.go | 7 +- modules/net_probe/net_probe.go | 4 +- modules/net_probe/net_probe_mdns.go | 2 +- modules/net_probe/net_probe_nbns.go | 2 +- modules/net_probe/net_probe_upnp.go | 2 +- modules/net_probe/net_probe_wsd.go | 2 +- modules/net_recon/net_recon.go | 7 +- modules/net_recon/net_show.go | 9 +-- modules/net_recon/net_show_sort.go | 6 +- modules/net_sniff/net_sniff.go | 2 +- modules/net_sniff/net_sniff_context.go | 6 +- modules/net_sniff/net_sniff_event.go | 2 +- modules/net_sniff/net_sniff_krb5.go | 2 +- modules/net_sniff/net_sniff_mdns.go | 4 +- modules/net_sniff/net_sniff_ntlm.go | 2 +- modules/net_sniff/net_sniff_parsers.go | 4 +- modules/net_sniff/net_sniff_stats.go | 3 +- modules/net_sniff/net_sniff_teamviewer.go | 3 +- modules/net_sniff/net_sniff_upnp.go | 2 +- modules/net_sniff/net_sniff_views.go | 2 +- modules/packet_proxy/packet_proxy_darwin.go | 2 +- modules/packet_proxy/packet_proxy_freebsd.go | 2 +- modules/packet_proxy/packet_proxy_linux.go | 26 ++++---- modules/packet_proxy/packet_proxy_windows.go | 2 +- modules/syn_scan/syn_scan.go | 6 +- modules/syn_scan/syn_scan_event.go | 4 +- modules/syn_scan/syn_scan_reader.go | 4 +- modules/tcp_proxy/tcp_proxy.go | 4 +- modules/tcp_proxy/tcp_proxy_script.go | 4 +- modules/ticker/ticker.go | 4 +- modules/ui/ui.go | 2 +- modules/update/update.go | 4 +- modules/utils/view_selector.go | 2 +- modules/wifi/wifi.go | 12 ++-- modules/wifi/wifi_ap.go | 6 +- modules/wifi/wifi_assoc.go | 4 +- modules/wifi/wifi_csa.go | 7 +- modules/wifi/wifi_deauth.go | 4 +- modules/wifi/wifi_events.go | 2 +- modules/wifi/wifi_fake_auth.go | 20 +++--- modules/wifi/wifi_hopping.go | 2 +- modules/wifi/wifi_recon.go | 4 +- modules/wifi/wifi_recon_handshakes.go | 9 +-- modules/wifi/wifi_show.go | 6 +- modules/wifi/wifi_show_sort.go | 4 +- modules/wol/wol.go | 4 +- network/arp.go | 2 +- network/meta.go | 2 +- network/net.go | 2 +- network/net_gateway.go | 3 +- network/net_gateway_android.go | 4 +- network/net_linux.go | 2 +- packets/dot11.go | 4 +- packets/queue.go | 2 +- routing/update_darwin.go | 2 +- routing/update_linux.go | 2 +- routing/update_windows.go | 5 +- session/script.go | 4 +- session/script_builtin.go | 3 +- session/script_builtin_runtime.go | 2 +- session/session.go | 10 +-- session/session_completers.go | 2 +- session/session_core_handlers.go | 4 +- session/session_json.go | 8 +-- session/session_routing.go | 7 +- session/session_setup.go | 2 +- tls/cert.go | 2 +- tls/sign.go | 2 +- 131 files changed, 318 insertions(+), 297 deletions(-) diff --git a/firewall/firewall_darwin.go b/firewall/firewall_darwin.go index 8a83255e..e05515c0 100644 --- a/firewall/firewall_darwin.go +++ b/firewall/firewall_darwin.go @@ -9,8 +9,8 @@ import ( "regexp" "strings" - "github.com/bettercap/bettercap/core" - "github.com/bettercap/bettercap/network" + "github.com/bettercap/bettercap/v2/core" + "github.com/bettercap/bettercap/v2/network" "github.com/evilsocket/islazy/str" ) diff --git a/firewall/firewall_linux.go b/firewall/firewall_linux.go index b35520fc..39508e4d 100644 --- a/firewall/firewall_linux.go +++ b/firewall/firewall_linux.go @@ -6,8 +6,8 @@ import ( "os" "strings" - "github.com/bettercap/bettercap/core" - "github.com/bettercap/bettercap/network" + "github.com/bettercap/bettercap/v2/core" + "github.com/bettercap/bettercap/v2/network" "github.com/evilsocket/islazy/fs" "github.com/evilsocket/islazy/str" diff --git a/firewall/firewall_windows.go b/firewall/firewall_windows.go index 74188afc..f5a58ac3 100644 --- a/firewall/firewall_windows.go +++ b/firewall/firewall_windows.go @@ -4,8 +4,8 @@ import ( "fmt" "strings" - "github.com/bettercap/bettercap/core" - "github.com/bettercap/bettercap/network" + "github.com/bettercap/bettercap/v2/core" + "github.com/bettercap/bettercap/v2/network" ) type WindowsFirewall struct { diff --git a/go.mod b/go.mod index 6c2455f6..cead9e8e 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/bettercap/bettercap +module github.com/bettercap/bettercap/v2 go 1.16 diff --git a/js/random.go b/js/random.go index 1ff0412f..4956486d 100644 --- a/js/random.go +++ b/js/random.go @@ -3,7 +3,8 @@ package js import ( "math/rand" "net" - "github.com/bettercap/bettercap/network" + + "github.com/bettercap/bettercap/v2/network" ) type randomPackage struct { @@ -23,4 +24,4 @@ func (c randomPackage) Mac() string { hw := make([]byte, 6) rand.Read(hw) return network.NormalizeMac(net.HardwareAddr(hw).String()) -} \ No newline at end of file +} diff --git a/log/log.go b/log/log.go index a4ab7ba9..fe57b2b7 100644 --- a/log/log.go +++ b/log/log.go @@ -1,7 +1,7 @@ package log import ( - "github.com/bettercap/bettercap/session" + "github.com/bettercap/bettercap/v2/session" ll "github.com/evilsocket/islazy/log" ) diff --git a/main.go b/main.go index 7e0cbd24..87b96d6f 100644 --- a/main.go +++ b/main.go @@ -8,10 +8,10 @@ import ( "runtime" - "github.com/bettercap/bettercap/core" - "github.com/bettercap/bettercap/log" - "github.com/bettercap/bettercap/modules" - "github.com/bettercap/bettercap/session" + "github.com/bettercap/bettercap/v2/core" + "github.com/bettercap/bettercap/v2/log" + "github.com/bettercap/bettercap/v2/modules" + "github.com/bettercap/bettercap/v2/session" "github.com/evilsocket/islazy/str" "github.com/evilsocket/islazy/tui" diff --git a/modules/any_proxy/any_proxy.go b/modules/any_proxy/any_proxy.go index c9cae3c4..c9bcf6b8 100644 --- a/modules/any_proxy/any_proxy.go +++ b/modules/any_proxy/any_proxy.go @@ -2,11 +2,12 @@ package any_proxy import ( "fmt" - "github.com/bettercap/bettercap/firewall" - "github.com/bettercap/bettercap/session" - "github.com/evilsocket/islazy/str" "strconv" "strings" + + "github.com/bettercap/bettercap/v2/firewall" + "github.com/bettercap/bettercap/v2/session" + "github.com/evilsocket/islazy/str" ) type AnyProxy struct { diff --git a/modules/api_rest/api_rest.go b/modules/api_rest/api_rest.go index 4fe32bb7..a72afe2e 100644 --- a/modules/api_rest/api_rest.go +++ b/modules/api_rest/api_rest.go @@ -7,8 +7,8 @@ import ( "sync" "time" - "github.com/bettercap/bettercap/session" - "github.com/bettercap/bettercap/tls" + "github.com/bettercap/bettercap/v2/session" + "github.com/bettercap/bettercap/v2/tls" "github.com/bettercap/recording" diff --git a/modules/api_rest/api_rest_controller.go b/modules/api_rest/api_rest_controller.go index 0abea167..33d94555 100644 --- a/modules/api_rest/api_rest_controller.go +++ b/modules/api_rest/api_rest_controller.go @@ -11,7 +11,7 @@ import ( "strconv" "strings" - "github.com/bettercap/bettercap/session" + "github.com/bettercap/bettercap/v2/session" "github.com/gorilla/mux" ) diff --git a/modules/api_rest/api_rest_ws.go b/modules/api_rest/api_rest_ws.go index 9874a344..0b9dc86c 100644 --- a/modules/api_rest/api_rest_ws.go +++ b/modules/api_rest/api_rest_ws.go @@ -6,7 +6,7 @@ import ( "strings" "time" - "github.com/bettercap/bettercap/session" + "github.com/bettercap/bettercap/v2/session" "github.com/gorilla/websocket" ) diff --git a/modules/arp_spoof/arp_spoof.go b/modules/arp_spoof/arp_spoof.go index 94aa7754..ed29be48 100644 --- a/modules/arp_spoof/arp_spoof.go +++ b/modules/arp_spoof/arp_spoof.go @@ -7,9 +7,9 @@ import ( "sync" "time" - "github.com/bettercap/bettercap/network" - "github.com/bettercap/bettercap/packets" - "github.com/bettercap/bettercap/session" + "github.com/bettercap/bettercap/v2/network" + "github.com/bettercap/bettercap/v2/packets" + "github.com/bettercap/bettercap/v2/session" "github.com/malfunkt/iprange" ) diff --git a/modules/ble/ble_recon.go b/modules/ble/ble_recon.go index 0a945880..820bd94e 100644 --- a/modules/ble/ble_recon.go +++ b/modules/ble/ble_recon.go @@ -9,9 +9,9 @@ import ( golog "log" "time" - "github.com/bettercap/bettercap/modules/utils" - "github.com/bettercap/bettercap/network" - "github.com/bettercap/bettercap/session" + "github.com/bettercap/bettercap/v2/modules/utils" + "github.com/bettercap/bettercap/v2/network" + "github.com/bettercap/bettercap/v2/session" "github.com/bettercap/gatt" diff --git a/modules/ble/ble_show.go b/modules/ble/ble_show.go index 6243a6f0..a5dee55c 100644 --- a/modules/ble/ble_show.go +++ b/modules/ble/ble_show.go @@ -1,3 +1,4 @@ +//go:build !windows // +build !windows package ble @@ -6,7 +7,7 @@ import ( "sort" "time" - "github.com/bettercap/bettercap/network" + "github.com/bettercap/bettercap/v2/network" "github.com/evilsocket/islazy/ops" "github.com/evilsocket/islazy/tui" diff --git a/modules/ble/ble_show_services.go b/modules/ble/ble_show_services.go index 833dfc48..21569392 100644 --- a/modules/ble/ble_show_services.go +++ b/modules/ble/ble_show_services.go @@ -1,3 +1,4 @@ +//go:build !windows // +build !windows package ble @@ -8,7 +9,7 @@ import ( "strconv" "strings" - "github.com/bettercap/bettercap/network" + "github.com/bettercap/bettercap/v2/network" "github.com/bettercap/gatt" "github.com/evilsocket/islazy/tui" diff --git a/modules/ble/ble_show_sort.go b/modules/ble/ble_show_sort.go index 7c858a1f..0fd2ff4b 100644 --- a/modules/ble/ble_show_sort.go +++ b/modules/ble/ble_show_sort.go @@ -1,9 +1,10 @@ +//go:build !windows // +build !windows package ble import ( - "github.com/bettercap/bettercap/network" + "github.com/bettercap/bettercap/v2/network" ) type ByBLERSSISorter []*network.BLEDevice diff --git a/modules/ble/ble_unsupported.go b/modules/ble/ble_unsupported.go index 4a2c6b28..6b89481b 100644 --- a/modules/ble/ble_unsupported.go +++ b/modules/ble/ble_unsupported.go @@ -1,9 +1,10 @@ +//go:build windows // +build windows package ble import ( - "github.com/bettercap/bettercap/session" + "github.com/bettercap/bettercap/v2/session" ) type BLERecon struct { diff --git a/modules/c2/c2.go b/modules/c2/c2.go index cc5394ad..d0cb2e24 100644 --- a/modules/c2/c2.go +++ b/modules/c2/c2.go @@ -4,14 +4,15 @@ import ( "bytes" "crypto/tls" "fmt" + "strings" + "text/template" + "github.com/acarl005/stripansi" - "github.com/bettercap/bettercap/modules/events_stream" - "github.com/bettercap/bettercap/session" + "github.com/bettercap/bettercap/v2/modules/events_stream" + "github.com/bettercap/bettercap/v2/session" "github.com/evilsocket/islazy/log" "github.com/evilsocket/islazy/str" irc "github.com/thoj/go-ircevent" - "strings" - "text/template" ) type settings struct { diff --git a/modules/can/can.go b/modules/can/can.go index 64346078..a96ecaa3 100644 --- a/modules/can/can.go +++ b/modules/can/can.go @@ -4,7 +4,7 @@ import ( "errors" "net" - "github.com/bettercap/bettercap/session" + "github.com/bettercap/bettercap/v2/session" "go.einride.tech/can/pkg/descriptor" "go.einride.tech/can/pkg/socketcan" ) diff --git a/modules/can/can_recon.go b/modules/can/can_recon.go index fd7ce8e9..53f1955f 100644 --- a/modules/can/can_recon.go +++ b/modules/can/can_recon.go @@ -6,8 +6,8 @@ import ( "fmt" "os" - "github.com/bettercap/bettercap/network" - "github.com/bettercap/bettercap/session" + "github.com/bettercap/bettercap/v2/network" + "github.com/bettercap/bettercap/v2/session" "github.com/evilsocket/islazy/str" "go.einride.tech/can" "go.einride.tech/can/pkg/socketcan" diff --git a/modules/can/can_show.go b/modules/can/can_show.go index b21fa78b..a1735f6a 100644 --- a/modules/can/can_show.go +++ b/modules/can/can_show.go @@ -3,7 +3,7 @@ package can import ( "time" - "github.com/bettercap/bettercap/network" + "github.com/bettercap/bettercap/v2/network" "github.com/dustin/go-humanize" "github.com/evilsocket/islazy/tui" ) diff --git a/modules/caplets/caplets.go b/modules/caplets/caplets.go index 9310b0f6..2b00d419 100644 --- a/modules/caplets/caplets.go +++ b/modules/caplets/caplets.go @@ -6,8 +6,8 @@ import ( "net/http" "os" - "github.com/bettercap/bettercap/caplets" - "github.com/bettercap/bettercap/session" + "github.com/bettercap/bettercap/v2/caplets" + "github.com/bettercap/bettercap/v2/session" "github.com/dustin/go-humanize" diff --git a/modules/dhcp6_spoof/dhcp6_spoof.go b/modules/dhcp6_spoof/dhcp6_spoof.go index 9c4fefd2..55c6ac6a 100644 --- a/modules/dhcp6_spoof/dhcp6_spoof.go +++ b/modules/dhcp6_spoof/dhcp6_spoof.go @@ -9,9 +9,9 @@ import ( "sync" "time" - "github.com/bettercap/bettercap/network" - "github.com/bettercap/bettercap/packets" - "github.com/bettercap/bettercap/session" + "github.com/bettercap/bettercap/v2/network" + "github.com/bettercap/bettercap/v2/packets" + "github.com/bettercap/bettercap/v2/session" "github.com/google/gopacket" "github.com/google/gopacket/layers" diff --git a/modules/dns_spoof/dns_spoof.go b/modules/dns_spoof/dns_spoof.go index 03a42f26..68a8f893 100644 --- a/modules/dns_spoof/dns_spoof.go +++ b/modules/dns_spoof/dns_spoof.go @@ -7,10 +7,10 @@ import ( "strconv" "sync" - "github.com/bettercap/bettercap/log" - "github.com/bettercap/bettercap/network" - "github.com/bettercap/bettercap/packets" - "github.com/bettercap/bettercap/session" + "github.com/bettercap/bettercap/v2/log" + "github.com/bettercap/bettercap/v2/network" + "github.com/bettercap/bettercap/v2/packets" + "github.com/bettercap/bettercap/v2/session" "github.com/google/gopacket" "github.com/google/gopacket/layers" diff --git a/modules/events_stream/events_stream.go b/modules/events_stream/events_stream.go index c4c76822..07aeb896 100644 --- a/modules/events_stream/events_stream.go +++ b/modules/events_stream/events_stream.go @@ -8,7 +8,7 @@ import ( "sync" "time" - "github.com/bettercap/bettercap/session" + "github.com/bettercap/bettercap/v2/session" "github.com/evilsocket/islazy/fs" "github.com/evilsocket/islazy/str" diff --git a/modules/events_stream/events_triggers.go b/modules/events_stream/events_triggers.go index 5c2cc228..bda315d3 100644 --- a/modules/events_stream/events_triggers.go +++ b/modules/events_stream/events_triggers.go @@ -1,7 +1,7 @@ package events_stream import ( - "github.com/bettercap/bettercap/session" + "github.com/bettercap/bettercap/v2/session" "github.com/evilsocket/islazy/tui" ) diff --git a/modules/events_stream/events_view.go b/modules/events_stream/events_view.go index 360ceb10..b8bec894 100644 --- a/modules/events_stream/events_view.go +++ b/modules/events_stream/events_view.go @@ -6,11 +6,11 @@ import ( "os" "strings" - "github.com/bettercap/bettercap/network" - "github.com/bettercap/bettercap/session" + "github.com/bettercap/bettercap/v2/network" + "github.com/bettercap/bettercap/v2/session" - "github.com/bettercap/bettercap/modules/net_sniff" - "github.com/bettercap/bettercap/modules/syn_scan" + "github.com/bettercap/bettercap/v2/modules/net_sniff" + "github.com/bettercap/bettercap/v2/modules/syn_scan" "github.com/google/go-github/github" diff --git a/modules/events_stream/events_view_ble.go b/modules/events_stream/events_view_ble.go index bb790f44..a3a7ed61 100644 --- a/modules/events_stream/events_view_ble.go +++ b/modules/events_stream/events_view_ble.go @@ -1,3 +1,4 @@ +//go:build !windows // +build !windows package events_stream @@ -6,8 +7,8 @@ import ( "fmt" "io" - "github.com/bettercap/bettercap/network" - "github.com/bettercap/bettercap/session" + "github.com/bettercap/bettercap/v2/network" + "github.com/bettercap/bettercap/v2/session" "github.com/evilsocket/islazy/tui" ) diff --git a/modules/events_stream/events_view_ble_unsupported.go b/modules/events_stream/events_view_ble_unsupported.go index 36b25e49..0583702a 100644 --- a/modules/events_stream/events_view_ble_unsupported.go +++ b/modules/events_stream/events_view_ble_unsupported.go @@ -1,10 +1,12 @@ +//go:build windows // +build windows package events_stream import ( "io" - "github.com/bettercap/bettercap/session" + + "github.com/bettercap/bettercap/v2/session" ) func (mod *EventsStream) viewBLEEvent(output io.Writer, e session.Event) { diff --git a/modules/events_stream/events_view_can.go b/modules/events_stream/events_view_can.go index b3f9c2c1..d39694ff 100644 --- a/modules/events_stream/events_view_can.go +++ b/modules/events_stream/events_view_can.go @@ -5,9 +5,9 @@ import ( "fmt" "io" - "github.com/bettercap/bettercap/modules/can" - "github.com/bettercap/bettercap/network" - "github.com/bettercap/bettercap/session" + "github.com/bettercap/bettercap/v2/modules/can" + "github.com/bettercap/bettercap/v2/network" + "github.com/bettercap/bettercap/v2/session" "github.com/dustin/go-humanize" "github.com/evilsocket/islazy/tui" diff --git a/modules/events_stream/events_view_gateway.go b/modules/events_stream/events_view_gateway.go index 88066ef6..9ac69439 100644 --- a/modules/events_stream/events_view_gateway.go +++ b/modules/events_stream/events_view_gateway.go @@ -4,7 +4,7 @@ import ( "fmt" "io" - "github.com/bettercap/bettercap/session" + "github.com/bettercap/bettercap/v2/session" "github.com/evilsocket/islazy/tui" ) @@ -20,4 +20,4 @@ func (mod *EventsStream) viewGatewayEvent(output io.Writer, e session.Event) { change.Prev.MAC, change.New.IP, change.New.MAC) -} \ No newline at end of file +} diff --git a/modules/events_stream/events_view_gps.go b/modules/events_stream/events_view_gps.go index 7e2285b8..0ea45dfc 100644 --- a/modules/events_stream/events_view_gps.go +++ b/modules/events_stream/events_view_gps.go @@ -4,7 +4,7 @@ import ( "fmt" "io" - "github.com/bettercap/bettercap/session" + "github.com/bettercap/bettercap/v2/session" "github.com/evilsocket/islazy/tui" ) diff --git a/modules/events_stream/events_view_hid.go b/modules/events_stream/events_view_hid.go index 9d1918e3..7a9fae4f 100644 --- a/modules/events_stream/events_view_hid.go +++ b/modules/events_stream/events_view_hid.go @@ -4,8 +4,8 @@ import ( "fmt" "io" - "github.com/bettercap/bettercap/network" - "github.com/bettercap/bettercap/session" + "github.com/bettercap/bettercap/v2/network" + "github.com/bettercap/bettercap/v2/session" "github.com/evilsocket/islazy/tui" ) diff --git a/modules/events_stream/events_view_http.go b/modules/events_stream/events_view_http.go index ad119392..6a6cd896 100644 --- a/modules/events_stream/events_view_http.go +++ b/modules/events_stream/events_view_http.go @@ -11,8 +11,8 @@ import ( "regexp" "strings" - "github.com/bettercap/bettercap/modules/net_sniff" - "github.com/bettercap/bettercap/session" + "github.com/bettercap/bettercap/v2/modules/net_sniff" + "github.com/bettercap/bettercap/v2/session" "github.com/evilsocket/islazy/tui" ) diff --git a/modules/events_stream/events_view_wifi.go b/modules/events_stream/events_view_wifi.go index da9ab312..498d551e 100644 --- a/modules/events_stream/events_view_wifi.go +++ b/modules/events_stream/events_view_wifi.go @@ -2,12 +2,13 @@ package events_stream import ( "fmt" - "github.com/bettercap/bettercap/modules/wifi" "io" "strings" - "github.com/bettercap/bettercap/network" - "github.com/bettercap/bettercap/session" + "github.com/bettercap/bettercap/v2/modules/wifi" + + "github.com/bettercap/bettercap/v2/network" + "github.com/bettercap/bettercap/v2/session" "github.com/evilsocket/islazy/tui" ) diff --git a/modules/events_stream/trigger_list.go b/modules/events_stream/trigger_list.go index 9668b2b9..735c6082 100644 --- a/modules/events_stream/trigger_list.go +++ b/modules/events_stream/trigger_list.go @@ -7,7 +7,7 @@ import ( "strings" "sync" - "github.com/bettercap/bettercap/session" + "github.com/bettercap/bettercap/v2/session" "github.com/antchfx/jsonquery" "github.com/evilsocket/islazy/str" diff --git a/modules/gps/gps.go b/modules/gps/gps.go index 5029c1d9..eb191043 100644 --- a/modules/gps/gps.go +++ b/modules/gps/gps.go @@ -5,7 +5,7 @@ import ( "io" "time" - "github.com/bettercap/bettercap/session" + "github.com/bettercap/bettercap/v2/session" "github.com/adrianmo/go-nmea" "github.com/stratoberry/go-gpsd" diff --git a/modules/graph/create.go b/modules/graph/create.go index f4779df8..0accf6a7 100644 --- a/modules/graph/create.go +++ b/modules/graph/create.go @@ -2,7 +2,8 @@ package graph import ( "fmt" - "github.com/bettercap/bettercap/network" + + "github.com/bettercap/bettercap/v2/network" ) func (mod *Module) createIPGraph(endpoint *network.Endpoint) (*Node, bool, error) { diff --git a/modules/graph/edge.go b/modules/graph/edge.go index 4c6eff93..45cec9d0 100644 --- a/modules/graph/edge.go +++ b/modules/graph/edge.go @@ -2,8 +2,9 @@ package graph import ( "fmt" - "github.com/bettercap/bettercap/session" "time" + + "github.com/bettercap/bettercap/v2/session" ) type EdgeType string diff --git a/modules/graph/graph.go b/modules/graph/graph.go index 1a32e017..a54c907d 100644 --- a/modules/graph/graph.go +++ b/modules/graph/graph.go @@ -3,14 +3,15 @@ package graph import ( "encoding/json" "fmt" - "github.com/bettercap/bettercap/session" - "github.com/evilsocket/islazy/fs" "path" "sync" "time" + + "github.com/bettercap/bettercap/v2/session" + "github.com/evilsocket/islazy/fs" ) -var Loaded = (* Graph)(nil) +var Loaded = (*Graph)(nil) type NodeCallback func(*Node) type EdgeCallback func(*Node, []Edge, *Node) diff --git a/modules/graph/js_builtin.go b/modules/graph/js_builtin.go index 49252d47..951b0e11 100644 --- a/modules/graph/js_builtin.go +++ b/modules/graph/js_builtin.go @@ -1,7 +1,7 @@ package graph import ( - "github.com/bettercap/bettercap/log" + "github.com/bettercap/bettercap/v2/log" ) type graphPackage struct{} diff --git a/modules/graph/module.go b/modules/graph/module.go index b5e36663..e6a5b3f2 100644 --- a/modules/graph/module.go +++ b/modules/graph/module.go @@ -7,10 +7,10 @@ import ( "sync" "time" - "github.com/bettercap/bettercap/caplets" - "github.com/bettercap/bettercap/modules/wifi" - "github.com/bettercap/bettercap/network" - "github.com/bettercap/bettercap/session" + "github.com/bettercap/bettercap/v2/caplets" + "github.com/bettercap/bettercap/v2/modules/wifi" + "github.com/bettercap/bettercap/v2/network" + "github.com/bettercap/bettercap/v2/session" "github.com/evilsocket/islazy/fs" "github.com/evilsocket/islazy/plugin" "github.com/evilsocket/islazy/str" diff --git a/modules/hid/build_amazon.go b/modules/hid/build_amazon.go index bd787e62..025fff4b 100644 --- a/modules/hid/build_amazon.go +++ b/modules/hid/build_amazon.go @@ -1,7 +1,7 @@ package hid import ( - "github.com/bettercap/bettercap/network" + "github.com/bettercap/bettercap/v2/network" ) const ( diff --git a/modules/hid/build_logitech.go b/modules/hid/build_logitech.go index 1beb2ade..4f563a0e 100644 --- a/modules/hid/build_logitech.go +++ b/modules/hid/build_logitech.go @@ -1,7 +1,7 @@ package hid import ( - "github.com/bettercap/bettercap/network" + "github.com/bettercap/bettercap/v2/network" ) const ( diff --git a/modules/hid/build_microsoft.go b/modules/hid/build_microsoft.go index b85f7271..84a55822 100644 --- a/modules/hid/build_microsoft.go +++ b/modules/hid/build_microsoft.go @@ -3,7 +3,7 @@ package hid import ( "fmt" - "github.com/bettercap/bettercap/network" + "github.com/bettercap/bettercap/v2/network" ) type MicrosoftBuilder struct { diff --git a/modules/hid/builders.go b/modules/hid/builders.go index 826a1249..1fd0ef3a 100644 --- a/modules/hid/builders.go +++ b/modules/hid/builders.go @@ -1,7 +1,7 @@ package hid import ( - "github.com/bettercap/bettercap/network" + "github.com/bettercap/bettercap/v2/network" ) type FrameBuilder interface { diff --git a/modules/hid/hid.go b/modules/hid/hid.go index 21997859..ae519fb1 100644 --- a/modules/hid/hid.go +++ b/modules/hid/hid.go @@ -6,8 +6,8 @@ import ( "sync" "time" - "github.com/bettercap/bettercap/modules/utils" - "github.com/bettercap/bettercap/session" + "github.com/bettercap/bettercap/v2/modules/utils" + "github.com/bettercap/bettercap/v2/session" "github.com/bettercap/nrf24" ) diff --git a/modules/hid/hid_inject.go b/modules/hid/hid_inject.go index 2abce2f1..816f8155 100644 --- a/modules/hid/hid_inject.go +++ b/modules/hid/hid_inject.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/bettercap/bettercap/network" + "github.com/bettercap/bettercap/v2/network" "github.com/evilsocket/islazy/tui" diff --git a/modules/hid/hid_show.go b/modules/hid/hid_show.go index f083eb90..8422850e 100644 --- a/modules/hid/hid_show.go +++ b/modules/hid/hid_show.go @@ -4,7 +4,7 @@ import ( "sort" "time" - "github.com/bettercap/bettercap/network" + "github.com/bettercap/bettercap/v2/network" "github.com/dustin/go-humanize" diff --git a/modules/hid/hid_show_sort.go b/modules/hid/hid_show_sort.go index a70690e6..497da72d 100644 --- a/modules/hid/hid_show_sort.go +++ b/modules/hid/hid_show_sort.go @@ -1,7 +1,7 @@ package hid import ( - "github.com/bettercap/bettercap/network" + "github.com/bettercap/bettercap/v2/network" ) type ByHIDMacSorter []*network.HIDDevice diff --git a/modules/hid/hid_sniff.go b/modules/hid/hid_sniff.go index a6fd7ec4..c2005ba9 100644 --- a/modules/hid/hid_sniff.go +++ b/modules/hid/hid_sniff.go @@ -5,7 +5,7 @@ import ( "fmt" "time" - "github.com/bettercap/bettercap/network" + "github.com/bettercap/bettercap/v2/network" "github.com/bettercap/nrf24" diff --git a/modules/http_proxy/http_proxy.go b/modules/http_proxy/http_proxy.go index e8ab830a..d9b6beaf 100644 --- a/modules/http_proxy/http_proxy.go +++ b/modules/http_proxy/http_proxy.go @@ -1,7 +1,7 @@ package http_proxy import ( - "github.com/bettercap/bettercap/session" + "github.com/bettercap/bettercap/v2/session" "github.com/evilsocket/islazy/str" ) @@ -66,7 +66,7 @@ func NewHttpProxy(s *session.Session) *HttpProxy { return mod.Stop() })) - mod.InitState("stripper") + mod.InitState("stripper") return mod } diff --git a/modules/http_proxy/http_proxy_base.go b/modules/http_proxy/http_proxy_base.go index 8f207d22..5d4eebef 100644 --- a/modules/http_proxy/http_proxy_base.go +++ b/modules/http_proxy/http_proxy_base.go @@ -16,9 +16,9 @@ import ( "strings" "time" - "github.com/bettercap/bettercap/firewall" - "github.com/bettercap/bettercap/session" - btls "github.com/bettercap/bettercap/tls" + "github.com/bettercap/bettercap/v2/firewall" + "github.com/bettercap/bettercap/v2/session" + btls "github.com/bettercap/bettercap/v2/tls" "github.com/elazarl/goproxy" "github.com/inconshreveable/go-vhost" @@ -175,7 +175,7 @@ func (p *HTTPProxy) Configure(address string, proxyPort int, httpPort int, doRed // check if another http(s) proxy is using sslstrip and merge strippers if stripSSL { - for _, mname := range []string{"http.proxy", "https.proxy"}{ + for _, mname := range []string{"http.proxy", "https.proxy"} { err, m := p.Sess.Module(mname) if err == nil && m.Running() { var mextra interface{} diff --git a/modules/http_proxy/http_proxy_base_sslstriper.go b/modules/http_proxy/http_proxy_base_sslstriper.go index 1c52b7f9..d2fd0f4f 100644 --- a/modules/http_proxy/http_proxy_base_sslstriper.go +++ b/modules/http_proxy/http_proxy_base_sslstriper.go @@ -8,10 +8,10 @@ import ( "strconv" "strings" - "github.com/bettercap/bettercap/log" - "github.com/bettercap/bettercap/modules/dns_spoof" - "github.com/bettercap/bettercap/network" - "github.com/bettercap/bettercap/session" + "github.com/bettercap/bettercap/v2/log" + "github.com/bettercap/bettercap/v2/modules/dns_spoof" + "github.com/bettercap/bettercap/v2/network" + "github.com/bettercap/bettercap/v2/session" "github.com/elazarl/goproxy" "github.com/google/gopacket" @@ -163,7 +163,7 @@ func (s *SSLStripper) fixCookiesInHeader(res *http.Response) { origHost := res.Request.URL.Hostname() strippedHost := s.hosts.Strip(origHost /* unstripped */) - if strippedHost != nil && /*strippedHost.Hostname != origHost && */res.Header["Set-Cookie"] != nil { + if strippedHost != nil && /*strippedHost.Hostname != origHost && */ res.Header["Set-Cookie"] != nil { // origHost is being tracked. // get domains from hostnames if origParts, strippedParts := strings.Split(origHost, "."), strings.Split(strippedHost.Hostname, "."); len(origParts) > 1 && len(strippedParts) > 1 { diff --git a/modules/http_proxy/http_proxy_js_request.go b/modules/http_proxy/http_proxy_js_request.go index 7a450e1d..a3c6a1da 100644 --- a/modules/http_proxy/http_proxy_js_request.go +++ b/modules/http_proxy/http_proxy_js_request.go @@ -9,7 +9,7 @@ import ( "regexp" "strings" - "github.com/bettercap/bettercap/session" + "github.com/bettercap/bettercap/v2/session" ) type JSRequest struct { diff --git a/modules/http_proxy/http_proxy_script.go b/modules/http_proxy/http_proxy_script.go index e9e7df05..7db54089 100644 --- a/modules/http_proxy/http_proxy_script.go +++ b/modules/http_proxy/http_proxy_script.go @@ -3,8 +3,8 @@ package http_proxy import ( "net/http" - "github.com/bettercap/bettercap/log" - "github.com/bettercap/bettercap/session" + "github.com/bettercap/bettercap/v2/log" + "github.com/bettercap/bettercap/v2/session" "github.com/robertkrimen/otto" diff --git a/modules/http_server/http_server.go b/modules/http_server/http_server.go index 2ff3512f..25cd7802 100644 --- a/modules/http_server/http_server.go +++ b/modules/http_server/http_server.go @@ -7,7 +7,7 @@ import ( "strings" "time" - "github.com/bettercap/bettercap/session" + "github.com/bettercap/bettercap/v2/session" "github.com/evilsocket/islazy/tui" ) diff --git a/modules/https_proxy/https_proxy.go b/modules/https_proxy/https_proxy.go index 06bc1e0f..1ad706d8 100644 --- a/modules/https_proxy/https_proxy.go +++ b/modules/https_proxy/https_proxy.go @@ -1,9 +1,9 @@ package https_proxy import ( - "github.com/bettercap/bettercap/modules/http_proxy" - "github.com/bettercap/bettercap/session" - "github.com/bettercap/bettercap/tls" + "github.com/bettercap/bettercap/v2/modules/http_proxy" + "github.com/bettercap/bettercap/v2/session" + "github.com/bettercap/bettercap/v2/tls" "github.com/evilsocket/islazy/fs" "github.com/evilsocket/islazy/str" diff --git a/modules/https_server/https_server.go b/modules/https_server/https_server.go index 0d9ff80f..8e547fa7 100644 --- a/modules/https_server/https_server.go +++ b/modules/https_server/https_server.go @@ -7,8 +7,8 @@ import ( "strings" "time" - "github.com/bettercap/bettercap/session" - "github.com/bettercap/bettercap/tls" + "github.com/bettercap/bettercap/v2/session" + "github.com/bettercap/bettercap/v2/tls" "github.com/evilsocket/islazy/fs" "github.com/evilsocket/islazy/tui" diff --git a/modules/mac_changer/mac_changer.go b/modules/mac_changer/mac_changer.go index a991cfb1..2c5f3d47 100644 --- a/modules/mac_changer/mac_changer.go +++ b/modules/mac_changer/mac_changer.go @@ -6,9 +6,9 @@ import ( "runtime" "strings" - "github.com/bettercap/bettercap/core" - "github.com/bettercap/bettercap/network" - "github.com/bettercap/bettercap/session" + "github.com/bettercap/bettercap/v2/core" + "github.com/bettercap/bettercap/v2/network" + "github.com/bettercap/bettercap/v2/session" "github.com/evilsocket/islazy/tui" ) diff --git a/modules/mdns_server/mdns_server.go b/modules/mdns_server/mdns_server.go index eb9e471c..163a003f 100644 --- a/modules/mdns_server/mdns_server.go +++ b/modules/mdns_server/mdns_server.go @@ -7,7 +7,7 @@ import ( "net" "os" - "github.com/bettercap/bettercap/session" + "github.com/bettercap/bettercap/v2/session" "github.com/evilsocket/islazy/str" "github.com/evilsocket/islazy/tui" diff --git a/modules/modules.go b/modules/modules.go index 251e9772..02fae46d 100644 --- a/modules/modules.go +++ b/modules/modules.go @@ -1,40 +1,40 @@ package modules import ( - "github.com/bettercap/bettercap/modules/any_proxy" - "github.com/bettercap/bettercap/modules/api_rest" - "github.com/bettercap/bettercap/modules/arp_spoof" - "github.com/bettercap/bettercap/modules/ble" - "github.com/bettercap/bettercap/modules/c2" - "github.com/bettercap/bettercap/modules/can" - "github.com/bettercap/bettercap/modules/caplets" - "github.com/bettercap/bettercap/modules/dhcp6_spoof" - "github.com/bettercap/bettercap/modules/dns_spoof" - "github.com/bettercap/bettercap/modules/events_stream" - "github.com/bettercap/bettercap/modules/gps" - "github.com/bettercap/bettercap/modules/graph" - "github.com/bettercap/bettercap/modules/hid" - "github.com/bettercap/bettercap/modules/http_proxy" - "github.com/bettercap/bettercap/modules/http_server" - "github.com/bettercap/bettercap/modules/https_proxy" - "github.com/bettercap/bettercap/modules/https_server" - "github.com/bettercap/bettercap/modules/mac_changer" - "github.com/bettercap/bettercap/modules/mdns_server" - "github.com/bettercap/bettercap/modules/mysql_server" - "github.com/bettercap/bettercap/modules/ndp_spoof" - "github.com/bettercap/bettercap/modules/net_probe" - "github.com/bettercap/bettercap/modules/net_recon" - "github.com/bettercap/bettercap/modules/net_sniff" - "github.com/bettercap/bettercap/modules/packet_proxy" - "github.com/bettercap/bettercap/modules/syn_scan" - "github.com/bettercap/bettercap/modules/tcp_proxy" - "github.com/bettercap/bettercap/modules/ticker" - "github.com/bettercap/bettercap/modules/ui" - "github.com/bettercap/bettercap/modules/update" - "github.com/bettercap/bettercap/modules/wifi" - "github.com/bettercap/bettercap/modules/wol" + "github.com/bettercap/bettercap/v2/modules/any_proxy" + "github.com/bettercap/bettercap/v2/modules/api_rest" + "github.com/bettercap/bettercap/v2/modules/arp_spoof" + "github.com/bettercap/bettercap/v2/modules/ble" + "github.com/bettercap/bettercap/v2/modules/c2" + "github.com/bettercap/bettercap/v2/modules/can" + "github.com/bettercap/bettercap/v2/modules/caplets" + "github.com/bettercap/bettercap/v2/modules/dhcp6_spoof" + "github.com/bettercap/bettercap/v2/modules/dns_spoof" + "github.com/bettercap/bettercap/v2/modules/events_stream" + "github.com/bettercap/bettercap/v2/modules/gps" + "github.com/bettercap/bettercap/v2/modules/graph" + "github.com/bettercap/bettercap/v2/modules/hid" + "github.com/bettercap/bettercap/v2/modules/http_proxy" + "github.com/bettercap/bettercap/v2/modules/http_server" + "github.com/bettercap/bettercap/v2/modules/https_proxy" + "github.com/bettercap/bettercap/v2/modules/https_server" + "github.com/bettercap/bettercap/v2/modules/mac_changer" + "github.com/bettercap/bettercap/v2/modules/mdns_server" + "github.com/bettercap/bettercap/v2/modules/mysql_server" + "github.com/bettercap/bettercap/v2/modules/ndp_spoof" + "github.com/bettercap/bettercap/v2/modules/net_probe" + "github.com/bettercap/bettercap/v2/modules/net_recon" + "github.com/bettercap/bettercap/v2/modules/net_sniff" + "github.com/bettercap/bettercap/v2/modules/packet_proxy" + "github.com/bettercap/bettercap/v2/modules/syn_scan" + "github.com/bettercap/bettercap/v2/modules/tcp_proxy" + "github.com/bettercap/bettercap/v2/modules/ticker" + "github.com/bettercap/bettercap/v2/modules/ui" + "github.com/bettercap/bettercap/v2/modules/update" + "github.com/bettercap/bettercap/v2/modules/wifi" + "github.com/bettercap/bettercap/v2/modules/wol" - "github.com/bettercap/bettercap/session" + "github.com/bettercap/bettercap/v2/session" ) func LoadModules(sess *session.Session) { diff --git a/modules/mysql_server/mysql_server.go b/modules/mysql_server/mysql_server.go index 2f7e696c..3278ec9d 100644 --- a/modules/mysql_server/mysql_server.go +++ b/modules/mysql_server/mysql_server.go @@ -8,8 +8,8 @@ import ( "net" "strings" - "github.com/bettercap/bettercap/packets" - "github.com/bettercap/bettercap/session" + "github.com/bettercap/bettercap/v2/packets" + "github.com/bettercap/bettercap/v2/session" "github.com/evilsocket/islazy/tui" ) diff --git a/modules/ndp_spoof/ndp_spoof.go b/modules/ndp_spoof/ndp_spoof.go index 5845a391..8a1e942b 100644 --- a/modules/ndp_spoof/ndp_spoof.go +++ b/modules/ndp_spoof/ndp_spoof.go @@ -2,13 +2,14 @@ package ndp_spoof import ( "fmt" - "github.com/bettercap/bettercap/packets" - "github.com/evilsocket/islazy/str" "net" "sync" "time" - "github.com/bettercap/bettercap/session" + "github.com/bettercap/bettercap/v2/packets" + "github.com/evilsocket/islazy/str" + + "github.com/bettercap/bettercap/v2/session" ) type NDPSpoofer struct { diff --git a/modules/net_probe/net_probe.go b/modules/net_probe/net_probe.go index 789fc3a1..15f0783e 100644 --- a/modules/net_probe/net_probe.go +++ b/modules/net_probe/net_probe.go @@ -4,8 +4,8 @@ import ( "sync" "time" - "github.com/bettercap/bettercap/network" - "github.com/bettercap/bettercap/session" + "github.com/bettercap/bettercap/v2/network" + "github.com/bettercap/bettercap/v2/session" "github.com/malfunkt/iprange" ) diff --git a/modules/net_probe/net_probe_mdns.go b/modules/net_probe/net_probe_mdns.go index 8519c18c..a4c78614 100644 --- a/modules/net_probe/net_probe_mdns.go +++ b/modules/net_probe/net_probe_mdns.go @@ -6,7 +6,7 @@ import ( "log" "net" - "github.com/bettercap/bettercap/packets" + "github.com/bettercap/bettercap/v2/packets" "github.com/hashicorp/mdns" ) diff --git a/modules/net_probe/net_probe_nbns.go b/modules/net_probe/net_probe_nbns.go index 843e97ec..c5a913d3 100644 --- a/modules/net_probe/net_probe_nbns.go +++ b/modules/net_probe/net_probe_nbns.go @@ -4,7 +4,7 @@ import ( "fmt" "net" - "github.com/bettercap/bettercap/packets" + "github.com/bettercap/bettercap/v2/packets" ) func (mod *Prober) sendProbeNBNS(from net.IP, from_hw net.HardwareAddr, ip net.IP) { diff --git a/modules/net_probe/net_probe_upnp.go b/modules/net_probe/net_probe_upnp.go index d5188a4b..099bf54c 100644 --- a/modules/net_probe/net_probe_upnp.go +++ b/modules/net_probe/net_probe_upnp.go @@ -4,7 +4,7 @@ import ( "fmt" "net" - "github.com/bettercap/bettercap/packets" + "github.com/bettercap/bettercap/v2/packets" ) func (mod *Prober) sendProbeUPNP(from net.IP, from_hw net.HardwareAddr) { diff --git a/modules/net_probe/net_probe_wsd.go b/modules/net_probe/net_probe_wsd.go index bb363037..e7f08020 100644 --- a/modules/net_probe/net_probe_wsd.go +++ b/modules/net_probe/net_probe_wsd.go @@ -4,7 +4,7 @@ import ( "fmt" "net" - "github.com/bettercap/bettercap/packets" + "github.com/bettercap/bettercap/v2/packets" ) func (mod *Prober) sendProbeWSD(from net.IP, from_hw net.HardwareAddr) { diff --git a/modules/net_recon/net_recon.go b/modules/net_recon/net_recon.go index 5208a010..b2291d24 100644 --- a/modules/net_recon/net_recon.go +++ b/modules/net_recon/net_recon.go @@ -1,11 +1,12 @@ package net_recon import ( - "github.com/bettercap/bettercap/modules/utils" "time" - "github.com/bettercap/bettercap/network" - "github.com/bettercap/bettercap/session" + "github.com/bettercap/bettercap/v2/modules/utils" + + "github.com/bettercap/bettercap/v2/network" + "github.com/bettercap/bettercap/v2/session" ) type Discovery struct { diff --git a/modules/net_recon/net_show.go b/modules/net_recon/net_show.go index a0b38009..93fa0e3c 100644 --- a/modules/net_recon/net_show.go +++ b/modules/net_recon/net_show.go @@ -2,18 +2,19 @@ package net_recon import ( "fmt" - "github.com/bettercap/bettercap/modules/syn_scan" "sort" "strings" "time" - "github.com/bettercap/bettercap/network" - "github.com/bettercap/bettercap/packets" + "github.com/bettercap/bettercap/v2/modules/syn_scan" + + "github.com/bettercap/bettercap/v2/network" + "github.com/bettercap/bettercap/v2/packets" "github.com/dustin/go-humanize" - "github.com/evilsocket/islazy/tui" "github.com/evilsocket/islazy/str" + "github.com/evilsocket/islazy/tui" ) const ( diff --git a/modules/net_recon/net_show_sort.go b/modules/net_recon/net_show_sort.go index 2109543f..c7f5fb1a 100644 --- a/modules/net_recon/net_show_sort.go +++ b/modules/net_recon/net_show_sort.go @@ -1,9 +1,9 @@ package net_recon import ( - "github.com/bettercap/bettercap/network" - "github.com/bettercap/bettercap/packets" - "github.com/bettercap/bettercap/session" + "github.com/bettercap/bettercap/v2/network" + "github.com/bettercap/bettercap/v2/packets" + "github.com/bettercap/bettercap/v2/session" ) type ByAddressSorter []*network.Endpoint diff --git a/modules/net_sniff/net_sniff.go b/modules/net_sniff/net_sniff.go index b66d9ad4..4daa9859 100644 --- a/modules/net_sniff/net_sniff.go +++ b/modules/net_sniff/net_sniff.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/bettercap/bettercap/session" + "github.com/bettercap/bettercap/v2/session" "github.com/google/gopacket" "github.com/google/gopacket/layers" diff --git a/modules/net_sniff/net_sniff_context.go b/modules/net_sniff/net_sniff_context.go index bb21afb3..e275ebf8 100644 --- a/modules/net_sniff/net_sniff_context.go +++ b/modules/net_sniff/net_sniff_context.go @@ -5,9 +5,9 @@ import ( "regexp" "time" - "github.com/bettercap/bettercap/log" - "github.com/bettercap/bettercap/network" - "github.com/bettercap/bettercap/session" + "github.com/bettercap/bettercap/v2/log" + "github.com/bettercap/bettercap/v2/network" + "github.com/bettercap/bettercap/v2/session" "github.com/google/gopacket/pcap" "github.com/google/gopacket/pcapgo" diff --git a/modules/net_sniff/net_sniff_event.go b/modules/net_sniff/net_sniff_event.go index 573f8d15..12326f2d 100644 --- a/modules/net_sniff/net_sniff_event.go +++ b/modules/net_sniff/net_sniff_event.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/bettercap/bettercap/session" + "github.com/bettercap/bettercap/v2/session" ) type SniffData map[string]interface{} diff --git a/modules/net_sniff/net_sniff_krb5.go b/modules/net_sniff/net_sniff_krb5.go index 39924507..7cbe4e5a 100644 --- a/modules/net_sniff/net_sniff_krb5.go +++ b/modules/net_sniff/net_sniff_krb5.go @@ -4,7 +4,7 @@ import ( "encoding/asn1" "net" - "github.com/bettercap/bettercap/packets" + "github.com/bettercap/bettercap/v2/packets" "github.com/google/gopacket" "github.com/google/gopacket/layers" diff --git a/modules/net_sniff/net_sniff_mdns.go b/modules/net_sniff/net_sniff_mdns.go index c809d952..67737f68 100644 --- a/modules/net_sniff/net_sniff_mdns.go +++ b/modules/net_sniff/net_sniff_mdns.go @@ -4,8 +4,8 @@ import ( "net" "strings" - "github.com/bettercap/bettercap/packets" - "github.com/bettercap/bettercap/session" + "github.com/bettercap/bettercap/v2/packets" + "github.com/bettercap/bettercap/v2/session" "github.com/google/gopacket" "github.com/google/gopacket/layers" diff --git a/modules/net_sniff/net_sniff_ntlm.go b/modules/net_sniff/net_sniff_ntlm.go index 54a4fb22..5a3bfa5a 100644 --- a/modules/net_sniff/net_sniff_ntlm.go +++ b/modules/net_sniff/net_sniff_ntlm.go @@ -5,7 +5,7 @@ import ( "regexp" "strings" - "github.com/bettercap/bettercap/packets" + "github.com/bettercap/bettercap/v2/packets" "github.com/google/gopacket" "github.com/google/gopacket/layers" diff --git a/modules/net_sniff/net_sniff_parsers.go b/modules/net_sniff/net_sniff_parsers.go index 53019863..e89c7d1c 100644 --- a/modules/net_sniff/net_sniff_parsers.go +++ b/modules/net_sniff/net_sniff_parsers.go @@ -4,8 +4,8 @@ import ( "fmt" "net" - "github.com/bettercap/bettercap/log" - "github.com/bettercap/bettercap/packets" + "github.com/bettercap/bettercap/v2/log" + "github.com/bettercap/bettercap/v2/packets" "github.com/google/gopacket" "github.com/google/gopacket/layers" diff --git a/modules/net_sniff/net_sniff_stats.go b/modules/net_sniff/net_sniff_stats.go index b6dc245d..2cae1c21 100644 --- a/modules/net_sniff/net_sniff_stats.go +++ b/modules/net_sniff/net_sniff_stats.go @@ -1,8 +1,9 @@ package net_sniff import ( - "github.com/bettercap/bettercap/log" "time" + + "github.com/bettercap/bettercap/v2/log" ) type SnifferStats struct { diff --git a/modules/net_sniff/net_sniff_teamviewer.go b/modules/net_sniff/net_sniff_teamviewer.go index b6aebaa2..97ee3dd3 100644 --- a/modules/net_sniff/net_sniff_teamviewer.go +++ b/modules/net_sniff/net_sniff_teamviewer.go @@ -1,9 +1,10 @@ package net_sniff import ( - "github.com/bettercap/bettercap/packets" "net" + "github.com/bettercap/bettercap/v2/packets" + "github.com/google/gopacket" "github.com/google/gopacket/layers" diff --git a/modules/net_sniff/net_sniff_upnp.go b/modules/net_sniff/net_sniff_upnp.go index 1d7447df..056f136c 100644 --- a/modules/net_sniff/net_sniff_upnp.go +++ b/modules/net_sniff/net_sniff_upnp.go @@ -4,7 +4,7 @@ import ( "fmt" "net" - "github.com/bettercap/bettercap/packets" + "github.com/bettercap/bettercap/v2/packets" "github.com/google/gopacket" "github.com/google/gopacket/layers" diff --git a/modules/net_sniff/net_sniff_views.go b/modules/net_sniff/net_sniff_views.go index 74f36ecb..f930cf52 100644 --- a/modules/net_sniff/net_sniff_views.go +++ b/modules/net_sniff/net_sniff_views.go @@ -4,7 +4,7 @@ import ( "fmt" "net" - "github.com/bettercap/bettercap/session" + "github.com/bettercap/bettercap/v2/session" "github.com/evilsocket/islazy/tui" "github.com/google/gopacket/layers" diff --git a/modules/packet_proxy/packet_proxy_darwin.go b/modules/packet_proxy/packet_proxy_darwin.go index 0e464be0..86dab572 100644 --- a/modules/packet_proxy/packet_proxy_darwin.go +++ b/modules/packet_proxy/packet_proxy_darwin.go @@ -1,7 +1,7 @@ package packet_proxy import ( - "github.com/bettercap/bettercap/session" + "github.com/bettercap/bettercap/v2/session" ) type PacketProxy struct { diff --git a/modules/packet_proxy/packet_proxy_freebsd.go b/modules/packet_proxy/packet_proxy_freebsd.go index 0e464be0..86dab572 100644 --- a/modules/packet_proxy/packet_proxy_freebsd.go +++ b/modules/packet_proxy/packet_proxy_freebsd.go @@ -1,7 +1,7 @@ package packet_proxy import ( - "github.com/bettercap/bettercap/session" + "github.com/bettercap/bettercap/v2/session" ) type PacketProxy struct { diff --git a/modules/packet_proxy/packet_proxy_linux.go b/modules/packet_proxy/packet_proxy_linux.go index 9cf28023..e124976c 100644 --- a/modules/packet_proxy/packet_proxy_linux.go +++ b/modules/packet_proxy/packet_proxy_linux.go @@ -1,15 +1,15 @@ package packet_proxy import ( + "context" "fmt" "plugin" - "context" "strings" "syscall" "time" - "github.com/bettercap/bettercap/core" - "github.com/bettercap/bettercap/session" + "github.com/bettercap/bettercap/v2/core" + "github.com/bettercap/bettercap/v2/session" nfqueue "github.com/florianl/go-nfqueue/v2" @@ -139,12 +139,12 @@ func (mod *PacketProxy) Configure() (err error) { if !fs.Exists(mod.pluginPath) { return fmt.Errorf("%s does not exist.", mod.pluginPath) } - + mod.Info("loading packet proxy plugin from %s ...", mod.pluginPath) - + var ok bool var sym plugin.Symbol - + if mod.plugin, err = plugin.Open(mod.pluginPath); err != nil { return } else if sym, err = mod.plugin.Lookup("OnPacket"); err != nil { @@ -152,7 +152,7 @@ func (mod *PacketProxy) Configure() (err error) { } else if mod.queueCb, ok = sym.(func(nfqueue.Attribute) int); !ok { return fmt.Errorf("Symbol OnPacket is not a valid callback function.") } - + if sym, err = mod.plugin.Lookup("OnStart"); err == nil { var onStartCb func() int if onStartCb, ok = sym.(func() int); !ok { @@ -168,10 +168,10 @@ func (mod *PacketProxy) Configure() (err error) { mod.Warning("no plugin set") } - config := nfqueue.Config { - NfQueue: uint16(mod.queueNum), - Copymode: nfqueue.NfQnlCopyPacket, - AfFamily: syscall.AF_INET, + config := nfqueue.Config{ + NfQueue: uint16(mod.queueNum), + Copymode: nfqueue.NfQnlCopyPacket, + AfFamily: syscall.AF_INET, MaxPacketLen: 0xFFFF, MaxQueueLen: 0xFF, WriteTimeout: 15 * time.Millisecond, @@ -187,8 +187,8 @@ func (mod *PacketProxy) Configure() (err error) { mod.Error("%v", e) return -1 }); err != nil { - return - } + return + } return nil } diff --git a/modules/packet_proxy/packet_proxy_windows.go b/modules/packet_proxy/packet_proxy_windows.go index 0e464be0..86dab572 100644 --- a/modules/packet_proxy/packet_proxy_windows.go +++ b/modules/packet_proxy/packet_proxy_windows.go @@ -1,7 +1,7 @@ package packet_proxy import ( - "github.com/bettercap/bettercap/session" + "github.com/bettercap/bettercap/v2/session" ) type PacketProxy struct { diff --git a/modules/syn_scan/syn_scan.go b/modules/syn_scan/syn_scan.go index 0ce89954..ab5be259 100644 --- a/modules/syn_scan/syn_scan.go +++ b/modules/syn_scan/syn_scan.go @@ -7,9 +7,9 @@ import ( "sync/atomic" "time" - "github.com/bettercap/bettercap/network" - "github.com/bettercap/bettercap/packets" - "github.com/bettercap/bettercap/session" + "github.com/bettercap/bettercap/v2/network" + "github.com/bettercap/bettercap/v2/packets" + "github.com/bettercap/bettercap/v2/session" "github.com/evilsocket/islazy/async" diff --git a/modules/syn_scan/syn_scan_event.go b/modules/syn_scan/syn_scan_event.go index ae58ce40..5840b1dd 100644 --- a/modules/syn_scan/syn_scan_event.go +++ b/modules/syn_scan/syn_scan_event.go @@ -1,8 +1,8 @@ package syn_scan import ( - "github.com/bettercap/bettercap/network" - "github.com/bettercap/bettercap/session" + "github.com/bettercap/bettercap/v2/network" + "github.com/bettercap/bettercap/v2/session" ) type SynScanEvent struct { diff --git a/modules/syn_scan/syn_scan_reader.go b/modules/syn_scan/syn_scan_reader.go index b4c36584..51843a21 100644 --- a/modules/syn_scan/syn_scan_reader.go +++ b/modules/syn_scan/syn_scan_reader.go @@ -3,7 +3,7 @@ package syn_scan import ( "sync/atomic" - "github.com/bettercap/bettercap/network" + "github.com/bettercap/bettercap/v2/network" "github.com/google/gopacket" "github.com/google/gopacket/layers" @@ -28,8 +28,6 @@ func (mod *SynScanner) onPacket(pkt gopacket.Packet) { var ip6 layers.IPv6 var tcp layers.TCP - - isIPv6 := false foundLayerTypes := []gopacket.LayerType{} parser := gopacket.NewDecodingLayerParser( diff --git a/modules/tcp_proxy/tcp_proxy.go b/modules/tcp_proxy/tcp_proxy.go index bb4bf736..2af934b8 100644 --- a/modules/tcp_proxy/tcp_proxy.go +++ b/modules/tcp_proxy/tcp_proxy.go @@ -6,8 +6,8 @@ import ( "net" "sync" - "github.com/bettercap/bettercap/firewall" - "github.com/bettercap/bettercap/session" + "github.com/bettercap/bettercap/v2/firewall" + "github.com/bettercap/bettercap/v2/session" "github.com/robertkrimen/otto" ) diff --git a/modules/tcp_proxy/tcp_proxy_script.go b/modules/tcp_proxy/tcp_proxy_script.go index f4f07d88..fa801be5 100644 --- a/modules/tcp_proxy/tcp_proxy_script.go +++ b/modules/tcp_proxy/tcp_proxy_script.go @@ -4,8 +4,8 @@ import ( "net" "strings" - "github.com/bettercap/bettercap/log" - "github.com/bettercap/bettercap/session" + "github.com/bettercap/bettercap/v2/log" + "github.com/bettercap/bettercap/v2/session" "github.com/evilsocket/islazy/plugin" diff --git a/modules/ticker/ticker.go b/modules/ticker/ticker.go index 3a26d20b..3ae8515b 100644 --- a/modules/ticker/ticker.go +++ b/modules/ticker/ticker.go @@ -3,7 +3,7 @@ package ticker import ( "time" - "github.com/bettercap/bettercap/session" + "github.com/bettercap/bettercap/v2/session" ) type Ticker struct { @@ -72,7 +72,7 @@ func (mod *Ticker) Configure() error { return nil } -type TickEvent struct {} +type TickEvent struct{} func (mod *Ticker) Start() error { if err := mod.Configure(); err != nil { diff --git a/modules/ui/ui.go b/modules/ui/ui.go index 7bc5270f..0e29a525 100644 --- a/modules/ui/ui.go +++ b/modules/ui/ui.go @@ -11,7 +11,7 @@ import ( "regexp" "runtime" - "github.com/bettercap/bettercap/session" + "github.com/bettercap/bettercap/v2/session" "github.com/google/go-github/github" diff --git a/modules/update/update.go b/modules/update/update.go index bd0e37f8..7681773e 100644 --- a/modules/update/update.go +++ b/modules/update/update.go @@ -6,8 +6,8 @@ import ( "strconv" "strings" - "github.com/bettercap/bettercap/core" - "github.com/bettercap/bettercap/session" + "github.com/bettercap/bettercap/v2/core" + "github.com/bettercap/bettercap/v2/session" "github.com/google/go-github/github" diff --git a/modules/utils/view_selector.go b/modules/utils/view_selector.go index ec6347fe..476bcd9a 100644 --- a/modules/utils/view_selector.go +++ b/modules/utils/view_selector.go @@ -6,7 +6,7 @@ import ( "regexp" "strings" - "github.com/bettercap/bettercap/session" + "github.com/bettercap/bettercap/v2/session" "github.com/evilsocket/islazy/tui" ) diff --git a/modules/wifi/wifi.go b/modules/wifi/wifi.go index 377227d8..45c6cddf 100644 --- a/modules/wifi/wifi.go +++ b/modules/wifi/wifi.go @@ -9,10 +9,10 @@ import ( "sync" "time" - "github.com/bettercap/bettercap/modules/utils" - "github.com/bettercap/bettercap/network" - "github.com/bettercap/bettercap/packets" - "github.com/bettercap/bettercap/session" + "github.com/bettercap/bettercap/v2/modules/utils" + "github.com/bettercap/bettercap/v2/network" + "github.com/bettercap/bettercap/v2/packets" + "github.com/bettercap/bettercap/v2/session" "github.com/google/gopacket" "github.com/google/gopacket/layers" @@ -580,9 +580,9 @@ func (mod *WiFiModule) Configure() error { // second fatal error, just bail return fmt.Errorf("error while activating handle: %s", err) } else { - // first fatal error, forcing monitor mode + // first fatal error, forcing monitor mode // https://github.com/bettercap/bettercap/issues/819 - opts.Monitor = false; + opts.Monitor = false if err := network.ForceMonitorMode(ifName); err != nil { return err } diff --git a/modules/wifi/wifi_ap.go b/modules/wifi/wifi_ap.go index 7a5ed0b7..9a29c1db 100644 --- a/modules/wifi/wifi_ap.go +++ b/modules/wifi/wifi_ap.go @@ -5,9 +5,9 @@ import ( "net" "time" - "github.com/bettercap/bettercap/network" - "github.com/bettercap/bettercap/packets" - "github.com/bettercap/bettercap/session" + "github.com/bettercap/bettercap/v2/network" + "github.com/bettercap/bettercap/v2/packets" + "github.com/bettercap/bettercap/v2/session" "github.com/evilsocket/islazy/tui" ) diff --git a/modules/wifi/wifi_assoc.go b/modules/wifi/wifi_assoc.go index 41018b01..9c69b32a 100644 --- a/modules/wifi/wifi_assoc.go +++ b/modules/wifi/wifi_assoc.go @@ -6,8 +6,8 @@ import ( "net" "sort" - "github.com/bettercap/bettercap/network" - "github.com/bettercap/bettercap/packets" + "github.com/bettercap/bettercap/v2/network" + "github.com/bettercap/bettercap/v2/packets" ) func (mod *WiFiModule) sendAssocPacket(ap *network.AccessPoint) { diff --git a/modules/wifi/wifi_csa.go b/modules/wifi/wifi_csa.go index 20fb3590..e8784efc 100644 --- a/modules/wifi/wifi_csa.go +++ b/modules/wifi/wifi_csa.go @@ -3,10 +3,11 @@ package wifi import ( "bytes" "fmt" - "github.com/bettercap/bettercap/network" - "github.com/bettercap/bettercap/packets" - "github.com/google/gopacket/layers" "net" + + "github.com/bettercap/bettercap/v2/network" + "github.com/bettercap/bettercap/v2/packets" + "github.com/google/gopacket/layers" ) func (mod *WiFiModule) isCSASilent() bool { diff --git a/modules/wifi/wifi_deauth.go b/modules/wifi/wifi_deauth.go index b7c61bb1..6b8f291b 100644 --- a/modules/wifi/wifi_deauth.go +++ b/modules/wifi/wifi_deauth.go @@ -6,8 +6,8 @@ import ( "net" "sort" - "github.com/bettercap/bettercap/network" - "github.com/bettercap/bettercap/packets" + "github.com/bettercap/bettercap/v2/network" + "github.com/bettercap/bettercap/v2/packets" ) func (mod *WiFiModule) sendDeauthPacket(ap net.HardwareAddr, client net.HardwareAddr) { diff --git a/modules/wifi/wifi_events.go b/modules/wifi/wifi_events.go index 1fbe8cde..b20ab2c2 100644 --- a/modules/wifi/wifi_events.go +++ b/modules/wifi/wifi_events.go @@ -1,7 +1,7 @@ package wifi import ( - "github.com/bettercap/bettercap/network" + "github.com/bettercap/bettercap/v2/network" ) type ClientEvent struct { diff --git a/modules/wifi/wifi_fake_auth.go b/modules/wifi/wifi_fake_auth.go index bafb88d9..950ff080 100644 --- a/modules/wifi/wifi_fake_auth.go +++ b/modules/wifi/wifi_fake_auth.go @@ -3,11 +3,11 @@ package wifi import ( "bytes" "fmt" - "github.com/bettercap/bettercap/network" - "github.com/bettercap/bettercap/packets" "net" -) + "github.com/bettercap/bettercap/v2/network" + "github.com/bettercap/bettercap/v2/packets" +) func (mod *WiFiModule) isFakeAuthSilent() bool { if err, is := mod.BoolParam("wifi.fake_auth.silent"); err != nil { @@ -18,18 +18,18 @@ func (mod *WiFiModule) isFakeAuthSilent() bool { return mod.csaSilent } -func(mod *WiFiModule)sendFakeAuthPacket(bssid,client net.HardwareAddr){ - err,pkt:=packets.NewDot11Auth(client,bssid,0) - if err!=nil{ +func (mod *WiFiModule) sendFakeAuthPacket(bssid, client net.HardwareAddr) { + err, pkt := packets.NewDot11Auth(client, bssid, 0) + if err != nil { mod.Error("could not create authentication packet: %s", err) return } - for i:=0;i<32;i++{ + for i := 0; i < 32; i++ { mod.injectPacket(pkt) } } -func (mod *WiFiModule) startFakeAuth(bssid,client net.HardwareAddr) error { +func (mod *WiFiModule) startFakeAuth(bssid, client net.HardwareAddr) error { // if not already running, temporarily enable the pcap handle // for packet injection if !mod.Running() { @@ -63,9 +63,9 @@ func (mod *WiFiModule) startFakeAuth(bssid,client net.HardwareAddr) error { logger("fake authentication attack in AP: %s client: %s", ap.ESSID(), client.String()) // send the beacon frame with channel switch announce element id mod.onChannel(ap.Channel, func() { - mod.sendFakeAuthPacket(bssid,client) + mod.sendFakeAuthPacket(bssid, client) }) } }() return nil -} \ No newline at end of file +} diff --git a/modules/wifi/wifi_hopping.go b/modules/wifi/wifi_hopping.go index 8d5abf27..43b5fe7d 100644 --- a/modules/wifi/wifi_hopping.go +++ b/modules/wifi/wifi_hopping.go @@ -4,7 +4,7 @@ import ( "net" "time" - "github.com/bettercap/bettercap/network" + "github.com/bettercap/bettercap/v2/network" ) func (mod *WiFiModule) isInterfaceConnected() bool { diff --git a/modules/wifi/wifi_recon.go b/modules/wifi/wifi_recon.go index c407d965..4d837d5f 100644 --- a/modules/wifi/wifi_recon.go +++ b/modules/wifi/wifi_recon.go @@ -5,8 +5,8 @@ import ( "net" "time" - "github.com/bettercap/bettercap/network" - "github.com/bettercap/bettercap/packets" + "github.com/bettercap/bettercap/v2/network" + "github.com/bettercap/bettercap/v2/packets" "github.com/google/gopacket" "github.com/google/gopacket/layers" diff --git a/modules/wifi/wifi_recon_handshakes.go b/modules/wifi/wifi_recon_handshakes.go index e463fd6b..b1e382f7 100644 --- a/modules/wifi/wifi_recon_handshakes.go +++ b/modules/wifi/wifi_recon_handshakes.go @@ -3,11 +3,12 @@ package wifi import ( "bytes" "fmt" - "github.com/bettercap/bettercap/network" "net" "path" - "github.com/bettercap/bettercap/packets" + "github.com/bettercap/bettercap/v2/network" + + "github.com/bettercap/bettercap/v2/packets" "github.com/google/gopacket" "github.com/google/gopacket/layers" @@ -135,8 +136,8 @@ func (mod *WiFiModule) discoverHandshakes(radiotap *layers.RadioTap, dot11 *laye // quick and dirty heuristic, see thread here https://github.com/bettercap/bettercap/issues/810#issuecomment-805145392 if isEAPOL || (dot11.Type.MainType() != layers.Dot11TypeData && dot11.Type.MainType() != layers.Dot11TypeCtrl) { - target := (* network.Station)(nil) - targetAP := (* network.AccessPoint)(nil) + target := (*network.Station)(nil) + targetAP := (*network.AccessPoint)(nil) // collect target bssids bssids := make([]net.HardwareAddr, 0) diff --git a/modules/wifi/wifi_show.go b/modules/wifi/wifi_show.go index 9b9127cd..7337eb3d 100644 --- a/modules/wifi/wifi_show.go +++ b/modules/wifi/wifi_show.go @@ -7,9 +7,9 @@ import ( "strings" "time" - "github.com/bettercap/bettercap/modules/net_recon" - "github.com/bettercap/bettercap/network" - "github.com/bettercap/bettercap/session" + "github.com/bettercap/bettercap/v2/modules/net_recon" + "github.com/bettercap/bettercap/v2/network" + "github.com/bettercap/bettercap/v2/session" "github.com/dustin/go-humanize" diff --git a/modules/wifi/wifi_show_sort.go b/modules/wifi/wifi_show_sort.go index d69171d0..7f04ee19 100644 --- a/modules/wifi/wifi_show_sort.go +++ b/modules/wifi/wifi_show_sort.go @@ -1,8 +1,8 @@ package wifi import ( - "github.com/bettercap/bettercap/network" - "github.com/bettercap/bettercap/session" + "github.com/bettercap/bettercap/v2/network" + "github.com/bettercap/bettercap/v2/session" ) type ByRSSISorter []*network.Station diff --git a/modules/wol/wol.go b/modules/wol/wol.go index 2f9e1f66..12418066 100644 --- a/modules/wol/wol.go +++ b/modules/wol/wol.go @@ -5,8 +5,8 @@ import ( "net" "regexp" - "github.com/bettercap/bettercap/packets" - "github.com/bettercap/bettercap/session" + "github.com/bettercap/bettercap/v2/packets" + "github.com/bettercap/bettercap/v2/session" "github.com/google/gopacket/layers" diff --git a/network/arp.go b/network/arp.go index e22aec77..9bab10b6 100644 --- a/network/arp.go +++ b/network/arp.go @@ -5,7 +5,7 @@ import ( "strings" "sync" - "github.com/bettercap/bettercap/core" + "github.com/bettercap/bettercap/v2/core" ) type ArpTable map[string]string diff --git a/network/meta.go b/network/meta.go index ecb75c43..08d66131 100644 --- a/network/meta.go +++ b/network/meta.go @@ -7,7 +7,7 @@ import ( "strings" "sync" - "github.com/bettercap/bettercap/core" + "github.com/bettercap/bettercap/v2/core" ) type Meta struct { diff --git a/network/net.go b/network/net.go index d6d599c8..bb887f38 100644 --- a/network/net.go +++ b/network/net.go @@ -7,7 +7,7 @@ import ( "regexp" "strings" - "github.com/bettercap/bettercap/core" + "github.com/bettercap/bettercap/v2/core" "github.com/evilsocket/islazy/data" "github.com/evilsocket/islazy/str" diff --git a/network/net_gateway.go b/network/net_gateway.go index 6255b288..a00eb51d 100644 --- a/network/net_gateway.go +++ b/network/net_gateway.go @@ -1,9 +1,10 @@ +//go:build !android // +build !android package network import ( - "github.com/bettercap/bettercap/routing" + "github.com/bettercap/bettercap/v2/routing" ) func FindGateway(iface *Endpoint) (*Endpoint, error) { diff --git a/network/net_gateway_android.go b/network/net_gateway_android.go index 9e5caa0f..8a0c00d3 100644 --- a/network/net_gateway_android.go +++ b/network/net_gateway_android.go @@ -1,7 +1,7 @@ package network import ( - "github.com/bettercap/bettercap/core" + "github.com/bettercap/bettercap/v2/core" "github.com/evilsocket/islazy/str" ) @@ -24,4 +24,4 @@ func FindGateway(iface *Endpoint) (*Endpoint, error) { } return nil, ErrNoGateway -} \ No newline at end of file +} diff --git a/network/net_linux.go b/network/net_linux.go index d91a808f..f73f6b3f 100644 --- a/network/net_linux.go +++ b/network/net_linux.go @@ -8,7 +8,7 @@ import ( "strconv" "strings" - "github.com/bettercap/bettercap/core" + "github.com/bettercap/bettercap/v2/core" ) // see Windows version to understand why .... diff --git a/packets/dot11.go b/packets/dot11.go index b1ae89e5..cce9c981 100644 --- a/packets/dot11.go +++ b/packets/dot11.go @@ -4,7 +4,7 @@ import ( "bytes" "net" - "github.com/bettercap/bettercap/network" + "github.com/bettercap/bettercap/v2/network" "github.com/google/gopacket" "github.com/google/gopacket/layers" @@ -13,7 +13,7 @@ import ( var ( openFlags = 1057 wpaFlags = 1041 - specManFlag = 1<<8 + specManFlag = 1 << 8 durationID = uint16(0x013a) capabilityInfo = uint16(0x0411) listenInterval = uint16(3) diff --git a/packets/queue.go b/packets/queue.go index b8242ea9..c9c82cb3 100644 --- a/packets/queue.go +++ b/packets/queue.go @@ -7,7 +7,7 @@ import ( "sync" "sync/atomic" - "github.com/bettercap/bettercap/network" + "github.com/bettercap/bettercap/v2/network" "github.com/google/gopacket" "github.com/google/gopacket/layers" diff --git a/routing/update_darwin.go b/routing/update_darwin.go index 9417f7a5..a250bd43 100644 --- a/routing/update_darwin.go +++ b/routing/update_darwin.go @@ -4,7 +4,7 @@ import ( "regexp" "strings" - "github.com/bettercap/bettercap/core" + "github.com/bettercap/bettercap/v2/core" "github.com/evilsocket/islazy/str" ) diff --git a/routing/update_linux.go b/routing/update_linux.go index d4290f63..060b6177 100644 --- a/routing/update_linux.go +++ b/routing/update_linux.go @@ -4,7 +4,7 @@ import ( "regexp" "strings" - "github.com/bettercap/bettercap/core" + "github.com/bettercap/bettercap/v2/core" "github.com/evilsocket/islazy/str" ) diff --git a/routing/update_windows.go b/routing/update_windows.go index 8ae28fea..41fcdc77 100644 --- a/routing/update_windows.go +++ b/routing/update_windows.go @@ -1,10 +1,11 @@ package routing import ( - "github.com/bettercap/bettercap/core" - "github.com/evilsocket/islazy/str" "regexp" "strings" + + "github.com/bettercap/bettercap/v2/core" + "github.com/evilsocket/islazy/str" ) var parser = regexp.MustCompile(`^.+\d+\s+([^\s]+)\s+\d+\s+(.+)$`) diff --git a/session/script.go b/session/script.go index 15efcfd5..914a7a17 100644 --- a/session/script.go +++ b/session/script.go @@ -7,8 +7,8 @@ import ( "regexp" "strings" - "github.com/bettercap/bettercap/caplets" - _ "github.com/bettercap/bettercap/js" + "github.com/bettercap/bettercap/v2/caplets" + _ "github.com/bettercap/bettercap/v2/js" "github.com/evilsocket/islazy/fs" "github.com/evilsocket/islazy/plugin" diff --git a/session/script_builtin.go b/session/script_builtin.go index 22424eb7..e4caa680 100644 --- a/session/script_builtin.go +++ b/session/script_builtin.go @@ -1,7 +1,7 @@ package session import ( - "github.com/bettercap/bettercap/js" + "github.com/bettercap/bettercap/v2/js" "github.com/robertkrimen/otto" ) @@ -30,4 +30,3 @@ func jsEnvFunc(call otto.FunctionCall) otto.Value { } return js.NullValue } - diff --git a/session/script_builtin_runtime.go b/session/script_builtin_runtime.go index c39b4651..5394315c 100644 --- a/session/script_builtin_runtime.go +++ b/session/script_builtin_runtime.go @@ -5,7 +5,7 @@ import ( "io/ioutil" "os" - "github.com/bettercap/bettercap/js" + "github.com/bettercap/bettercap/v2/js" "github.com/evilsocket/islazy/fs" "github.com/evilsocket/islazy/log" "github.com/robertkrimen/otto" diff --git a/session/session.go b/session/session.go index 9991842b..76c2df01 100644 --- a/session/session.go +++ b/session/session.go @@ -14,11 +14,11 @@ import ( "github.com/bettercap/readline" - "github.com/bettercap/bettercap/caplets" - "github.com/bettercap/bettercap/core" - "github.com/bettercap/bettercap/firewall" - "github.com/bettercap/bettercap/network" - "github.com/bettercap/bettercap/packets" + "github.com/bettercap/bettercap/v2/caplets" + "github.com/bettercap/bettercap/v2/core" + "github.com/bettercap/bettercap/v2/firewall" + "github.com/bettercap/bettercap/v2/network" + "github.com/bettercap/bettercap/v2/packets" "github.com/evilsocket/islazy/data" "github.com/evilsocket/islazy/fs" diff --git a/session/session_completers.go b/session/session_completers.go index dcf2d0fd..fe3e5d33 100644 --- a/session/session_completers.go +++ b/session/session_completers.go @@ -3,7 +3,7 @@ package session import ( "strings" - "github.com/bettercap/bettercap/network" + "github.com/bettercap/bettercap/v2/network" ) func prefixMatches(prefix, what string) bool { diff --git a/session/session_core_handlers.go b/session/session_core_handlers.go index 538af5b4..2b47f641 100644 --- a/session/session_core_handlers.go +++ b/session/session_core_handlers.go @@ -12,8 +12,8 @@ import ( "strings" "time" - "github.com/bettercap/bettercap/core" - "github.com/bettercap/bettercap/network" + "github.com/bettercap/bettercap/v2/core" + "github.com/bettercap/bettercap/v2/network" "github.com/bettercap/readline" "github.com/evilsocket/islazy/str" diff --git a/session/session_json.go b/session/session_json.go index f1dd17e8..6ee9e2fd 100644 --- a/session/session_json.go +++ b/session/session_json.go @@ -6,10 +6,10 @@ import ( "runtime" "time" - "github.com/bettercap/bettercap/caplets" - "github.com/bettercap/bettercap/core" - "github.com/bettercap/bettercap/network" - "github.com/bettercap/bettercap/packets" + "github.com/bettercap/bettercap/v2/caplets" + "github.com/bettercap/bettercap/v2/core" + "github.com/bettercap/bettercap/v2/network" + "github.com/bettercap/bettercap/v2/packets" ) var flagNames = []string{ diff --git a/session/session_routing.go b/session/session_routing.go index a280b5f6..1d0a8af1 100644 --- a/session/session_routing.go +++ b/session/session_routing.go @@ -1,10 +1,11 @@ package session import ( - "github.com/bettercap/bettercap/network" - "github.com/bettercap/bettercap/routing" - "github.com/evilsocket/islazy/log" "time" + + "github.com/bettercap/bettercap/v2/network" + "github.com/bettercap/bettercap/v2/routing" + "github.com/evilsocket/islazy/log" ) type gateway struct { diff --git a/session/session_setup.go b/session/session_setup.go index d9046b40..889fe28d 100644 --- a/session/session_setup.go +++ b/session/session_setup.go @@ -8,7 +8,7 @@ import ( "syscall" "time" - "github.com/bettercap/bettercap/caplets" + "github.com/bettercap/bettercap/v2/caplets" "github.com/bettercap/readline" diff --git a/tls/cert.go b/tls/cert.go index acb585e8..099c9b7a 100644 --- a/tls/cert.go +++ b/tls/cert.go @@ -11,7 +11,7 @@ import ( "strconv" "time" - "github.com/bettercap/bettercap/session" + "github.com/bettercap/bettercap/v2/session" ) type CertConfig struct { diff --git a/tls/sign.go b/tls/sign.go index c2cdbe74..2ce59fff 100644 --- a/tls/sign.go +++ b/tls/sign.go @@ -11,7 +11,7 @@ import ( "net" "time" - "github.com/bettercap/bettercap/log" + "github.com/bettercap/bettercap/v2/log" ) func getServerCertificate(host string, port int) *x509.Certificate {