Skip to content

Instantly share code, notes, and snippets.

@fryguy04
fryguy04 / dhcp_pfsense.py
Created June 23, 2019 15:15
Scrape pfSense DHCP List into Python Struct
#!/usr/bin/env python
# Scrapes pfSense DHCP Leases into List of (IP, MAC, Hostname) format.
# Change URL/Username/Password below ... pip install lxml ... then you are all set.
#
# Modified 6/23/2019 (FryGuy)
# Edits: Aligned IP/MAC/Hostname into struct accounting for blank lines
# Minor: Cleaned up spacing, created global url/user/password vars, removed write to file
# Original Code/Inspiration: https://gist.github.com/pletch/037a4a01c95688fff65752379534455f
import sys