mirror of
https://github.com/bettercap/bettercap
synced 2025-07-10 23:33:28 -07:00
balls
This commit is contained in:
parent
d514721a2e
commit
7efd0c1103
1 changed files with 5 additions and 0 deletions
|
@ -13,12 +13,14 @@ import (
|
|||
const MonitorModeAddress = "0.0.0.0"
|
||||
|
||||
func FindInterface(name string) (*Endpoint, error) {
|
||||
fmt.Printf("FindInterface(%s)\n", name)
|
||||
ifaces, err := net.Interfaces()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
for _, iface := range ifaces {
|
||||
fmt.Printf(" %v\n", iface)
|
||||
mac := iface.HardwareAddr.String()
|
||||
addrs, err := iface.Addrs()
|
||||
if err != nil {
|
||||
|
@ -26,6 +28,7 @@ func FindInterface(name string) (*Endpoint, error) {
|
|||
continue
|
||||
}
|
||||
nAddrs := len(addrs)
|
||||
fmt.Printf(" %s\n", addrs)
|
||||
|
||||
/*
|
||||
* If no interface has been specified, return the first active
|
||||
|
@ -40,6 +43,8 @@ func FindInterface(name string) (*Endpoint, error) {
|
|||
doCheck = true
|
||||
}
|
||||
|
||||
fmt.Printf(" doCheck = %v\n", doCheck)
|
||||
|
||||
if doCheck {
|
||||
var e *Endpoint = nil
|
||||
// interface is in monitor mode (or it's just down and the user is dumb)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue