1.0.10 • Published 10 months ago

@xertified/pfnc v1.0.10

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

Program path using network connection (PFNC)

Find application connected against a given UDP/TCP port. The port can refer to either local or remote side of the network connection.

This Node.JS extension uses native platform API and commands to query the system for relevant information. Windows, MacOS and Linux are the currently supported operating systems.

Install

Use NPM to install this extension.

npm install --save @xertified/pfnc

Usage

Find all applications connected against remote port 443:

const pfnc = require("@xertified/pfnc");

const result = pfnc.scan({ port: 443, origin: "local" });
console.log(result);

Find all applications connected against local port 443:

const pfnc = require("@xertified/pfnc");

const result = pfnc.scan({ port: 443, origin: "remote" });
console.log(result);

Options

Parameter for scan() function is a object containing the port and origin of network connection. The origin member can have either "local", "remote" or "both" as its value.

Result

The result is an array of objects, where each object contains at least the origin, port, pid and path. This node extension uses platform API calls to resolve the absolute path from the PID associated with the network connection.

Example

[
  {
    origin: "client",
    port: 50022,
    pid: 72569,
    path: "/usr/bin/nc.openbsd",
  },
  {
    origin: "server",
    port: 60304,
    pid: 53628,
    path: "/usr/bin/nc.openbsd",
  },
  {
    origin: "client",
    port: 60304,
    pid: 53631,
    path: "/usr/bin/nc.openbsd",
  },
];

Environment

Set PFNC_VERBOSE=1 for more verbose error reporting. Notice that Windows restricts opening certain processes even when using the SYSTEM account. Display of these error messages can be enabled by setting this environment variable.

1.0.9

10 months ago

1.0.10

10 months ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago