From b35489ee6324885c285532117f9ce893af2df467 Mon Sep 17 00:00:00 2001 From: Jokob-sk Date: Tue, 27 Dec 2022 22:29:47 +1100 Subject: [PATCH] updated contact info --- back/pialert.py | 74 +++++++++++++++------------- back/update_vendors.sh | 2 +- front/css/pialert.css | 2 +- front/deviceDetails.php | 7 +-- front/devices.php | 2 +- front/events.php | 2 +- front/js/pialert_common.js | 2 +- front/php/server/db.php | 2 +- front/php/server/devices.php | 2 +- front/php/server/events.php | 2 +- front/php/server/parameters.php | 2 +- front/php/server/util.php | 2 +- front/php/templates/footer.php | 4 +- front/php/templates/header.php | 2 +- front/php/templates/notification.php | 2 +- front/presence.php | 2 +- 16 files changed, 56 insertions(+), 55 deletions(-) diff --git a/back/pialert.py b/back/pialert.py index ff263bb2..cd9754fc 100755 --- a/back/pialert.py +++ b/back/pialert.py @@ -6,7 +6,7 @@ # # pialert.py - Back module. Network scanner #------------------------------------------------------------------------------- -# Puche 2021 pi.alert.application@gmail.com GNU GPLv3 +# Puche 2021 / 2022+ jokob jokob@duck.com GNU GPLv3 #------------------------------------------------------------------------------- @@ -870,29 +870,45 @@ def scan_network (): # file_print("---------------------------------------------") - # client = SSDPClient() - # devices = client.m_search("ssdp:all") - # for device in devices: - # file_print(device.get("usn")) + # client = SSDPClient() - # file_print("---------------------------------------------") + # devices = client.m_search("ssdp:all") + + # for device in devices: + # print(device.get("usn")) + # print("000000000000000000000000000000000000000000000000000000000000\n") + # print(device) + + # print("---------------------------------------------") # devices = upnpclient.discover() - # file_print("---------------------------------------------") + # print("---------------------------------------------") # for device in devices: - # file_print(device) + # print(device) - # file_print("---------------------------------------------") + # print("---------------------------------------------") + + + # sockAddr = ("192.168.1.14", 443); + + # sockInfo = socket.getnameinfo(sockAddr, socket.NI_NAMEREQD); + + # # find an example using NI_MAXHOST + + # print(sockInfo); + + + # nmap > vendor > espressifg > ESP32 type + # UDP ports + # nmap -sU 192.168.1.14 # # devtest end # Header updateState("Scan: Network") - file_print('[', startTime, '] Scan Devices:' ) - file_print(' ScanCycle:', cycle) - + file_print('[', startTime, '] Scan Devices:' ) # # Query ScanCycle properties print_log ('Query ScanCycle confinguration') @@ -914,14 +930,16 @@ def scan_network (): # DEBUG - print number of rows updated # file_print('aspr-scan result:', len(arpscan_devices)) - # Pi-hole method - file_print(' Pi-hole start') - openDB() - reporting = copy_pihole_network() or reporting + # Pi-hole method + if PIHOLE_ACTIVE : + file_print(' Pi-hole start') + openDB() + reporting = copy_pihole_network() or reporting - # DHCP Leases method - file_print(' DHCP Leases start') - reporting = read_DHCP_leases () or reporting + # DHCP Leases method + if DHCP_ACTIVE : + file_print(' DHCP Leases start') + reporting = read_DHCP_leases () or reporting # Load current scan data file_print(' Processing scan results') @@ -998,15 +1016,12 @@ def execute_arpscan (): arpscan_output = "" # multiple interfaces - if type(SCAN_SUBNETS) is list: - file_print(" arp-scan: Multiple interfaces") + if type(SCAN_SUBNETS) is list: for interface in SCAN_SUBNETS : arpscan_output += execute_arpscan_on_interface (interface) # one interface only - else: - file_print(" arp-scan: One interface") + else: arpscan_output += execute_arpscan_on_interface (SCAN_SUBNETS) - # Search IP + MAC + Vendor as regular expresion re_ip = r'(?P((2[0-5]|1[0-9]|[0-9])?[0-9]\.){3}((2[0-5]|1[0-9]|[0-9])?[0-9]))' @@ -1017,7 +1032,6 @@ def execute_arpscan (): # Create Userdict of devices devices_list = [device.groupdict() for device in re.finditer (re_pattern, arpscan_output)] - # Delete duplicate MAC unique_mac = [] @@ -1026,8 +1040,7 @@ def execute_arpscan (): for device in devices_list : if device['mac'] not in unique_mac: unique_mac.append(device['mac']) - unique_devices.append(device) - + unique_devices.append(device) # DEBUG # file_print(devices_list) @@ -1061,9 +1074,6 @@ def execute_arpscan_on_interface (SCAN_SUBNETS): #------------------------------------------------------------------------------- def copy_pihole_network (): - # check if Pi-hole is active - if not PIHOLE_ACTIVE : - return # Open Pi-hole DB sql.execute ("ATTACH DATABASE '"+ piholeDB +"' AS PH") @@ -1090,10 +1100,6 @@ def copy_pihole_network (): #------------------------------------------------------------------------------- def read_DHCP_leases (): reporting = False - - # check DHCP Leases is active - if not DHCP_ACTIVE : - return False # Read DHCP Leases # Bugfix #1 - dhcp.leases: lines with different number of columns (5 col) diff --git a/back/update_vendors.sh b/back/update_vendors.sh index 880c9648..27d8aea5 100755 --- a/back/update_vendors.sh +++ b/back/update_vendors.sh @@ -5,7 +5,7 @@ # # update_vendors.sh - Back module. IEEE Vendors db update # ------------------------------------------------------------------------------ -# Puche 2021 pi.alert.application@gmail.com GNU GPLv3 +# Puche 2021 / 2022+ jokob jokob@duck.com GNU GPLv3 # ------------------------------------------------------------------------------ # ---------------------------------------------------------------------- diff --git a/front/css/pialert.css b/front/css/pialert.css index a89f0eca..8d9ab1d5 100755 --- a/front/css/pialert.css +++ b/front/css/pialert.css @@ -4,7 +4,7 @@ # # pialert.css - Front module. CSS styles #------------------------------------------------------------------------------- -# Puche 2021 pi.alert.application@gmail.com GNU GPLv3 +# Puche 2021 / 2022+ jokob jokob@duck.com GNU GPLv3 ----------------------------------------------------------------------------- */ /* ----------------------------------------------------------------------------- diff --git a/front/deviceDetails.php b/front/deviceDetails.php index 7181f21b..e123469d 100755 --- a/front/deviceDetails.php +++ b/front/deviceDetails.php @@ -4,7 +4,7 @@ # # deviceDetails.php - Front module. Device management page #------------------------------------------------------------------------------- -# Puche 2021 pi.alert.application@gmail.com GNU GPLv3 +# Puche 2021 / 2022+ jokob jokob@duck.com GNU GPLv3 #--------------------------------------------------------------------------- --> ","Cancel","OK", "alert"); -} - diff --git a/front/devices.php b/front/devices.php index 08afe0d8..00bce4ef 100755 --- a/front/devices.php +++ b/front/devices.php @@ -4,7 +4,7 @@ # # devices.php - Front module. Devices list page #------------------------------------------------------------------------------- -# Puche 2021 pi.alert.application@gmail.com GNU GPLv3 +# Puche 2021 / 2022+ jokob jokob@duck.com GNU GPLv3 #--------------------------------------------------------------------------- --> @@ -13,7 +13,7 @@ © 2020 Puche (2022+ jokob-sk)'; + echo '© 2020 Puche (2022+ jokob-sk)'; ?>
diff --git a/front/php/templates/header.php b/front/php/templates/header.php index df018275..7efac561 100755 --- a/front/php/templates/header.php +++ b/front/php/templates/header.php @@ -4,7 +4,7 @@ # # header.php - Front module. Common header to all the web pages #------------------------------------------------------------------------------- -# Puche 2021 pi.alert.application@gmail.com GNU GPLv3 +# Puche 2021 / 2022+ jokob jokob@duck.com GNU GPLv3 #--------------------------------------------------------------------------- --> diff --git a/front/presence.php b/front/presence.php index 75348978..80b91976 100755 --- a/front/presence.php +++ b/front/presence.php @@ -4,7 +4,7 @@ # # presence.php - Front module. Device Presence calendar page #------------------------------------------------------------------------------- -# Puche 2021 pi.alert.application@gmail.com GNU GPLv3 +# Puche 2021 / 2022+ jokob jokob@duck.com GNU GPLv3 #--------------------------------------------------------------------------- -->