#network #security #scan

netscan

Cross-platform network scan library

25 releases (breaking)

new 0.23.0 Dec 3, 2023
0.22.0 Nov 21, 2023
0.21.0 Oct 15, 2023
0.15.4 Jul 16, 2023
0.3.0 May 16, 2021

#502 in Network programming

Download history 245/week @ 2023-08-15 106/week @ 2023-08-22 173/week @ 2023-08-29 561/week @ 2023-09-05 377/week @ 2023-09-12 202/week @ 2023-09-19 206/week @ 2023-09-26 230/week @ 2023-10-03 251/week @ 2023-10-10 220/week @ 2023-10-17 69/week @ 2023-10-24 245/week @ 2023-10-31 196/week @ 2023-11-07 227/week @ 2023-11-14 1414/week @ 2023-11-21 988/week @ 2023-11-28

2,853 downloads per month
Used in 4 crates (3 directly)

MIT license

165KB
3.5K SLoC

netscan Crates.io License

Cross-platform network scan library
with the aim of being lightweight and fast.

Features

  • Port Scan (IPv4, IPv6)
    • TCP SYN scan
    • TCP CONNECT scan
  • Host Scan (IPv4, IPv6)
    • ICMP PING scan
    • TCP PING scan
    • UDP PING scan

Usage

Add netscan to your dependencies

[dependencies]
netscan = "0.23"

Example

See Examples

Feature flags

The following feature flags can be used to enable/disable specific features.

--feature service

Enable service detection.

--feature os

Enable TCP/IP Stack Fingerprinting.

--feature full

Enable all of the above.

For more details see Examples

Supported platform

  • Linux
  • macOS
  • Windows

Note for Windows users

To build on Windows, follow the instructions below.

Windows

  • You must use a version of Rust which uses the MSVC toolchain
  • You must have npcap or WinPcap installed (If using npcap, make sure to install with the "Install Npcap in WinPcap API-compatible Mode")
  • You must place Packet.lib from the Npcap SDK or WinPcap Developers pack in a directory named lib, in the root of this repository. Alternatively, you can use any of the locations listed in the %LIB%/$Env:LIB environment variables. For the 64 bit toolchain it is in <SDK>/Lib/x64/Packet.lib, for the 32 bit toolchain, it is in <SDK>/Lib/Packet.lib.

Additional Notes

This library requires the ability to create raw sockets. Execute with administrator privileges.

Dependencies

~8–44MB
~700K SLoC