mat-1 / matscan

silly minecraft server scanner
Other
199 stars 9 forks source link

Problems running the scanner (called `Option::unwrap()` on a `None` value) #4

Closed TechClusterHQ closed 6 months ago

TechClusterHQ commented 8 months ago

I'm currently setting up your matscan project to check out other scanners and how they operate, but I am getting this error when starting it up. The MongoDB database is set up properly with all indexes and I am attaching the config.toml file. Do you have an idea why this is happening?

Starting... dotenv parsing config at /home/user/matscan/config.toml parsing exclude file excluding 566866978 ips (1506 ranges) full_buffer: [11, 0, 47, 5, 109, 115, 99, 97, 110, 5, 57, 1, 1, 0] interface name: eth0 interface: NetworkInterface { name: "eth0", description: "", index: 2, mac: Some(00:22:48:8a:d9:b8), ips: [V4(Ipv4Network { addr: 172.16.5.4, prefix: 24 }), V6(Ipv6Network { addr: fe80::222:48ff:fe8a:d9b8, prefix: 64 })], flags: 69699 } Ok(Interface { index: 2, name: "eth0", friendly_name: None, description: None, if_type: Ethernet, mac_addr: Some(MacAddr(0, 34, 72, 138, 217, 184)), ipv4: [Ipv4Net { addr: 172.16.5.4, prefix_len: 24, netmask: 255.255.255.0 }], ipv6: [Ipv6Net { addr: fe80::222:48ff:fe8a:d9b8, prefix_len: 64, netmask: ffff:ffff:ffff:ffff:: }], flags: 69699, transmit_speed: Some(50000000000), receive_speed: Some(50000000000), gateway: Some(Gateway { mac_addr: MacAddr(18, 52, 86, 120, 154, 188), ip_addr: 172.16.5.1 }) }) chosen mode: Slash24New collecting servers finished collecting 0 servers converted into 0 ranges thread 'main' panicked at /home/user/matscan/src/modes/slash24_new.rs:30:59: called Option::unwrap() on a None value note: run with RUST_BACKTRACE=1 environment variable to display a backtrace

when running the same again, the error can occur in the "Slash24" and "Slash24FewPortsNew" modes as well.

mat-1 commented 8 months ago

This is a bug that happens when the database is empty so most adaptive scanning modes are broken. You can work around it by repeatedly running the code until it picks a mode that isn't adaptive (like slash0) so it puts a few servers in the database.