This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| # Scrapes pfSense DHCP Leases into List of (IP, MAC, Hostname, Description) 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 | |
| # Modified 03/14/2023 (schossel) | |
| # Added Field Description and changed CSRF to work with OPNsense |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| # # This python script provides a function to query the pfsense (+v2.4) dhcp leases status page and return a list of tuples including | |
| # ip, hostname, and mac address. To use, ensure LXML is installed via package manager or via pip. | |
| # | |
| # 16-Dec-2016 - Original release | |
| # 3-Sep-2020 - Minor update to match formatting of leases page in latest pfSense version (2.4.5). | |
| # 9-Sep-2020 - Backported improvements to handle table rows with missing data, use global variables for user/pass/server_ip, | |
| # and return list from scrape function as implemented by fryguy04 in fork here: | |
| # https://gist.github.com/fryguy04/7d12b789260c47c571f42e5bc733a813 |