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

Crash with net.fuzz on: "panic: runtime error: slice bounds out of range" #612

Closed
cclements opened this issue Aug 20, 2019 · 0 comments
Closed

Comments

@cclements
Copy link

Description of the bug or feature request

Crash with net.fuzz on:

panic: runtime error: slice bounds out of range
goroutine 12 [running]:
github.com/bettercap/bettercap/vendor/github.com/google/gopacket/layers.(*DNSQuestion).decode(0xc0004caf90, 0xc00057048a, 0x1f, 0x1f, 0xc, 0x14d3a80, 0x22a7de0, 0xc0004cb4c8, 0x0, 0x14d1e60, ...)
	/root/go/src/github.com/bettercap/bettercap/vendor/github.com/google/gopacket/layers/dns.go:615 +0x1a3
github.com/bettercap/bettercap/vendor/github.com/google/gopacket/layers.(*DNS).DecodeFromBytes(0xc0004cb420, 0xc00057048a, 0x1f, 0x1f, 0x14d3a80, 0x22a7de0, 0x14d1e60, 0xc0000ab9d0)
	/root/go/src/github.com/bettercap/bettercap/vendor/github.com/google/gopacket/layers/dns.go:328 +0x224
github.com/bettercap/bettercap/modules/net_sniff.mdnsParser(0xc003f19f40, 0x14fa600, 0xc003e334a0, 0xc000fe1a00, 0x1cc550d300)
	/root/go/src/github.com/bettercap/bettercap/modules/net_sniff/net_sniff_mdns.go:18 +0xc4
github.com/bettercap/bettercap/modules/net_sniff.onUDP(0xc003f19f40, 0x14fa600, 0xc003e334a0, 0xc0004cbd00)
	/root/go/src/github.com/bettercap/bettercap/modules/net_sniff/net_sniff_udp.go:22 +0x105
github.com/bettercap/bettercap/modules/net_sniff.mainParser(0x14fa600, 0xc003e334a0, 0x0, 0x49)
	/root/go/src/github.com/bettercap/bettercap/modules/net_sniff/net_sniff_parsers.go:56 +0x188
github.com/bettercap/bettercap/modules/net_sniff.(*Sniffer).onPacketMatched(...)
	/root/go/src/github.com/bettercap/bettercap/modules/net_sniff/net_sniff.go:142
github.com/bettercap/bettercap/modules/net_sniff.(*Sniffer).Start.func1()
	/root/go/src/github.com/bettercap/bettercap/modules/net_sniff/net_sniff.go:199 +0x40c
created by github.com/bettercap/bettercap/session.(*SessionModule).SetRunning
	/root/go/src/github.com/bettercap/bettercap/session/module.go:275 +0x1c1

Environment

Please provide:

  • Bettercap version you are using ( bettercap v2.24.1 (built for linux amd64 with go1.12.8) [type 'help' for a list of commands] ).
  • OS version and architecture you are using.
uname -a
Linux bran 5.2.9-arch1-1-ARCH #1 SMP PREEMPT Fri Aug 16 11:29:43 UTC 2019 x86_64 GNU/Linux
  • Command line arguments you are using.
    bettercap -debug -eval 'net.fuzz on'

  • Full debug output while reproducing the issue ( bettercap -debug ... ).

https://gist.github.com/cclements/97e7c1fb91f3b1aeab0ec1ae116bb142

Simply start bettercap and turn on net.fuzz and it will crash in a minute or two.

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

1 participant