29 releases (breaking)

0.27.0 Mar 27, 2024
0.26.0 Dec 24, 2023
0.25.0 Dec 22, 2023
0.22.0 Nov 21, 2023
0.3.0 May 16, 2021

#1168 in Network programming

Download history 687/week @ 2023-12-22 779/week @ 2023-12-29 741/week @ 2024-01-05 276/week @ 2024-01-12 117/week @ 2024-01-19 350/week @ 2024-01-26 904/week @ 2024-02-02 726/week @ 2024-02-09 314/week @ 2024-02-16 51/week @ 2024-02-23 28/week @ 2024-03-01 2/week @ 2024-03-08 6/week @ 2024-03-15 73/week @ 2024-03-22 82/week @ 2024-03-29 14/week @ 2024-04-05

175 downloads per month
Used in 4 crates (3 directly)

MIT license

295KB
9K 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.27"

Example

See Examples

Supported platform

  • Linux
  • macOS
  • Windows

Privileges

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

Note for Windows Users

If you are using Windows, please consider the following points before building and running:

  • Npcap or WinPcap Installation:
    • Ensure that you have Npcap or WinPcap installed on your system.
    • If using Npcap, make sure to install it with the "Install Npcap in WinPcap API-compatible Mode" option.
  • Build Dependencies:
    • Place the Packet.lib file from the Npcap SDK or WinPcap Developers pack in a directory named lib at the root of this repository.
    • You can use any of the locations listed in the %LIB% or $Env:LIB environment variables.
    • For the 64-bit toolchain, the Packet.lib is located in /Lib/x64/Packet.lib.
    • For the 32-bit toolchain, the Packet.lib is located in /Lib/Packet.lib.

Dependencies

~14–48MB
~754K SLoC