Skip to main content

nmapper

A tool to scan and list local network hosts. Useful for quick network discovery of new connected devices.

Installation:

pip install nmapper

Requirements:

This tool requires nmap to be available in the system. On Debian/Ubuntu:

apt install nmap

Usage:

nmapper hosts
nmapper hosts 1       # for 1 scan pass, instead of 3 (default)
nmapper config list   # to show all configuration options
nmapper config --help # for more configuration commands, including edition of defaults
nmapper alias list    # to show all MAC address aliases
nmapper alias --help  # for more alias commands, including adding and removing aliases

Retrieving MAC addresses can only be done when application is run with elevated privileges

Getting your IP address to scan for hosts on the same network

$ hostname -I

Examples

Scan for hosts including MAC addresses

$ sudo nmapper hosts
Getting hosts in 192.168.1.0/24, 3 passes...
Number of hosts found: 8

+---------------+----------------------+-------------------+-------------------+--------+
|          Host |             Hostname |               MAC |             Alias | Status |
+---------------+----------------------+-------------------+-------------------+--------+
|   192.168.1.1 |             _gateway | 00:07:4F:C5:1E:72 |            router |   up   |
|  192.168.1.64 |                      | 50:31:D4:8A:10:D6 |       quicksilver |   up   |
|  192.168.1.66 |                      | 19:5B:2D:3C:44:74 |       black-widow |   up   |
| 192.168.1.148 |                      | 18:C9:A2:F9:1E:9A |           ant-man |   up   |
| 192.168.1.175 |                      | F9:73:75:DB:63:82 |         wolverine |   up   |
| 192.168.1.177 |   foobar-ragnar-5490 | 9C:ED:6B:4C:08:60 |            vision |   up   |
| 192.168.1.182 |                      | 5D:21:F0:15:68:1D |         iron-fist |   up   |
| 192.168.1.235 |                      | A5:7E:B1:15:04:28 |      juan-tastico |   up   |
+---------------+----------------------+-------------------+-------------------+--------+

New hosts since last scan:
192.168.1.148

Removed hosts since last scan:
192.168.1.150

Scan for hosts no MAC addresses

$ nmapper hosts
Getting hosts in 192.168.1.0/24, 3 passes...
Number of hosts found: 8

+---------------+----------------------+------+-------+--------+
|          Host |             Hostname |  MAC | Alias | Status |
+---------------+----------------------+------+-------+--------+
|   192.168.1.1 |             _gateway | None |  None |   up   |
|  192.168.1.64 |                      | None |  None |   up   |
|  192.168.1.66 |                      | None |  None |   up   |
| 192.168.1.148 |                      | None |  None |   up   |
| 192.168.1.175 |                      | None |  None |   up   |
| 192.168.1.177 |   foobar-ragnar-5490 | None |  None |   up   |
| 192.168.1.182 |                      | None |  None |   up   |
| 192.168.1.235 |                      | None |  None |   up   |
+---------------+----------------------+------+-------+--------+

New hosts since last scan:
192.168.1.175

Removed hosts since last scan:
192.168.1.133

Scan for hosts, 5 passes, on 172.17.0.xxx network

$ nmapper hosts 5 172.17.0.0/24
...

Show configuration parameters

$ nmapper config list

+--------------+-------------+
|          Key |       Value |
+--------------+-------------+
| NUM_ATTEMPTS |           3 |
| BASE_IP_NMAP | 192.168.1.0 |
+--------------+-------------+

Show MAC addresses alias list

$ nmapper alias list

+-------+-------------------+--------------------+
| Index |               Key |              Value |
+-------+-------------------+--------------------+
|     0 | 50:31:D4:8A:10:D6 |        quicksilver |
|     1 | F9:73:75:DB:63:82 |          wolverine |
|     2 | 19:5B:2D:3C:44:74 |        black-widow |
|     3 | 00:07:4F:C5:1E:72 |             router |
|     4 | 18:C9:A2:F9:1E:9A |            ant-man |
|     5 | 5D:21:F0:15:68:1D |          iron-fist |
|     6 | A5:7E:B1:15:04:28 |       juan-tastico |
|     7 | 9C:ED:6B:4C:08:60 |             vision |
+-------+-------------------+--------------------+

Add new MAC address alias

$ nmapper alias add D0:32:87:B1:73:86 loki

+-------+-------------------+--------------------+
| Index |               Key |              Value |
+-------+-------------------+--------------------+
|     0 | 50:31:D4:8A:10:D6 |        quicksilver |
|     1 | F9:73:75:DB:63:82 |          wolverine |
|     2 | 19:5B:2D:3C:44:74 |        black-widow |
|     3 | 00:07:4F:C5:1E:72 |             router |
|     4 | 18:C9:A2:F9:1E:9A |            ant-man |
|     5 | 5D:21:F0:15:68:1D |          iron-fist |
|     6 | A5:7E:B1:15:04:28 |       juan-tastico |
|     7 | 9C:ED:6B:4C:08:60 |             vision |
|     8 | D0:32:87:B1:73:86 |               loki |
+-------+-------------------+--------------------+

Metadata

Release files for nmapper 0.3.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for nmapper 0.3.1
File Size Uploaded Provenance Actions
nmapper-0.3.1.tar.gz 6.6 kB Without provenance Details for nmapper-0.3.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for nmapper 0.3.1
File Interpreter ABI Platform Actions
nmapper-0.3.1-py3-none-any.whl Python 3 none any Details for nmapper-0.3.1-py3-none-any.whl

Total release size: 14.3 kB

Release files / nmapper-0.3.1.tar.gz

Download URL nmapper-0.3.1.tar.gz
Size 6.6 kB
Tags Source
SHA-256 checksum
How to use checksums
e5bf88771e11748d2ae4d23a003d54fac49efe1817f47497f86ec3ce619a5144
BLAKE2b-256 checksum
How to use checksums
56a57457200c7199396ae6180480b728f55219f8a55d1dcffd976596660dc38b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.6.9

Release files / nmapper-0.3.1-py3-none-any.whl

Download URL nmapper-0.3.1-py3-none-any.whl
Size 7.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e3e9d884777e77e1b7a8d6db78c04be43b82536a1b96fba4b5cf0af1a36c9411
BLAKE2b-256 checksum
How to use checksums
be73b7e70be2740fe3f4181fbdcd65a0afff9ededb2fbd558606ec489d71d568
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.6.9

Security for nmapper 0.3.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page