mirror of
https://github.com/bettercap/bettercap
synced 2025-08-20 21:43:18 -07:00
Merge branch 'master' of github.com:evilsocket/bettercap-ng
This commit is contained in:
commit
b614f195c5
3 changed files with 4 additions and 3 deletions
|
@ -93,6 +93,7 @@ func (p *ArpSpoofer) getMAC(ip net.IP, probe bool) (net.HardwareAddr, error) {
|
||||||
return nil, fmt.Errorf("Could not find hardware address for %s.", ip.String())
|
return nil, fmt.Errorf("Could not find hardware address for %s.", ip.String())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mac = network.NormalizeMac(mac)
|
||||||
hw, err = net.ParseMAC(mac)
|
hw, err = net.ParseMAC(mac)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("Error while parsing hardware address '%s' for %s: %s", mac, ip.String(), err)
|
return nil, fmt.Errorf("Error while parsing hardware address '%s' for %s: %s", mac, ip.String(), err)
|
||||||
|
|
|
@ -35,7 +35,7 @@ func ip2int(ip net.IP) uint32 {
|
||||||
return binary.BigEndian.Uint32(ip)
|
return binary.BigEndian.Uint32(ip)
|
||||||
}
|
}
|
||||||
|
|
||||||
func normalizeMac(mac string) string {
|
func NormalizeMac(mac string) string {
|
||||||
parts := strings.Split(mac, ":")
|
parts := strings.Split(mac, ":")
|
||||||
for i, p := range parts {
|
for i, p := range parts {
|
||||||
if len(p) < 2 {
|
if len(p) < 2 {
|
||||||
|
@ -47,7 +47,7 @@ func normalizeMac(mac string) string {
|
||||||
|
|
||||||
func NewEndpointNoResolve(ip, mac, name string, bits uint32) *Endpoint {
|
func NewEndpointNoResolve(ip, mac, name string, bits uint32) *Endpoint {
|
||||||
addr := net.ParseIP(ip)
|
addr := net.ParseIP(ip)
|
||||||
mac = normalizeMac(mac)
|
mac = NormalizeMac(mac)
|
||||||
hw, _ := net.ParseMAC(mac)
|
hw, _ := net.ParseMAC(mac)
|
||||||
now := time.Now()
|
now := time.Now()
|
||||||
|
|
||||||
|
|
|
@ -83,7 +83,7 @@ func netOuiDat() (*asset, error) {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
info := bindataFileInfo{name: "net/oui.dat", size: 585353, mode: os.FileMode(420), modTime: time.Unix(1515886539, 0)}
|
info := bindataFileInfo{name: "net/oui.dat", size: 585353, mode: os.FileMode(420), modTime: time.Unix(1516884015, 0)}
|
||||||
a := &asset{bytes: bytes, info: info}
|
a := &asset{bytes: bytes, info: info}
|
||||||
return a, nil
|
return a, nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue