Skip to main content

Monitor and track active network connections

Project description

NetWatcher CLI

PyPI version License: MIT

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

  1. Install uv:

    To manage dependencies and install NetWatcher CLI efficiently, use uv. You can install uv (here).

  2. Install Python >= 3.9:

uv python install 3.13
  1. Create a virtual environment and activate it:
uv venv --python 3.13

# macOS and Linux
source .venv/activate/bin

# Windows
.venv\Scripts\activate
  1. Install dependencies:
uv pip install -r pyproject.toml --all-extras
  1. Run unit tests
uv run pytest [OPTIONS]

Some useful options:

  • -s – allows print() output
  • -vvv – increases verbosity

See the pytest docs for full usage and configuration details.

  1. 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

netwatcher_cli-0.2.1.tar.gz (80.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

netwatcher_cli-0.2.1-py3-none-any.whl (15.0 kB view details)

Uploaded Python 3

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

Hashes for netwatcher_cli-0.2.1.tar.gz
Algorithm Hash digest
SHA256 11b4dd4061cf34ab90c87fe278e717c6d93cbfa0a632a3860a1de487edd161a3
MD5 70d8b2beb5848645a5913dd60d8fbd6a
BLAKE2b-256 c0b020997d634c70ee0d612196d1d9b12a00fc696051aac629f6f08ad604a491

See more details on using hashes here.

File details

Details for the file netwatcher_cli-0.2.1-py3-none-any.whl.

File metadata

File hashes

Hashes for netwatcher_cli-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a29d761dbecc45764b828795a3fba01129a5af577f67d8d13aa3f754b1ebf150
MD5 e92b668c05e09b3d5dfba190784b5a92
BLAKE2b-256 3c2ddab03c5415b452d048f45651e525401c27715cd6e920caec0f6e295d1aa6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page