Giter Site home page Giter Site logo

gummiflip-tim-b / pi.alert Goto Github PK

View Code? Open in Web Editor NEW

This project forked from leiweibau/pi.alert

0.0 0.0 0.0 541.94 MB

Scan the devices connected to your WIFI / LAN and alert you the connection of unknown devices. It also warns if a "always connected" device disconnects. In addition, it is possible to check web services for availability. For this purpose HTTP status codes and the response time of the service are evaluated.

License: GNU General Public License v3.0

Shell 5.14% JavaScript 22.13% Python 9.19% PHP 51.47% CSS 10.08% Hack 0.13% HTML 1.86%

pi.alert's Introduction

Table of Contents

Pi.Alert

WIFI / LAN intruder detector with web service monitoring.

Scan the devices connected to your WIFI / LAN and alert you the connection of unknown devices. It also warns if a "always connected" device disconnects. In addition, it is possible to check web services for availability. For this purpose HTTP status codes and the response time of the service are evaluated. If a service fails or the HTTP status code changes, a notification can be sent.

Main screen Compare this fork with the main project

Scan Methods

  • arp-scan. The arp-scan system utility is used to search for devices on the network using arp frames.
  • Pi-hole. This method is optional. If the Pi-hole DNS server is active, Pi.Alert examines its activity looking for active devices using DNS that have not been detected by method 1.
  • dnsmasq. This method is optional. If the DHCP server dnsmasq is active, Pi.Alert examines the DHCP leases (addresses assigned) to find active devices that were not discovered by the other methods.
  • Fritzbox. This method is optional. If you use a Fritzbox (a router from the company "AVM"), it is possible to perform a query of the active hosts. This also includes hosts of the guest WLAN and Powerline devices from "AVM".
  • Web service monitoring. This method is optional. An HTTP request is sent and the web server's response is processed. If self signed certificates are used, no validation of the certificate is performed.
  • ICMP monitoring. This method is optional. A "ping" is sent to a manually specified IP/hostname/domain name and the response is evaluated
  • DHCP Server Scan. This method is optional. Nmap is used to send DHCP requests into the network to detect unknown (rogue) DHCP servers.

Components

Back

Front

There is a configurable login to prevent unauthorized use. The default password is "123456". By default, this is disabled. If you want to use password protection, enable it in the configuration file ~/pialert/config/pialert.conf or via pialert-cli.

  • Manage the devices inventory and the characteristics (individually or with a bulk editor)
  • Display in a visual way all the information collected by the back (Sessions, Connected devices, Favorites, Events, Presence, Internet IP address changes, ...)
  • Manual Nmap scans for regular devices and speedtest for the device "Internet" in the details view
  • Simple network relationship display
  • Maintenance tasks and settings like:
    • Status information (active scans, database size, backup counter)
    • Light/Dark-Mode switch and theme selection (blue, red, green, yellow, black, purple)
    • Language selection (english, german, spanish, french)
    • Enable/Disable network activity graph
    • Pause arp-scan
    • Set API-key
    • Enable/Disable login
    • DB maintenance tools and a possibility for backup, restore and cleanup the database and the config file
    • Send test notifications
    • Config file editor
  • Web service monitoring
  • Help/FAQ section
  • Wake-on-LAN (must be supported by the target device)
  • Notification page with download options
  • Journal that tracks operations via the frontend

Based on the original, I have created new icons according to the skins. Since I made the experience that iOS devices do not load homescreen icons from insecure sources (no SSL or selfsigned SSL), you can also link the icons directly from this repository.

https://raw.githubusercontent.com/leiweibau/Pi.Alert/main/front/img/favicons/glass_black_white.png

Instead of 'glass_black_white.png' you can use one of the following files.

List of Favicons/Homescreen icons

API

A possibility to send a request to the Pi.Alert backend via different ways. Currently the API offers the possibility to query 4 things:

  • System status (Scan on or off, Counts all, online, offline, archived and new devices)
  • All online devices (MAC, Name, Vendor, LastIP, Infrastructure, Infrastructure_port)
  • All offline devices (MAC, Name, Vendor, LastIP, Infrastructure, Infrastructure_port)
  • Information about a specific device (all information, without events and presence)

With the API (from Pi.Alert 3.7.9+) it is possible to integrate Pi.Alert into Home Assistant. How it works, you can look up in the API documentation.

Pi.Alert API Usage and Examples / Home Assistant integration

Installation

Initially designed to run on a Raspberry Pi, probably it can run on some other Linux distributions which use the "apt" package manager. With minor adjustments (FAQ page) I tested Pi.Alert on Dietpi and Ubuntu Server. An also active developed Docker version of Pi.Alert can be found here: jokob-sk/Pi.Alert

  • One-step Automated Install:

    curl -sSL https://github.com/leiweibau/Pi.Alert/raw/main/install/pialert_install.sh | bash

  • Debian 12 and newer:

    If you are using Debian 12 or a related distribution, the script throws an error when installing packages with pip3. To counter this, I have provided a script that uses the pip3 parameter "--break-system-packages".

    curl -sSL https://github.com/leiweibau/Pi.Alert/raw/main/install/pialert_install_debian12.sh | bash

  • Installation Guide (step by step)

If after installation you find that no devices are detected, or python errors appear in the scanlog, it may be that your user in use does not have certain "sudo" permissions. The command sudo ./pialert-cli set_sudoers in the directory ~/pialert/back can be used to perform this user configuration.

Update

You can always check for a new release using the "Update Check" button in the sidebar. This check will show you if the GeoLite2 DB is installed or up to date and which new features, fixes or changes are available in the new Pi.Alert release, if you are not already using the latest version.

There are no updates as Github release package, because the update function is done by the "curl" command anyway. Instead, after a certain number of commits, a new archive is created, which is used as the source for the update.

This update script is only recommended for an already existing installation of this fork. If you are using another fork, I recommend uninstalling it first. If you backup the database, it may be possible to continue using it with my fork after a patch (pialert-cli).

  • One-step Automated Update:

    curl -sSL https://github.com/leiweibau/Pi.Alert/raw/main/install/pialert_update.sh | bash

Closing words

Versions History

Versions History

An archive of older versions can be found at https://leiweibau.net/archive/pialert. This archive contains all release notes of my fork.

License

GPL 3.0 Read more here

Additionally used components

Special thanks

This code is a collaborative body of work, with special thanks to:

Macleykun, Final-Hawk, TeroRERO, jokob-sk and many more

Contact

[email protected]

pi.alert's People

Contributors

leiweibau avatar pucherot avatar terorero avatar absoblogginlutely avatar derekpurdy avatar malenurse avatar pyrrolizin avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.