fix: using proper v2 package suffix (fixes #727)

This commit is contained in:
Simone Margaritelli 2024-08-09 18:19:21 +02:00
parent 76e136a18e
commit 2659a559c9
131 changed files with 318 additions and 297 deletions

View file

@ -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"
)

View file

@ -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"

View file

@ -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 {

2
go.mod
View file

@ -1,4 +1,4 @@
module github.com/bettercap/bettercap
module github.com/bettercap/bettercap/v2
go 1.16

View file

@ -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())
}
}

View file

@ -1,7 +1,7 @@
package log
import (
"github.com/bettercap/bettercap/session"
"github.com/bettercap/bettercap/v2/session"
ll "github.com/evilsocket/islazy/log"
)

View file

@ -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"

View file

@ -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 {

View file

@ -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"

View file

@ -11,7 +11,7 @@ import (
"strconv"
"strings"
"github.com/bettercap/bettercap/session"
"github.com/bettercap/bettercap/v2/session"
"github.com/gorilla/mux"
)

View file

@ -6,7 +6,7 @@ import (
"strings"
"time"
"github.com/bettercap/bettercap/session"
"github.com/bettercap/bettercap/v2/session"
"github.com/gorilla/websocket"
)

View file

@ -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"
)

View file

@ -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"

View file

@ -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"

View file

@ -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"

View file

@ -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

View file

@ -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 {

View file

@ -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 {

View file

@ -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"
)

View file

@ -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"

View file

@ -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"
)

View file

@ -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"

View file

@ -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"

View file

@ -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"

View file

@ -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"

View file

@ -1,7 +1,7 @@
package events_stream
import (
"github.com/bettercap/bettercap/session"
"github.com/bettercap/bettercap/v2/session"
"github.com/evilsocket/islazy/tui"
)

View file

@ -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"

View file

@ -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"
)

View file

@ -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) {

View file

@ -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"

View file

@ -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)
}
}

View file

@ -4,7 +4,7 @@ import (
"fmt"
"io"
"github.com/bettercap/bettercap/session"
"github.com/bettercap/bettercap/v2/session"
"github.com/evilsocket/islazy/tui"
)

View file

@ -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"
)

View file

@ -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"
)

View file

@ -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"
)

View file

@ -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"

View file

@ -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"

View file

@ -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) {

View file

@ -2,8 +2,9 @@ package graph
import (
"fmt"
"github.com/bettercap/bettercap/session"
"time"
"github.com/bettercap/bettercap/v2/session"
)
type EdgeType string

View file

@ -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)

View file

@ -1,7 +1,7 @@
package graph
import (
"github.com/bettercap/bettercap/log"
"github.com/bettercap/bettercap/v2/log"
)
type graphPackage struct{}

View file

@ -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"

View file

@ -1,7 +1,7 @@
package hid
import (
"github.com/bettercap/bettercap/network"
"github.com/bettercap/bettercap/v2/network"
)
const (

View file

@ -1,7 +1,7 @@
package hid
import (
"github.com/bettercap/bettercap/network"
"github.com/bettercap/bettercap/v2/network"
)
const (

View file

@ -3,7 +3,7 @@ package hid
import (
"fmt"
"github.com/bettercap/bettercap/network"
"github.com/bettercap/bettercap/v2/network"
)
type MicrosoftBuilder struct {

View file

@ -1,7 +1,7 @@
package hid
import (
"github.com/bettercap/bettercap/network"
"github.com/bettercap/bettercap/v2/network"
)
type FrameBuilder interface {

View file

@ -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"
)

View file

@ -4,7 +4,7 @@ import (
"fmt"
"time"
"github.com/bettercap/bettercap/network"
"github.com/bettercap/bettercap/v2/network"
"github.com/evilsocket/islazy/tui"

View file

@ -4,7 +4,7 @@ import (
"sort"
"time"
"github.com/bettercap/bettercap/network"
"github.com/bettercap/bettercap/v2/network"
"github.com/dustin/go-humanize"

View file

@ -1,7 +1,7 @@
package hid
import (
"github.com/bettercap/bettercap/network"
"github.com/bettercap/bettercap/v2/network"
)
type ByHIDMacSorter []*network.HIDDevice

View file

@ -5,7 +5,7 @@ import (
"fmt"
"time"
"github.com/bettercap/bettercap/network"
"github.com/bettercap/bettercap/v2/network"
"github.com/bettercap/nrf24"

View file

@ -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
}

View file

@ -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{}

View file

@ -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 {

View file

@ -9,7 +9,7 @@ import (
"regexp"
"strings"
"github.com/bettercap/bettercap/session"
"github.com/bettercap/bettercap/v2/session"
)
type JSRequest struct {

View file

@ -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"

View file

@ -7,7 +7,7 @@ import (
"strings"
"time"
"github.com/bettercap/bettercap/session"
"github.com/bettercap/bettercap/v2/session"
"github.com/evilsocket/islazy/tui"
)

View file

@ -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"

View file

@ -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"

View file

@ -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"
)

View file

@ -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"

View file

@ -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) {

View file

@ -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"
)

View file

@ -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 {

View file

@ -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"
)

View file

@ -6,7 +6,7 @@ import (
"log"
"net"
"github.com/bettercap/bettercap/packets"
"github.com/bettercap/bettercap/v2/packets"
"github.com/hashicorp/mdns"
)

View file

@ -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) {

View file

@ -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) {

View file

@ -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) {

View file

@ -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 {

View file

@ -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 (

View file

@ -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

View file

@ -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"

View file

@ -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"

View file

@ -4,7 +4,7 @@ import (
"fmt"
"time"
"github.com/bettercap/bettercap/session"
"github.com/bettercap/bettercap/v2/session"
)
type SniffData map[string]interface{}

View file

@ -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"

View file

@ -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"

View file

@ -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"

View file

@ -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"

View file

@ -1,8 +1,9 @@
package net_sniff
import (
"github.com/bettercap/bettercap/log"
"time"
"github.com/bettercap/bettercap/v2/log"
)
type SnifferStats struct {

View file

@ -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"

View file

@ -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"

View file

@ -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"

View file

@ -1,7 +1,7 @@
package packet_proxy
import (
"github.com/bettercap/bettercap/session"
"github.com/bettercap/bettercap/v2/session"
)
type PacketProxy struct {

View file

@ -1,7 +1,7 @@
package packet_proxy
import (
"github.com/bettercap/bettercap/session"
"github.com/bettercap/bettercap/v2/session"
)
type PacketProxy struct {

View file

@ -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
}

View file

@ -1,7 +1,7 @@
package packet_proxy
import (
"github.com/bettercap/bettercap/session"
"github.com/bettercap/bettercap/v2/session"
)
type PacketProxy struct {

View file

@ -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"

View file

@ -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 {

View file

@ -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(

View file

@ -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"
)

View file

@ -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"

View file

@ -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 {

View file

@ -11,7 +11,7 @@ import (
"regexp"
"runtime"
"github.com/bettercap/bettercap/session"
"github.com/bettercap/bettercap/v2/session"
"github.com/google/go-github/github"

View file

@ -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"

View file

@ -6,7 +6,7 @@ import (
"regexp"
"strings"
"github.com/bettercap/bettercap/session"
"github.com/bettercap/bettercap/v2/session"
"github.com/evilsocket/islazy/tui"
)

View file

@ -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
}

View file

@ -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"
)

View file

@ -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) {

View file

@ -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 {

Some files were not shown because too many files have changed in this diff Show more