Skip to main content

DHClientList is a tool to get the current client list of a DHCP server. With it one can check who is connected to the local network. To do this one must provide the DHCP server address (IP in local network and port), username and password. The resulting list items contains the host name, MAC address, IP and lease time.

Project description

DHClientList
============

DHClientList is a tool to get the current client list of a DHCP server. With it one can check who is connected to the local network. To do this one must provide the DHCP server address (IP in local network and port), username and password. The resulting list items contains the host name, MAC address, IP and lease time.

## Installation ##
pip install dhclientlist

**Note:** The pyOpenSSL==0.13 library is required to enable the HTTPS server mode.

## Usage ##

### Command-line: ###

usage: dhclientlist print [-h] [-d DRIVERNAME] [-a ADDRESS] [-u USERNAME]
[-p PASSWORD] [-f {json,texttable}]

optional arguments:
-h, --help show this help message and exit
-d DRIVERNAME, --driver DRIVERNAME
specify a driver to be used
-a ADDRESS, --address ADDRESS
local dhcp server's address. (default: 192.168.0.1:80)
-u USERNAME, --username USERNAME
local dhcp server's username. (default: admin)
-p PASSWORD, --password PASSWORD
local dhcp server's password.
-f {json,texttable}, --format {json,texttable}
the format of the output list. (default: texttable)

### HTTP(S) Server: ###

usage: dhclientlist serve [-h] [-d DRIVERNAME] [-a ADDRESS] [-u USERNAME]
[-p PASSWORD] [--http-username HTTP_USERNAME]
[--http-password HTTP_PASSWORD] [-i] [--debug]
port

positional arguments:
port port that the dhclientlist HTTP(S) server will bind

optional arguments:
-h, --help show this help message and exit
-d DRIVERNAME, --driver DRIVERNAME
specify a driver to be used
-a ADDRESS, --address ADDRESS
local dhcp server's address. (default: 192.168.0.1:80)
-u USERNAME, --username USERNAME
local dhcp server's username. (default: admin)
-p PASSWORD, --password PASSWORD
local dhcp server's password.
--http-username HTTP_USERNAME
dhclientlist server username.
--http-password HTTP_PASSWORD
dhclientlist server password.
-i, --insecure use HTTP instead of HTTPS
--debug runs the server in debug mode

### Python lib: ###

import dhclientlist
dhclientlist.get(address, username, password) # optionally the 4th parameter: driver

## Drivers ##

The connection with DHCP server is made by a _driver_, a python module inside the **dhclientlist.drivers** package (or in any of its sub-packages) that has a get(address, username, password) function which return a list of dicts; each dict containing the following key-value pairs:

("name", name_str), # name of the guest connected to the dhcp server
("mac", mac_str), # MAC address of the guest connected to the dhcp server
("ip", ip_str), # IP address of the guest connected to the dhcp server
("lease", lease_str) # time in the format hh:mm:ss until this registry is updated in the dhcp server

The **dhclientlist.util.find_driver** function will try to find the appropriate driver for the local DHCP server. However, the number of drivers is quite small at the moment, and dhclientlist may not succeed with the local DHCP server. In this case, one is welcome to contribute by forking this project and developing a driver to the local DHCP server.

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

dhclientlist-0.0.6.zip (14.8 kB view details)

Uploaded Source

Built Distributions

dhclientlist-0.0.6.win32-py2.7.exe (209.5 kB view details)

Uploaded Source

dhclientlist-0.0.6-py2.7.egg (15.9 kB view details)

Uploaded Source

File details

Details for the file dhclientlist-0.0.6.zip.

File metadata

  • Download URL: dhclientlist-0.0.6.zip
  • Upload date:
  • Size: 14.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for dhclientlist-0.0.6.zip
Algorithm Hash digest
SHA256 728cef51f50cdc6ee4afe0e025f046bf74ea7d76cb48f9e173ac31b44c124585
MD5 e9816771ecb609b8ae9d4c4b3f1b8a5e
BLAKE2b-256 b09b4cf2148a586956e3dc87ec7f7c974832ce817f695c36b8e3ace7ef42a6d9

See more details on using hashes here.

File details

Details for the file dhclientlist-0.0.6.win32-py2.7.exe.

File metadata

File hashes

Hashes for dhclientlist-0.0.6.win32-py2.7.exe
Algorithm Hash digest
SHA256 432b553ff031a7a3a3581314c880e0e7e2364ac07458fa0663964c56dfebfa13
MD5 0535b997eef7ce697acd89d7dbfd5c7c
BLAKE2b-256 7b22b546a9048badfc476b7a1141663e90c7cabc8e29a9d682a1b18f02013d44

See more details on using hashes here.

File details

Details for the file dhclientlist-0.0.6-py2.7.egg.

File metadata

File hashes

Hashes for dhclientlist-0.0.6-py2.7.egg
Algorithm Hash digest
SHA256 64d426b2c42565f981cd9c80b2ed2864107db5c078ab80452b1fd43e0f123442
MD5 c85cc4b004f8b09393b4a4a4af0ac232
BLAKE2b-256 a82e2e5d29d1ddc659fe3961ca5eec354817e846cc100c334ea9b0b2b96a208c

See more details on using hashes here.

Supported by

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