Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

panic runtime error #885

Closed
geekskunk opened this issue May 26, 2021 · 1 comment
Closed

panic runtime error #885

geekskunk opened this issue May 26, 2021 · 1 comment
Assignees

Comments

@geekskunk
Copy link

Description of the bug or feature request

panic runtime error (also seeing occasional invalid/non-ascii characters in stream, but not sure if related to the below or should be written as separate issue. Let me know if helpful to separate. See test-notes below for reference to invalid/non-ascii characters in stream

panic: runtime error: index out of range [6] with length 6

goroutine 117 [running]:
github.com/bettercap/bettercap/packets.dot11ParseWPSVendorExtension(0x3aad667, 0x6, 0x17, 0x451e168, 0x44c4960, 0xc)
go/src/github.com/bettercap/bettercap/packets/dot11_wps_attrs.go:180 +0x298
github.com/bettercap/bettercap/packets.dot11ParseWPSTag(0x61049, 0x3aad667, 0x6, 0x17, 0x451e168)
go/src/github.com/bettercap/bettercap/packets/dot11_wps.go:58 +0x168
github.com/bettercap/bettercap/packets.dot11ParseWPSData(0x3aad659, 0x14, 0x25, 0x1, 0x4)
go/src/github.com/bettercap/bettercap/packets/dot11_wps.go:87 +0x78
github.com/bettercap/bettercap/packets.Dot11ParseWPS(0xfe4ad8, 0x4081600, 0x3f33730, 0x387f2f0, 0x1, 0x4, 0xd314ee, 0x4)
go/src/github.com/bettercap/bettercap/packets/dot11_wps.go:101 +0x138
github.com/bettercap/bettercap/modules/wifi.(*WiFiModule).updateInfo(0x38ccd00, 0x3f33730, 0xfe4ad8, 0x4081600)
go/src/github.com/bettercap/bettercap/modules/wifi/wifi.go:606 +0xdc
github.com/bettercap/bettercap/modules/wifi.(*WiFiModule).Start.func1()
go/src/github.com/bettercap/bettercap/modules/wifi/wifi.go:680 +0x37c
created by github.com/bettercap/bettercap/session.(*SessionModule).SetRunning
go/src/github.com/bettercap/bettercap/session/module.go:285 +0x354

Environment

bettercap v2.31.1 (built for linux arm with go1.13.8)
Kernal 5.4.45 armv7l
Ubuntu 20.04.2 LTS

Caplet launched (with "-no-colors") and following items:
events.stream on
wifi.recon on
gps on
ble.recon on

Steps to Reproduce

  1. Ran for 1 hour+ last seen in log as follows:

[wifi.ap.new] wifi access point WorXld (-82 dBm) detected as 22:22:22:22:22:22.
[wifi.ap.new] wifi access point (-81 dBm) detected as 33:33:33:33:33:33.
[gps.new] latitude:99.999999 longitude:-99.999999 quality:Mode3D satellites:22 altitude:99.900000

Test notes

  • gps values adjusted, but original were valid
  • MAC and AP names changes, but "original" "WorXld" example should just be "World" (not sure why extra "X" is seen in AP name. But am seeing other errors in AP names (and occasional other non Ascii/non-printable characters in logs) but those often do not cause the Panic. The last few lines not notable different from other occasional non-perfect logs.

Actual behavior: What actually happened
Bettercap panic/stops and error above seen in terminal where caplet was launched.

@geekskunk
Copy link
Author

Another example if helpful:

panic: runtime error: index out of range [6] with length 6
goroutine 112 [running]:
github.com/bettercap/bettercap/packets.dot11ParseWPSVendorExtension(0x3ba0ff7, 0x6, 0x32, 0x3722af8, 0x3991ba0, 0xc)
go/src/github.com/bettercap/bettercap/packets/dot11_wps_attrs.go:180 +0x298
github.com/bettercap/bettercap/packets.dot11ParseWPSTag(0x61049, 0x3ba0ff7, 0x6, 0x32, 0x3722af8)
go/src/github.com/bettercap/bettercap/packets/dot11_wps.go:58 +0x168
github.com/bettercap/bettercap/packets.dot11ParseWPSData(0x3ba0fe4, 0x19, 0x45, 0x1, 0x4)
go/src/github.com/bettercap/bettercap/packets/dot11_wps.go:87 +0x78
github.com/bettercap/bettercap/packets.Dot11ParseWPS(0xfe4ad8, 0x3b0da20, 0x3b58d90, 0x3837680, 0x1, 0x4, 0xd314ee, 0x4)
go/src/github.com/bettercap/bettercap/packets/dot11_wps.go:101 +0x138
github.com/bettercap/bettercap/modules/wifi.(*WiFiModule).updateInfo(0x34f8d00, 0x3b58d90, 0xfe4ad8, 0x3b0da20)
go/src/github.com/bettercap/bettercap/modules/wifi/wifi.go:606 +0xdc
github.com/bettercap/bettercap/modules/wifi.(*WiFiModule).Start.func1()
go/src/github.com/bettercap/bettercap/modules/wifi/wifi.go:680 +0x37c
created by github.com/bettercap/bettercap/session.(*SessionModule).SetRunning
/go/src/github.com/bettercap/bettercap/session/module.go:285 +0x354

Last couple wifi items in log looked normal, 3rd from last has s few incorrect/unusual characters as seen:

[wifi.ap.lost] wifi access point T|u�-!432F" (66:66:66:66:66:66) lost.
[wifi.ap.lost] wifi access point homeWIFI (55:55:55:55:55:55) lost.
[wifi.client.probe] station 88:88:88:88:88:88 is probing for SSID ABCDEFG (-80 dBm)

@evilsocket evilsocket self-assigned this May 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants