mirror of
https://github.com/bettercap/bettercap
synced 2025-08-19 21:13:18 -07:00
misc: small fix or general refactoring i did not bother commenting
This commit is contained in:
parent
ed78c2ffd5
commit
76a537984d
4 changed files with 70 additions and 50 deletions
12
build.sh
12
build.sh
|
@ -166,12 +166,12 @@ mkdir $BUILD_FOLDER
|
|||
cd $BUILD_FOLDER
|
||||
|
||||
# build_android_arm bettercap_android_arm_$VERSION
|
||||
build_linux_amd64 bettercap_linux_amd64_$VERSION
|
||||
build_linux_arm7 bettercap_linux_arm7_$VERSION
|
||||
build_linux_mips bettercap_linux_mips_$VERSION
|
||||
build_linux_mipsle bettercap_linux_mipsle_$VERSION
|
||||
build_linux_mips64 bettercap_linux_mips64_$VERSION
|
||||
build_linux_mips64le bettercap_linux_mips64le_$VERSION
|
||||
# build_linux_amd64 bettercap_linux_amd64_$VERSION
|
||||
# build_linux_arm7 bettercap_linux_arm7_$VERSION
|
||||
# build_linux_mips bettercap_linux_mips_$VERSION
|
||||
# build_linux_mipsle bettercap_linux_mipsle_$VERSION
|
||||
# build_linux_mips64 bettercap_linux_mips64_$VERSION
|
||||
# build_linux_mips64le bettercap_linux_mips64le_$VERSION
|
||||
build_macos_amd64 bettercap_macos_amd64_$VERSION
|
||||
build_windows_amd64 bettercap_windows_amd64_$VERSION.exe
|
||||
sha256sum * > checksums.txt
|
||||
|
|
|
@ -139,50 +139,6 @@ func (s EventsStream) viewSnifferEvent(e session.Event) {
|
|||
misc)
|
||||
}
|
||||
|
||||
func (s EventsStream) viewBLEEvent(e session.Event) {
|
||||
if e.Tag == "ble.device.new" {
|
||||
dev := e.Data.(*network.BLEDevice)
|
||||
name := dev.Device.Name()
|
||||
if name != "" {
|
||||
name = " " + core.Bold(name)
|
||||
}
|
||||
vend := dev.Vendor
|
||||
if vend != "" {
|
||||
vend = fmt.Sprintf(" (%s)", core.Yellow(vend))
|
||||
}
|
||||
|
||||
fmt.Printf("[%s] [%s] New BLE device%s detected as %s%s %s.\n",
|
||||
e.Time.Format(eventTimeFormat),
|
||||
core.Green(e.Tag),
|
||||
name,
|
||||
dev.Device.ID(),
|
||||
vend,
|
||||
core.Dim(fmt.Sprintf("%d dBm", dev.RSSI)))
|
||||
} else if e.Tag == "ble.device.lost" {
|
||||
dev := e.Data.(*network.BLEDevice)
|
||||
name := dev.Device.Name()
|
||||
if name != "" {
|
||||
name = " " + core.Bold(name)
|
||||
}
|
||||
vend := dev.Vendor
|
||||
if vend != "" {
|
||||
vend = fmt.Sprintf(" (%s)", core.Yellow(vend))
|
||||
}
|
||||
|
||||
fmt.Printf("[%s] [%s] BLE device%s %s%s lost.\n",
|
||||
e.Time.Format(eventTimeFormat),
|
||||
core.Green(e.Tag),
|
||||
name,
|
||||
dev.Device.ID(),
|
||||
vend)
|
||||
} else {
|
||||
fmt.Printf("[%s] [%s] %v\n",
|
||||
e.Time.Format(eventTimeFormat),
|
||||
core.Green(e.Tag),
|
||||
e.Data)
|
||||
}
|
||||
}
|
||||
|
||||
func (s EventsStream) viewSynScanEvent(e session.Event) {
|
||||
se := e.Data.(SynScanEvent)
|
||||
fmt.Printf("[%s] [%s] Found open port %d for %s\n",
|
||||
|
|
55
modules/events_view_ble.go
Normal file
55
modules/events_view_ble.go
Normal file
|
@ -0,0 +1,55 @@
|
|||
// +build !windows
|
||||
|
||||
package modules
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/bettercap/bettercap/core"
|
||||
"github.com/bettercap/bettercap/network"
|
||||
"github.com/bettercap/bettercap/session"
|
||||
)
|
||||
|
||||
func (s EventsStream) viewBLEEvent(e session.Event) {
|
||||
if e.Tag == "ble.device.new" {
|
||||
dev := e.Data.(*network.BLEDevice)
|
||||
name := dev.Device.Name()
|
||||
if name != "" {
|
||||
name = " " + core.Bold(name)
|
||||
}
|
||||
vend := dev.Vendor
|
||||
if vend != "" {
|
||||
vend = fmt.Sprintf(" (%s)", core.Yellow(vend))
|
||||
}
|
||||
|
||||
fmt.Printf("[%s] [%s] New BLE device%s detected as %s%s %s.\n",
|
||||
e.Time.Format(eventTimeFormat),
|
||||
core.Green(e.Tag),
|
||||
name,
|
||||
dev.Device.ID(),
|
||||
vend,
|
||||
core.Dim(fmt.Sprintf("%d dBm", dev.RSSI)))
|
||||
} else if e.Tag == "ble.device.lost" {
|
||||
dev := e.Data.(*network.BLEDevice)
|
||||
name := dev.Device.Name()
|
||||
if name != "" {
|
||||
name = " " + core.Bold(name)
|
||||
}
|
||||
vend := dev.Vendor
|
||||
if vend != "" {
|
||||
vend = fmt.Sprintf(" (%s)", core.Yellow(vend))
|
||||
}
|
||||
|
||||
fmt.Printf("[%s] [%s] BLE device%s %s%s lost.\n",
|
||||
e.Time.Format(eventTimeFormat),
|
||||
core.Green(e.Tag),
|
||||
name,
|
||||
dev.Device.ID(),
|
||||
vend)
|
||||
} else {
|
||||
fmt.Printf("[%s] [%s] %v\n",
|
||||
e.Time.Format(eventTimeFormat),
|
||||
core.Green(e.Tag),
|
||||
e.Data)
|
||||
}
|
||||
}
|
9
modules/events_view_ble_windows.go
Normal file
9
modules/events_view_ble_windows.go
Normal file
|
@ -0,0 +1,9 @@
|
|||
package modules
|
||||
|
||||
import (
|
||||
"github.com/bettercap/bettercap/session"
|
||||
)
|
||||
|
||||
func (s EventsStream) viewBLEEvent(e session.Event) {
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue