Chleba / netscanner

Terminal Network scanner & diagnostic tool with modern TUI
MIT License
865 stars 20 forks source link

crash: scan on machine through openvpn #28

Closed inifares23lab closed 6 months ago

inifares23lab commented 6 months ago

I am connected to a machine through openvpn on a tun interface. scanning on that interface causes this:

crash report:

"name" = "netscanner"
"operating_system" = "Fedora 39.0.0 [64-bit]"
"crate_version" = "0.4.5"
"explanation" = """
Panic occurred in file '/home/homesweethome/.local/cargo/registry/src/index.crates.io-6f17d22bba15001f/netscanner-0.4.5/src/components/discovery.rs' at line 148
"""
"cause" = "called `Option::unwrap()` on a `None` value"
"method" = "Panic"
"backtrace" = """

   0: 0x5582ce33c543 - core::panicking::panic::h8ddd58dc57c2dc00
   1: 0x5582ce33c426 - core::option::unwrap_failed::hf59153bb1e2fc334
   2: 0x5582ce3dea8f - <netscanner::components::discovery::Discovery as netscanner::components::Component>::update::hd711d6753609fee7
   3: 0x5582ce383db8 - tokio::runtime::park::CachedParkThread::block_on::hfa61ffd3f3b7de31
   4: 0x5582ce35d8a6 - tokio::runtime::runtime::Runtime::block_on::h2e009f277eeea08f
   5: 0x5582ce38f89a - netscanner::main::heca4ef282bcf0ade
   6: 0x5582ce3acce3 - std::sys_common::backtrace::__rust_begin_short_backtrace::h4ca9fedec93f9558
   7: 0x5582ce3d7f0d - std::rt::lang_start::{{closure}}::h85b52a1748b966b8
   8: 0x5582ce6ea613 - std::rt::lang_start_internal::h103c42a9c4e95084
   9: 0x5582ce38f975 - main
  10: 0x7f8bdb30014a - __libc_start_call_main
  11: 0x7f8bdb30020b - __libc_start_main_alias_2
  12: 0x5582ce33caf5 - _start
  13:        0x0 - <unresolved>"""
Chleba commented 6 months ago

Hi, That looks like that HW interface has no MAC address. I'll take a look at it and try to fix it somehow. Thanks for reporting it.

Chleba commented 6 months ago

Hi @inifares23lab, Here: https://github.com/Chleba/netscanner/commit/456e5da447d9a9cb69ad7c45eacfaa860b2c5880 is the fix for not having a mac address when scanning clients over VPN. Unfortunately, when we do not have a mac address, we can't get any vendor (oui) information, but at least we don't get thread panic. With that, I'm closing this issue but feel free to reopen it if this fix will not work. Thanks again for Your report to make this tool better.