Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ apk add netscanner --repository=http://dl-cdn.alpinelinux.org/alpine/edge/testin
```
cargo install netscanner
```

## Windows Installation

To use `netscanner` on Windows, you need to install [Npcap](https://npcap.com/dist/npcap-1.80.exe), otherwise you may encounter packet.dll error. Npcap is a packet capture library required for network scanning and packet analysis.

## Appreciation
`netscanner` has been made thanks to some awesome libraries that can be found in [Cargo.toml](./Cargo.toml) file.
But mostly I would like to link these two libraries that help me the most:
Expand Down
7 changes: 3 additions & 4 deletions src/components/interfaces.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,11 @@ impl Interfaces {
let interfaces = datalink::interfaces();
for intf in &interfaces {
// -- get active interface with non-local IP
if cfg!(windows) || (intf.is_up() && !intf.ips.is_empty()) {
if (cfg!(windows) || intf.is_up()) && !intf.ips.is_empty() {
// Windows doesn't have the is_up() method
for ip in &intf.ips {
// -- set active interface that's not localhost and starts with 192 [for windows compatibility]
if let IpAddr::V4(ipv4) = ip.ip() {
if ipv4.octets()[0] == 192 && ip.ip().to_string().ne("127.0.0.1") {
if let IpAddr::V4(ipv4) = ip.ip() {
if ipv4.is_private() && !ipv4.is_loopback() && !ipv4.is_unspecified() {
self.active_interfaces.push(intf.clone());
break;
}
Expand Down
Loading