mirror of
https://github.com/bettercap/bettercap
synced 2025-08-19 13:09:49 -07:00
Merge branch 'master' into hid_recon
This commit is contained in:
commit
c6987c1652
5 changed files with 25 additions and 10 deletions
|
@ -2,7 +2,7 @@ package core
|
||||||
|
|
||||||
const (
|
const (
|
||||||
Name = "bettercap"
|
Name = "bettercap"
|
||||||
Version = "2.16"
|
Version = "2.17"
|
||||||
Author = "Simone 'evilsocket' Margaritelli"
|
Author = "Simone 'evilsocket' Margaritelli"
|
||||||
Website = "https://bettercap.org/"
|
Website = "https://bettercap.org/"
|
||||||
)
|
)
|
||||||
|
|
|
@ -27,6 +27,13 @@ func UniqueInts(a []int, sorted bool) []int {
|
||||||
return uniq
|
return uniq
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func HasBinary(executable string) bool {
|
||||||
|
if path, err := exec.LookPath(executable); err != nil || path == "" {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
func ExecSilent(executable string, args []string) (string, error) {
|
func ExecSilent(executable string, args []string) (string, error) {
|
||||||
path, err := exec.LookPath(executable)
|
path, err := exec.LookPath(executable)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
@ -48,3 +48,7 @@ func (b *BLE) MarshalJSON() ([]byte, error) {
|
||||||
}
|
}
|
||||||
return json.Marshal(doc)
|
return json.Marshal(doc)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (b *BLE) EachDevice(cb func(mac string, d *BLEDevice)) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
|
@ -265,11 +265,13 @@ func FindInterface(name string) (*Endpoint, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func SetWiFiRegion(region string) error {
|
func SetWiFiRegion(region string) error {
|
||||||
|
if core.HasBinary("iw") {
|
||||||
if out, err := core.Exec("iw", []string{"reg", "set", region}); err != nil {
|
if out, err := core.Exec("iw", []string{"reg", "set", region}); err != nil {
|
||||||
return err
|
return err
|
||||||
} else if out != "" {
|
} else if out != "" {
|
||||||
return fmt.Errorf("unexpected output while setting WiFi region %s: %s", region, out)
|
return fmt.Errorf("unexpected output while setting WiFi region %s: %s", region, out)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -283,11 +285,13 @@ func ActivateInterface(name string) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
func SetInterfaceTxPower(name string, txpower int) error {
|
func SetInterfaceTxPower(name string, txpower int) error {
|
||||||
|
if core.HasBinary("iwconfig") {
|
||||||
if out, err := core.ExecSilent("iwconfig", []string{name, "txpower", fmt.Sprintf("%d", txpower)}); err != nil {
|
if out, err := core.ExecSilent("iwconfig", []string{name, "txpower", fmt.Sprintf("%d", txpower)}); err != nil {
|
||||||
return err
|
return err
|
||||||
} else if out != "" {
|
} else if out != "" {
|
||||||
return fmt.Errorf("unexpected output while setting txpower to %d for interface %s: %s", txpower, name, out)
|
return fmt.Errorf("unexpected output while setting txpower to %d for interface %s: %s", txpower, name, out)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
name: bettercap
|
name: bettercap
|
||||||
version: '2.16'
|
version: '2.17'
|
||||||
summary: 802.11, BLE and Ethernet networks reconnaissance and MITM attacks tool.
|
summary: 802.11, BLE and Ethernet networks reconnaissance and MITM attacks tool.
|
||||||
description: |
|
description: |
|
||||||
The Swiss Army knife for 802.11, BLE and Ethernet networks reconnaissance and MITM attacks.
|
The Swiss Army knife for 802.11, BLE and Ethernet networks reconnaissance and MITM attacks.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue