Skip to content
This repository has been archived by the owner on Oct 14, 2021. It is now read-only.
/ nettrack Public archive

Automatically track local network devices through ARP table caches and store information on them in a database.

License

Notifications You must be signed in to change notification settings

linville/nettrack

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nettrack.py

nettrack is a python script to track devices on your local network and store statistics in for displaying on a webpage (or other front-end). It periodically scans the arp tables, looks up the vendor information (Organizationally Unique Identifiers - OUIs) and logs it in the database.

nettrack can be configured with a static list of Bonjour sleep proxy servers and will update the database when it detects a sleep proxy server is answering ARP requests on behalf of a sleeping device.

nettrack is based off a perl script called netinv developed by Marty Sells that I hacked up to insert the entries into a database.

Requirements

  • Python 3. There are minimal changes to get it working with Python 2.
  • (Recommended) The NMAP MAC Vendor Database. Typically installed in /usr/local/share/nmap-mac-prefixes

Database Schema

CREATE TABLE `macaddresses` (
  `mac` varchar(17) NOT NULL,
  `ip` varchar(39) NOT NULL,
  `dns` varchar(64) NOT NULL,
  `vendor` varchar(256) NOT NULL,
  `last` datetime NOT NULL,
  `sleeping` tinyint(1) NOT NULL,
  PRIMARY KEY (`mac`)
)

Example Usage

Add the following to your crontab.

# Update macaddress database
*/15 * * * * /home/user/nettrack/nettrack.py -c /path/to/config.conf

About

Automatically track local network devices through ARP table caches and store information on them in a database.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages