Monitor and track active network connections
Project description
NetWatcher CLI
NetWatcher CLI monitors outbound network connections on your local machine and enriches them with IP geolocation and ownership data to help identify potentially suspicious processes. See example output below.
Features
- Displays geolocation and BGP table details about remote internet connections.
- Retrieves process information associated with each connection.
- Flags reasons to suspect possibly malicious activity.
- Optionally generates threat assessment as HTML report.
- Optionally outputs serialized logs to disk.
See the CLI docs for the full CLI usage reference.
Example Output
┏━━━━━━━━━┳━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ IP ┃ Geolocation ┃ Ownership ┃ Threat Level ┃ Assessment ┃ Process Info ┃
┡━━━━━━━━━╇━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ 8.8.8.8 │ City, State Zip │ - ISP: Example ISP │ Suspicious │ - Hosting provider │ - Executable Path: … │
│ │ Country │ - Org: Example Org │ │ - Proxy or VPN detected │ - Command Line: … │
│ │ │ - AS: ASEXAMPLE │ │ ... │ - Process Name: sus.exe │
│ │ │ - AS Name: EX │ │ │ - PID: 1234 │
│ │ │ ... │ │ │ ... │
└─────────┴─────────────────┴────────────────────┴──────────────┴─────────────────────────┴─────────────────────────┘
...
Table of Contents
Installation
Install from PyPI:
pip install netwatcher-cli
Basic Usage
$ nw scan [OPTIONS]
Options:
-c, --country-code TEXT: User's ISO 3166-1 alpha-2 two-leter country code. [default: US]--html-dir PATH: Optional directory location for which to write an HTML report.--lang TEXT: Language code for the IP API response. [default: en]--log-dir PATH: Optional directory location for which to write a log file.-v, --verbose: Increase verbosity (-v, -vv, -vvv) [default: 1]--help: Show this message and exit.
See the CLI docs for the full CLI usage reference.
Development
-
Install
uv:To manage dependencies and install NetWatcher CLI efficiently, use uv. You can install
uv(here). -
Install Python >= 3.9:
uv python install 3.13
- Create a virtual environment and activate it:
uv venv --python 3.13
# macOS and Linux
source .venv/activate/bin
# Windows
.venv\Scripts\activate
- Install dependencies:
uv pip install -r pyproject.toml --all-extras
- Run unit tests
uv run pytest [OPTIONS]
Some useful options:
-s– allowsprint()output-vvv– increases verbosity
See the pytest docs for full usage and configuration details.
- Run pre-commit (requires git-cliff, see Changelog Generation for more) to run the formatter/linter (Ruff), type checker (Pyright), doc generators (Typer/git-cliff), etc.
uv run pre-commit run --all-files
Changelog Generation
This project uses git-cliff to generate changelogs automatically based on conventional
commit messages. To use or update the changelog, you must have git-cliff installed locally or in your CI environment.
You can do this via cargo, the Rust package manager (which you can install
here):
cargo install git-cliff
License
This project is licensed under the MIT License. See the LICENSE file for more details.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file netwatcher_cli-0.2.1.tar.gz.
File metadata
- Download URL: netwatcher_cli-0.2.1.tar.gz
- Upload date:
- Size: 80.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
11b4dd4061cf34ab90c87fe278e717c6d93cbfa0a632a3860a1de487edd161a3
|
|
| MD5 |
70d8b2beb5848645a5913dd60d8fbd6a
|
|
| BLAKE2b-256 |
c0b020997d634c70ee0d612196d1d9b12a00fc696051aac629f6f08ad604a491
|
File details
Details for the file netwatcher_cli-0.2.1-py3-none-any.whl.
File metadata
- Download URL: netwatcher_cli-0.2.1-py3-none-any.whl
- Upload date:
- Size: 15.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a29d761dbecc45764b828795a3fba01129a5af577f67d8d13aa3f754b1ebf150
|
|
| MD5 |
e92b668c05e09b3d5dfba190784b5a92
|
|
| BLAKE2b-256 |
3c2ddab03c5415b452d048f45651e525401c27715cd6e920caec0f6e295d1aa6
|