Skip to main content

Scan and list local network hosts

Project description

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 |
+-------+-------------------+--------------------+

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

nmapper-0.3.1.tar.gz (6.6 kB view details)

Uploaded Source

Built Distribution

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

nmapper-0.3.1-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

File details

Details for the file nmapper-0.3.1.tar.gz.

File metadata

  • Download URL: nmapper-0.3.1.tar.gz
  • Upload date:
  • Size: 6.6 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for nmapper-0.3.1.tar.gz
Algorithm Hash digest
SHA256 e5bf88771e11748d2ae4d23a003d54fac49efe1817f47497f86ec3ce619a5144
MD5 d7d39b9e7e9adf88b11d8a575d1bef70
BLAKE2b-256 56a57457200c7199396ae6180480b728f55219f8a55d1dcffd976596660dc38b

See more details on using hashes here.

File details

Details for the file nmapper-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: nmapper-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 7.6 kB
  • Tags: Python 3
  • Uploaded using 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

File hashes

Hashes for nmapper-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e3e9d884777e77e1b7a8d6db78c04be43b82536a1b96fba4b5cf0af1a36c9411
MD5 f84b9bfe31a31a9e7eeb0eb3c406250b
BLAKE2b-256 be73b7e70be2740fe3f4181fbdcd65a0afff9ededb2fbd558606ec489d71d568

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