Compare commits
38 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f8564f4dd7 | ||
|
|
78352ed5a4 | ||
|
|
bb4be279c8 | ||
|
|
9f73af8ce6 | ||
|
|
f6eedd84d8 | ||
|
|
cd9a1ac22a | ||
|
|
0e3f14dd9d | ||
|
|
dbe0a0548b | ||
|
|
e8f723d985 | ||
|
|
cc50d0f75e | ||
|
|
a473845242 | ||
|
|
bda526b202 | ||
|
|
9057e41ff8 | ||
|
|
75bb53fdd1 | ||
|
|
e7ebd9bab5 | ||
|
|
30aeab305d | ||
|
|
3e6d9847be | ||
|
|
3c34c822e7 | ||
|
|
424cf11752 | ||
|
|
8bf95aed5b | ||
|
|
2f9ccddd09 | ||
|
|
d0d5512e89 | ||
|
|
4c51e6cd43 | ||
|
|
35be1e65ea | ||
|
|
6b53dc54f5 | ||
|
|
3f0b7d9e2d | ||
|
|
f2b6cf9f0c | ||
|
|
1e6093fa50 | ||
|
|
5026b8c66e | ||
|
|
3a622b05be | ||
|
|
97ae38fbbf | ||
|
|
ec07af84a9 | ||
|
|
49f5dd3c39 | ||
|
|
f74246a1ec | ||
|
|
2cf457e145 | ||
|
|
d7913af341 | ||
|
|
0c55310ca8 | ||
|
|
87fbf1d587 |
26
README.md
@@ -68,7 +68,13 @@ The system consists of two parts:
|
||||
Initially designed to run on a Raspberry PI, probably it can run on many other
|
||||
Linux distributions.
|
||||
|
||||
[Instructions](doc/INSTALL.md)
|
||||
- [Installation instructions](docs/INSTALL.md)
|
||||
|
||||
|
||||
## Device Management
|
||||
<!--- --------------------------------------------------------------------- --->
|
||||
|
||||
- [Device Management instructions](docs/DEVICE_MANAGEMENT.md)
|
||||
|
||||
|
||||
## Other useful info
|
||||
@@ -91,18 +97,20 @@ Linux distributions.
|
||||
|
||||
### License
|
||||
GPL 3.0
|
||||
[Read more here](doc/LICENSE.txt)
|
||||
[Read more here](docs/LICENSE.txt)
|
||||
|
||||
### Contact
|
||||
pi.alert.application@gmail.com
|
||||
|
||||
***Suggestions and comments are welcome***
|
||||
|
||||
|
||||
<!--- --------------------------------------------------------------------- --->
|
||||
[main]: ./doc/img/1_devices.jpg "Main screen"
|
||||
[screen1]: ./doc/img/2_1_device_details.jpg "Screen 1"
|
||||
[screen2]: ./doc/img/2_2_device_sessions.jpg "Screen 2"
|
||||
[screen3]: ./doc/img/2_3_device_presence.jpg "Screen 3"
|
||||
[screen4]: ./doc/img/3_presence.jpg "Screen 4"
|
||||
[report1]: ./doc/img/4_report_1.jpg "Report sample 1"
|
||||
[report2]: ./doc/img/4_report_2.jpg "Report sample 2"
|
||||
[main]: ./docs/img/1_devices.jpg "Main screen"
|
||||
[screen1]: ./docs/img/2_1_device_details.jpg "Screen 1"
|
||||
[screen2]: ./docs/img/2_2_device_sessions.jpg "Screen 2"
|
||||
[screen3]: ./docs/img/2_3_device_presence.jpg "Screen 3"
|
||||
[screen4]: ./docs/img/3_presence.jpg "Screen 4"
|
||||
[report1]: ./docs/img/4_report_1.jpg "Report sample 1"
|
||||
[report2]: ./docs/img/4_report_2.jpg "Report sample 2"
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
VERSION = '2.50'
|
||||
VERSION_YEAR = '2020'
|
||||
VERSION_DATE = '2020-12-30'
|
||||
VERSION = '2.56'
|
||||
VERSION_YEAR = '2021'
|
||||
VERSION_DATE = '2021-01-15'
|
||||
|
||||
DB_PATH = '/home/pi/pialert/db/pialert.db'
|
||||
LOG_PATH = '/home/pi/pialert/log'
|
||||
@@ -17,6 +17,8 @@ REPORT_MAIL = False
|
||||
REPORT_FROM = 'Pi.Alert <' + SMTP_USER +'>'
|
||||
REPORT_TO = 'user@gmail.com'
|
||||
|
||||
# QUERY_MYIP_SERVER = 'https://diagnostic.opendns.com/myip'
|
||||
QUERY_MYIP_SERVER = 'http://ipv4.icanhazip.com'
|
||||
DDNS_ACTIVE = False
|
||||
DDNS_DOMAIN = 'your_domain.freeddns.org'
|
||||
DDNS_USER = 'dynu_user'
|
||||
|
||||
100
back/pialert.py
@@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env python
|
||||
#
|
||||
# Pi.Alert v2.50 / 2020-12-30
|
||||
# Puche 2020
|
||||
# Pi.Alert v2.56 / 2021-01-15
|
||||
# Puche 2021
|
||||
# GNU GPLv3
|
||||
|
||||
|
||||
@@ -28,7 +28,10 @@ import csv
|
||||
# CONFIG CONSTANTS
|
||||
#===============================================================================
|
||||
PIALERT_PATH = os.path.dirname(os.path.abspath(__file__))
|
||||
execfile (PIALERT_PATH + "/pialert.conf")
|
||||
if (sys.version_info > (3,0)):
|
||||
exec(open(PIALERT_PATH + "/pialert.conf").read())
|
||||
else:
|
||||
execfile (PIALERT_PATH + "/pialert.conf")
|
||||
|
||||
|
||||
#===============================================================================
|
||||
@@ -156,8 +159,10 @@ def get_internet_IP ():
|
||||
# dig_args = ['dig', '+short', 'myip.opendns.com',
|
||||
# '@resolver1.opendns.com']
|
||||
|
||||
# BUGFIX #12 - Query IPv4 address (not IPv6)
|
||||
# Using 'curl' instead of 'dig'
|
||||
curl_args = ['curl', '-s', 'https://diagnostic.opendns.com/myip']
|
||||
# curl_args = ['curl', '-s', 'https://diagnostic.opendns.com/myip']
|
||||
curl_args = ['curl', '-s', QUERY_MYIP_SERVER]
|
||||
curl_output = subprocess.check_output (curl_args, universal_newlines=True)
|
||||
|
||||
# Check result is an IP
|
||||
@@ -292,9 +297,12 @@ def update_devices_MAC_vendors ():
|
||||
#-------------------------------------------------------------------------------
|
||||
def query_MAC_vendor (pMAC):
|
||||
try :
|
||||
# BUGFIX #6 - Fix pMAC parameter as numbers
|
||||
pMACstr = str(pMAC)
|
||||
|
||||
# Check MAC parameter
|
||||
mac = pMAC.replace (':','')
|
||||
if len(pMAC) != 17 or len(mac) != 12 :
|
||||
mac = pMACstr.replace (':','')
|
||||
if len(pMACstr) != 17 or len(mac) != 12 :
|
||||
return -2
|
||||
|
||||
# Search vendor in HW Vendors DB
|
||||
@@ -447,8 +455,28 @@ def execute_arpscan (pRetries):
|
||||
devices_list = [device.groupdict()
|
||||
for device in re.finditer (re_pattern, arpscan_output)]
|
||||
|
||||
# Bugfix #5 - Delete duplicated MAC's with different IP's
|
||||
# TEST - Force duplicated device
|
||||
# devices_list.append(devices_list[0])
|
||||
# Delete duplicate MAC
|
||||
unique_mac = []
|
||||
unique_devices = []
|
||||
|
||||
for device in devices_list :
|
||||
if device['mac'] not in unique_mac:
|
||||
unique_mac.append(device['mac'])
|
||||
unique_devices.append(device)
|
||||
|
||||
# DEBUG
|
||||
# print (devices_list)
|
||||
# print (unique_mac)
|
||||
# print (unique_devices)
|
||||
# print (len(devices_list))
|
||||
# print (len(unique_mac))
|
||||
# print (len(unique_devices))
|
||||
|
||||
# return list
|
||||
return devices_list
|
||||
return unique_devices
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
def copy_pihole_network ():
|
||||
@@ -486,10 +514,17 @@ def read_DHCP_leases ():
|
||||
return
|
||||
|
||||
# Read DHCP Leases
|
||||
with open(DHCP_LEASES) as f:
|
||||
reader = csv.reader(f, delimiter=' ')
|
||||
data = [(col1, col2, col3, col4, col5)
|
||||
for col1, col2, col3, col4, col5 in reader]
|
||||
# Bugfix #1 - dhcp.leases: lines with different number of columns (5 col)
|
||||
data = []
|
||||
with open(DHCP_LEASES, 'r') as f:
|
||||
for line in f:
|
||||
row = line.rstrip().split()
|
||||
if len(row) == 5 :
|
||||
data.append (row)
|
||||
# with open(DHCP_LEASES) as f:
|
||||
# reader = csv.reader(f, delimiter=' ')
|
||||
# data = [(col1, col2, col3, col4, col5)
|
||||
# for col1, col2, col3, col4, col5 in reader]
|
||||
|
||||
# Insert into PiAlert table
|
||||
sql.execute ("DELETE FROM DHCP_Leases")
|
||||
@@ -638,11 +673,12 @@ def create_new_devices ():
|
||||
|
||||
# Pi-hole - Insert events for new devices
|
||||
# NOT STRICYLY NECESARY (Devices can be created through Current_Scan)
|
||||
# Bugfix #2 - Pi-hole devices w/o IP
|
||||
print_log ('New devices - 3 Pi-hole Events')
|
||||
sql.execute ("""INSERT INTO Events (eve_MAC, eve_IP, eve_DateTime,
|
||||
eve_EventType, eve_AdditionalInfo,
|
||||
eve_PendingAlertEmail)
|
||||
SELECT PH_MAC, PH_IP, ?, 'New Device',
|
||||
SELECT PH_MAC, IFNULL (PH_IP,'-'), ?, 'New Device',
|
||||
'(Pi-Hole) ' || PH_Vendor, 1
|
||||
FROM PiHole_Network
|
||||
WHERE NOT EXISTS (SELECT 1 FROM Devices
|
||||
@@ -650,13 +686,14 @@ def create_new_devices ():
|
||||
(startTime, ) )
|
||||
|
||||
# Pi-hole - Create New Devices
|
||||
# Bugfix #2 - Pi-hole devices w/o IP
|
||||
print_log ('New devices - 4 Pi-hole Create devices')
|
||||
sql.execute ("""INSERT INTO Devices (dev_MAC, dev_name, dev_Vendor,
|
||||
dev_LastIP, dev_FirstConnection, dev_LastConnection,
|
||||
dev_ScanCycle, dev_AlertEvents, dev_AlertDeviceDown,
|
||||
dev_PresentLastScan)
|
||||
SELECT PH_MAC, PH_Name, PH_Vendor, PH_IP, ?, ?,
|
||||
1, 1, 0, 1
|
||||
SELECT PH_MAC, PH_Name, PH_Vendor, IFNULL (PH_IP,'-'),
|
||||
?, ?, 1, 1, 0, 1
|
||||
FROM PiHole_Network
|
||||
WHERE NOT EXISTS (SELECT 1 FROM Devices
|
||||
WHERE dev_MAC = PH_MAC) """,
|
||||
@@ -675,16 +712,39 @@ def create_new_devices ():
|
||||
|
||||
# DHCP Leases - Create New Devices
|
||||
print_log ('New devices - 6 DHCP Leases Create devices')
|
||||
sql.execute ("""INSERT INTO Devices (dev_MAC, dev_name, dev_Vendor,
|
||||
dev_LastIP, dev_FirstConnection, dev_LastConnection,
|
||||
# BUGFIX #23 - Duplicated MAC in DHCP.Leases
|
||||
# TEST - Force Duplicated MAC
|
||||
# sql.execute ("""INSERT INTO DHCP_Leases VALUES
|
||||
# (1610700000, 'TEST1', '10.10.10.1', 'Test 1', '*')""")
|
||||
# sql.execute ("""INSERT INTO DHCP_Leases VALUES
|
||||
# (1610700000, 'TEST2', '10.10.10.2', 'Test 2', '*')""")
|
||||
sql.execute ("""INSERT INTO Devices (dev_MAC, dev_name, dev_LastIP,
|
||||
dev_Vendor, dev_FirstConnection, dev_LastConnection,
|
||||
dev_ScanCycle, dev_AlertEvents, dev_AlertDeviceDown,
|
||||
dev_PresentLastScan)
|
||||
SELECT DHCP_MAC, DHCP_Name, '(unknown)', DHCP_IP, ?, ?,
|
||||
1, 1, 0, 1
|
||||
FROM DHCP_Leases
|
||||
SELECT DISTINCT DHCP_MAC,
|
||||
(SELECT DHCP_Name FROM DHCP_Leases AS D2
|
||||
WHERE D2.DHCP_MAC = D1.DHCP_MAC
|
||||
ORDER BY DHCP_DateTime DESC LIMIT 1),
|
||||
(SELECT DHCP_IP FROM DHCP_Leases AS D2
|
||||
WHERE D2.DHCP_MAC = D1.DHCP_MAC
|
||||
ORDER BY DHCP_DateTime DESC LIMIT 1),
|
||||
'(unknown)', ?, ?, 1, 1, 0, 1
|
||||
FROM DHCP_Leases AS D1
|
||||
WHERE NOT EXISTS (SELECT 1 FROM Devices
|
||||
WHERE dev_MAC = DHCP_MAC) """,
|
||||
(startTime, startTime) )
|
||||
|
||||
# sql.execute ("""INSERT INTO Devices (dev_MAC, dev_name, dev_Vendor,
|
||||
# dev_LastIP, dev_FirstConnection, dev_LastConnection,
|
||||
# dev_ScanCycle, dev_AlertEvents, dev_AlertDeviceDown,
|
||||
# dev_PresentLastScan)
|
||||
# SELECT DHCP_MAC, DHCP_Name, '(unknown)', DHCP_IP, ?, ?,
|
||||
# 1, 1, 0, 1
|
||||
# FROM DHCP_Leases
|
||||
# WHERE NOT EXISTS (SELECT 1 FROM Devices
|
||||
# WHERE dev_MAC = DHCP_MAC) """,
|
||||
# (startTime, startTime) )
|
||||
print_log ('New Devices end')
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
@@ -1201,7 +1261,7 @@ def write_file (pPath, pText):
|
||||
file.close()
|
||||
else:
|
||||
file = open (pPath, 'w', encoding='utf-8')
|
||||
file.write (ptext)
|
||||
file.write (pText)
|
||||
file.close()
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
BIN
db/pialert.db
95
docs/DEVICE_MANAGEMENT.md
Normal file
@@ -0,0 +1,95 @@
|
||||
# Pi.Alert - Device Management
|
||||
<!--- --------------------------------------------------------------------- --->
|
||||
To edit device information:
|
||||
- Select "Devices" in the menu on the left of the screen
|
||||
- Find the device you want to edit in the central table
|
||||
- Go to the device page by clicking on the device name or status
|
||||
- Press "Details" tab of the device
|
||||
- Edit the device data
|
||||
- Press the "Save" button
|
||||
|
||||
|
||||
![Device Details][screen1]
|
||||
|
||||
|
||||
## Main Info
|
||||
- **MAC**: MAC addres of the device. Not editable.
|
||||
- **Name**: Friendly device name
|
||||
- **Owner**: Device owner (The list is self-populated with existing owners)
|
||||
- **Type**: Select a device type from the dropdown list (Smartphone, Table,
|
||||
Laptop, TV, router, ....) or type a new device type
|
||||
- **Vendor**: Automatically updated by Pi.Alert
|
||||
- **Favorite**: Mark the device as favorite and then it will appears at the
|
||||
begining of the device list
|
||||
- **Group**: Select a grouper ('Always on', 'Personal', Friends') or type
|
||||
your own Group name
|
||||
- **Comments**: Type any comments for the device
|
||||
|
||||
## Session Info
|
||||
- **Status**: Show device status : On-line / Off-Line
|
||||
- **First Session**: Date and time of the first connection
|
||||
- **Last Session**: Date and time of the last connection
|
||||
- **Last IP**: Last known IP used during the last connection
|
||||
- **Static IP**: Check this box to identify devices that always use the
|
||||
same IP
|
||||
|
||||
## Events & Alerts config
|
||||
- **Scan Cycle**: Select the scan cycle: 0, 1', 15'
|
||||
- Some devices do not respond to all ARP packets, for this cases is better
|
||||
to use a 15' cycle.
|
||||
- **For Apple devices I recommend using 15' cycle**
|
||||
- **Alert All Events**: Send a notification in each event (connection,
|
||||
disconnection, IP Changed, ...)
|
||||
- **Alert Down**: Send a notification when the device is down
|
||||
- *(Userful with "always connected" devices: Router, AP, Camera, Alexa,
|
||||
...)*
|
||||
- **Skip repeated notifications during**: Do not send more than one
|
||||
notification to this device for X hours
|
||||
- *(Useful to avoid notification saturation on devices that frequently
|
||||
connects and disconnects)*
|
||||
|
||||
# Privacy & Random MAC's
|
||||
<!--- --------------------------------------------------------------------- --->
|
||||
|
||||
The latest versions of some operating systems (IOS and Android) incorporate a
|
||||
new & interesting functionality to improve privacy: **Random MACs**.
|
||||
|
||||
This functionality allows you to **hide the true MAC** of the device and
|
||||
**assign a random MAC** when we connect to WIFI networks.
|
||||
|
||||
This behavior is especially useful when connecting to WIFI's that we do not
|
||||
know, but it **is totally useless when connecting to our own WIFI's** or known
|
||||
networks.
|
||||
|
||||
**I recommend disabling this operation when connecting our devices to our own
|
||||
WIFI's**, in this way, Pi.Alert will be able to identify the device, and it
|
||||
will not identify it as a new device every so often (every time IOS or Android
|
||||
decides to change the MAC).
|
||||
|
||||
### IOS
|
||||
![ios][ios]
|
||||
|
||||
- [Use private Wi-Fi addresses in iOS 14](https://support.apple.com/en-us/HT211227)
|
||||
|
||||
### Android
|
||||
![Android][Android]
|
||||
|
||||
- [How to Disable MAC Randomization in Android 10](https://support.boingo.com/s/article/How-to-Disable-MAC-Randomization-in-Android-10-Android-Q)
|
||||
- [How do I disable random Wi-Fi MAC address on Android 10](https://support.plume.com/hc/en-gb/articles/360052070714-How-do-I-disable-random-Wi-Fi-MAC-address-on-Android-10-)
|
||||
|
||||
### License
|
||||
GPL 3.0
|
||||
[Read more here](LICENSE.txt)
|
||||
|
||||
### Contact
|
||||
pi.alert.application@gmail.com
|
||||
|
||||
***Suggestions and comments are welcome***
|
||||
|
||||
|
||||
<!--- --------------------------------------------------------------------- --->
|
||||
[main]: ./img/1_devices.jpg "Main screen"
|
||||
[screen1]: ./img/2_1_device_details.jpg "Screen 1"
|
||||
[ios]: https://9to5mac.com/wp-content/uploads/sites/6/2020/08/how-to-use-private-wifi-mac-address-iphone-ipad.png?resize=2048,1009 "ios"
|
||||
[Android]: ./img/android_random_mac.jpg "Android"
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
Initially designed to run on a Raspberry PI, probably it can run on many other
|
||||
Linux distributions.
|
||||
|
||||
Stimated time: 20'
|
||||
Estimated time: 20'
|
||||
|
||||
### Dependencies
|
||||
| Dependency | Comments |
|
||||
@@ -34,7 +34,7 @@ Stimated time: 20'
|
||||
password: raspberry
|
||||
```
|
||||
|
||||
5 - Change de default password of pi user
|
||||
5 - Change the default password of pi user
|
||||
```
|
||||
passwd
|
||||
```
|
||||
@@ -76,7 +76,7 @@ Stimated time: 20'
|
||||
|
||||
5 - Connect to web admin panel
|
||||
- http://192.168.1.x/admin/
|
||||
- (*replace the 192.168.1.x with your Raspberry IP*)
|
||||
- (*replace 192.168.1.x with your Raspberry IP*)
|
||||
|
||||
6 - Activate DHCP server
|
||||
- Pi-hole -> Settings -> DHCP -> Mark "DHCP server enabled"
|
||||
@@ -84,14 +84,15 @@ Stimated time: 20'
|
||||
7 - Add pi.alert DNS Record
|
||||
- Pi-hole -> Local DNS -> DNS Records -> Add new domain /IP
|
||||
- pi.alert 192.168.1.x
|
||||
- (*replace the 192.168.1.x with your Raspberry IP*)
|
||||
- (*replace 192.168.1.x with your Raspberry IP*)
|
||||
|
||||
8 - Deactivate your current DHCP Server (*Normaly at your router or AP*)
|
||||
|
||||
9 - Renew your computer IP to unsure you are using the new DHCP and DNS server
|
||||
- Windows: cmd -> ipconfig /renew
|
||||
- Linux: shell -> sudo dhclient -r; sudo dhclient
|
||||
- Mac: Apple menu -> System Preferences -> Network -> Select the network -> Advanced -> TCP/IP -> Renew DHCP Lease
|
||||
- Mac: Apple menu -> System Preferences -> Network -> Select the network ->
|
||||
Advanced -> TCP/IP -> Renew DHCP Lease
|
||||
|
||||
## arp-scan & Python
|
||||
<!--- --------------------------------------------------------------------- --->
|
||||
@@ -114,7 +115,7 @@ Stimated time: 20'
|
||||
|
||||
## Pi.Alert
|
||||
<!--- --------------------------------------------------------------------- --->
|
||||
1- Download Pi.Alert and uncmompress
|
||||
1- Download Pi.Alert and uncompress
|
||||
```
|
||||
curl -LO https://github.com/pucherot/Pi.Alert/raw/main/install/pialert_latest.tar
|
||||
tar xvf pialert_latest.tar
|
||||
@@ -126,7 +127,7 @@ Stimated time: 20'
|
||||
sudo ln -s /home/pi/pialert/front /var/www/html/pialert
|
||||
```
|
||||
|
||||
3 - Update lighttp config
|
||||
3 - Update lighttpd config
|
||||
```
|
||||
sudo sh -c "printf '\n\n\$HTTP[\"host\"] == \"pi.alert\" {\n server.document-root = \"/var/www/html/pialert/\"\n}\n' >> /etc/lighttpd/external.conf"
|
||||
sudo /etc/init.d/lighttpd restart
|
||||
@@ -135,14 +136,15 @@ Stimated time: 20'
|
||||
4 - If you want to use email reporting with gmail
|
||||
- Go to your Google Account https://myaccount.google.com/
|
||||
- On the left navigation panel, click Security
|
||||
- On the bottom of the page, in the Less secure app access panel, click Turn on access
|
||||
- On the bottom of the page, in the Less secure app access panel,
|
||||
click Turn on access
|
||||
- Click Save button
|
||||
|
||||
5 - Config Pialert parameters
|
||||
```
|
||||
nano ~/pialert/back/pialert.conf
|
||||
```
|
||||
- if you want to use email reporting, configure this parameters
|
||||
- If you want to use email reporting, configure this parameters
|
||||
```
|
||||
REPORT_MAIL = True
|
||||
SMTP_USER = 'user@gmail.com'
|
||||
@@ -150,7 +152,7 @@ Stimated time: 20'
|
||||
REPORT_TO = 'user@gmail.com'
|
||||
```
|
||||
|
||||
- if you want to update yout Dynamic DNS, configure this parameters
|
||||
- If you want to update your Dynamic DNS, configure this parameters
|
||||
```
|
||||
DDNS_ACTIVE = True
|
||||
DDNS_DOMAIN = 'your_domain.freeddns.org'
|
||||
@@ -159,7 +161,7 @@ Stimated time: 20'
|
||||
DDNS_UPDATE_URL = 'https://api.dynu.com/nic/update?'
|
||||
```
|
||||
|
||||
- if you have installed Pi.hole and DHCP, activate this parameters
|
||||
- If you have installed Pi.hole and DHCP, activate this parameters
|
||||
```
|
||||
PIHOLE_ACTIVE = True
|
||||
DHCP_ACTIVE = True
|
||||
@@ -181,8 +183,29 @@ Stimated time: 20'
|
||||
(crontab -l 2>/dev/null; cat ~/pialert/back/pialert.cron) | crontab -
|
||||
```
|
||||
|
||||
9 - Use admin panel to configure the devices
|
||||
9 - Add permissions to the web-server user
|
||||
```
|
||||
sudo chgrp -R www-data ~/pialert/back ~/pialert/back/pialert.conf ~/pialert/front ~/pialert/db
|
||||
chmod -R 770 ~/pialert/back ~/pialert/back/pialert.conf ~/pialert/front ~/pialert/db
|
||||
```
|
||||
|
||||
10 - Check DNS record por pi.alert (explained in point 7 of Pi.hole installing)
|
||||
- Add pi.alert DNS Record
|
||||
- Pi-hole -> Local DNS -> DNS Records -> Add new domain /IP
|
||||
- pi.alert 192.168.1.x
|
||||
- (*replace 192.168.1.x with your Raspberry IP*)
|
||||
|
||||
11 - Use admin panel to configure the devices
|
||||
- http://pi.alert/
|
||||
- http://192.168.1.x/pialert/
|
||||
- (*replace 192.168.1.x with your Raspberry IP*)
|
||||
|
||||
|
||||
## Device Management
|
||||
<!--- --------------------------------------------------------------------- --->
|
||||
|
||||
- [Device Management instructions](./DEVICE_MANAGEMENT.md)
|
||||
|
||||
|
||||
### License
|
||||
GPL 3.0
|
||||
44
docs/RAMDOM_MAC.md
Normal file
@@ -0,0 +1,44 @@
|
||||
# Privacy & Random MAC's
|
||||
<!--- --------------------------------------------------------------------- --->
|
||||
|
||||
The latest versions of some operating systems (IOS and Android) incorporate a
|
||||
new & interesting functionality to improve privacy: **Random MACs**.
|
||||
|
||||
This functionality allows you to **hide the true MAC** of the device and
|
||||
**assign a random MAC** when we connect to WIFI networks.
|
||||
|
||||
This behavior is especially useful when connecting to WIFI's that we do not
|
||||
know, but it **is totally useless when connecting to our own WIFI's** or known
|
||||
networks.
|
||||
|
||||
**I recommend disabling this operation when connecting our devices to our own
|
||||
WIFI's**, in this way, Pi.Alert will be able to identify the device, and it
|
||||
will not identify it as a new device every so often (every time IOS or Android
|
||||
decides to change the MAC).
|
||||
|
||||
### IOS
|
||||
![ios][ios]
|
||||
|
||||
- [Use private Wi-Fi addresses in iOS 14](https://support.apple.com/en-us/HT211227)
|
||||
|
||||
### Android
|
||||
![Android][Android]
|
||||
|
||||
- [How to Disable MAC Randomization in Android 10](https://support.boingo.com/s/article/How-to-Disable-MAC-Randomization-in-Android-10-Android-Q)
|
||||
- [How do I disable random Wi-Fi MAC address on Android 10](https://support.plume.com/hc/en-gb/articles/360052070714-How-do-I-disable-random-Wi-Fi-MAC-address-on-Android-10-)
|
||||
|
||||
|
||||
### License
|
||||
GPL 3.0
|
||||
[Read more here](LICENSE.txt)
|
||||
|
||||
### Contact
|
||||
pi.alert.application@gmail.com
|
||||
|
||||
***Suggestions and comments are welcome***
|
||||
|
||||
|
||||
<!--- --------------------------------------------------------------------- --->
|
||||
[ios]: https://9to5mac.com/wp-content/uploads/sites/6/2020/08/how-to-use-private-wifi-mac-address-iphone-ipad.png?resize=2048,1009 "ios"
|
||||
[Android]: ./img/android_random_mac.jpg "Android"
|
||||
|
||||
|
Before Width: | Height: | Size: 168 KiB After Width: | Height: | Size: 168 KiB |
|
Before Width: | Height: | Size: 129 KiB After Width: | Height: | Size: 129 KiB |
|
Before Width: | Height: | Size: 106 KiB After Width: | Height: | Size: 106 KiB |
|
Before Width: | Height: | Size: 135 KiB After Width: | Height: | Size: 135 KiB |
|
Before Width: | Height: | Size: 136 KiB After Width: | Height: | Size: 136 KiB |
|
Before Width: | Height: | Size: 43 KiB After Width: | Height: | Size: 43 KiB |
|
Before Width: | Height: | Size: 78 KiB After Width: | Height: | Size: 78 KiB |
BIN
docs/img/android_random_mac.jpg
Normal file
|
After Width: | Height: | Size: 551 KiB |
@@ -16,7 +16,7 @@
|
||||
<td>
|
||||
<table width=100% border=0 bgcolor=#FFD966 cellpadding=5px cellspacing=0 style="border-collapse: collapse; font-size: 16px; text-align:center; color:#5F5000">
|
||||
<tr>
|
||||
<td width=33%> Report Date: <b>2021-01-02 08:20</b> </td>
|
||||
<td width=33%> Report Date: <b>2021-01-01 08:00</b> </td>
|
||||
<td width=34%> Scan Cycle: <b>Internet</b> </td>
|
||||
<td width=33%> Server: <b>pi4</b> </td>
|
||||
</tr>
|
||||
@@ -39,7 +39,7 @@
|
||||
|
||||
<tr>
|
||||
<td> Internet IP Changed </td>
|
||||
<td> 2021-01-02 08:20:00 </td>
|
||||
<td> 2021-01-01 08:00:00 </td>
|
||||
<td style="font-size: 24px; color:#D02020"> 1.1.1.0 </td>
|
||||
<td> Previous Internet IP: 1.1.0.0 </td>
|
||||
</tr>
|
||||
@@ -58,8 +58,8 @@
|
||||
<td>
|
||||
<table width=100% border=0 bgcolor=#70AD47 cellpadding=5px cellspacing=0 style="border-collapse: collapse; font-size: 12px; font-weight: bold; color:#385723">
|
||||
<tr>
|
||||
<td width=25% style="text-align:Left"> Puche 2020</td>
|
||||
<td width=50% style="text-align:center"> Pi.Alert 2.50 / 2020-12-30 </td>
|
||||
<td width=25% style="text-align:Left"> Puche 2021</td>
|
||||
<td width=50% style="text-align:center"> Pi.Alert 2.50 / 2021-01-01 </td>
|
||||
<td width=25% style="text-align:right"> GNU GPLv3</td>
|
||||
</tr>
|
||||
</table>
|
||||
@@ -16,7 +16,7 @@
|
||||
<td>
|
||||
<table width=100% border=0 bgcolor=#FFD966 cellpadding=5px cellspacing=0 style="border-collapse: collapse; font-size: 16px; text-align:center; color:#5F5000">
|
||||
<tr>
|
||||
<td width=33%> Report Date: <b>2021-01-02 08:20</b> </td>
|
||||
<td width=33%> Report Date: <b>2021-01-01 08:00</b> </td>
|
||||
<td width=34%> Scan Cycle: <b>1</b> </td>
|
||||
<td width=33%> Server: <b>pi4</b> </td>
|
||||
</tr>
|
||||
@@ -43,13 +43,13 @@
|
||||
|
||||
<tr>
|
||||
<td> f8:d0:27:00:00:00 </td>
|
||||
<td> 2021-01-02 08:20:00 </td>
|
||||
<td> 2021-01-01 08:00:00 </td>
|
||||
<td> 192.168.1.20 </td>
|
||||
<td> Seiko Epson Corporation </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> c8:6c:3d:00:00:00 </td>
|
||||
<td> 2021-01-02 08:20:00 </td>
|
||||
<td> 2021-01-01 08:00:00 </td>
|
||||
<td> 192.168.1.181 </td>
|
||||
<td> Amazon Technologies Inc. </td>
|
||||
</tr>
|
||||
@@ -72,7 +72,7 @@
|
||||
|
||||
<tr>
|
||||
<td> 0c:ee:99:00:00:00 </td>
|
||||
<td> 2021-01-02 08:20:00 </td>
|
||||
<td> 2021-01-01 08:00:00 </td>
|
||||
<td> 192.168.1.171 </td>
|
||||
<td> Alexa - Echo </td>
|
||||
</tr>
|
||||
@@ -97,7 +97,7 @@
|
||||
|
||||
<tr>
|
||||
<td> 94:0c:98:00:00:00 </td>
|
||||
<td> 2021-01-02 08:20:00 </td>
|
||||
<td> 2021-01-01 08:00:00 </td>
|
||||
<td> 192.168.1.132 </td>
|
||||
<td> Connected </td>
|
||||
<td> Person 1 - iPhone 11 </td>
|
||||
@@ -105,7 +105,7 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td> 5c:41:5a:00:00:00 </td>
|
||||
<td> 2021-01-02 08:20:00 </td>
|
||||
<td> 2021-01-01 08:00:00 </td>
|
||||
<td> 192.168.1.170 </td>
|
||||
<td> IP Changed </td>
|
||||
<td> Alexa Dot </td>
|
||||
@@ -121,8 +121,8 @@
|
||||
<td>
|
||||
<table width=100% border=0 bgcolor=#70AD47 cellpadding=5px cellspacing=0 style="border-collapse: collapse; font-size: 12px; font-weight: bold; color:#385723">
|
||||
<tr>
|
||||
<td width=25% style="text-align:Left"> Puche 2020</td>
|
||||
<td width=50% style="text-align:center"> Pi.Alert 2.50 / 2020-12-30 </td>
|
||||
<td width=25% style="text-align:Left"> Puche 2021</td>
|
||||
<td width=50% style="text-align:center"> Pi.Alert 2.50 / 2021-01-01 </td>
|
||||
<td width=25% style="text-align:right"> GNU GPLv3</td>
|
||||
</tr>
|
||||
</table>
|
||||
@@ -1,10 +1,28 @@
|
||||
|
||||
<!-- Main Footer -->
|
||||
<footer class="main-footer">
|
||||
<!-- Default to the left -->
|
||||
|
||||
<!--
|
||||
© 2020 Puche
|
||||
-->
|
||||
<?php
|
||||
$conf_file = '../back/pialert.conf';
|
||||
$conf_data = parse_ini_file($conf_file);
|
||||
echo '<span style="display:inline-block; transform: rotate(180deg)">©</span> '. $conf_data['VERSION_YEAR'] .' Puche';
|
||||
?>
|
||||
|
||||
<!-- To the right -->
|
||||
<div class="pull-right no-hidden-xs">
|
||||
|
||||
<!--
|
||||
Pi.alert  2.50  <small>(2019-12-30)</small>
|
||||
-->
|
||||
<?php
|
||||
$conf_file = '../back/pialert.conf';
|
||||
$conf_data = parse_ini_file($conf_file);
|
||||
echo 'Pi.alert  '. $conf_data['VERSION'] .'  <small>('. $conf_data['VERSION_DATE'] .')</small>';
|
||||
?>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
|
||||
@@ -91,15 +91,20 @@
|
||||
<li class="user-body">
|
||||
<div class="row">
|
||||
<div class="col-xs-4 text-center">
|
||||
<a href="https://github.com/pucherot/Pi.Alert">GitHub</a>
|
||||
</div>
|
||||
<div class="col-xs-4 text-center">
|
||||
<a href="https://github.com/pucherot/Pi.Alert">Pi.Alert</a>
|
||||
<!-- <a href="#">Website</a> -->
|
||||
<a href="https://github.com/pucherot/Pi.Alert">GitHub</a>
|
||||
</div>
|
||||
<!--
|
||||
<div class="col-xs-4 text-center">
|
||||
<a href="https://github.com/pucherot/Pi.Alert">Pi.Alert</a>
|
||||
</div>
|
||||
-->
|
||||
<!--
|
||||
<div class="col-xs-4 text-center">
|
||||
<a href="#">Updates</a>
|
||||
</div>
|
||||
-->
|
||||
</div>
|
||||
<!-- /.row -->
|
||||
</li>
|
||||
|
||||
@@ -1,3 +1,18 @@
|
||||
rm pialert/install/pialert_2.50.tar
|
||||
tar cvf pialert/install/pialert_2.50.tar -h --exclude="pialert/install" --exclude="pialert/.git" pialert
|
||||
#
|
||||
PIALERT_VERSION=`awk '$1=="VERSION" { print $3 }' ../back/pialert.conf | tr -d \'`
|
||||
PIALERT_DEV_PATH=/media/WD_4TB/dev
|
||||
|
||||
cd $PIALERT_DEV_PATH
|
||||
pwd
|
||||
|
||||
ls -l pialert/install/pialert*.tar
|
||||
tar tvf pialert/install/pialert_latest.tar | wc -l
|
||||
rm pialert/install/pialert_*.tar
|
||||
|
||||
tar cvf pialert/install/pialert_$PIALERT_VERSION.tar --exclude="pialert/install" --exclude="pialert/.git" pialert | wc -l
|
||||
|
||||
ln -s pialert_$PIALERT_VERSION.tar pialert/install/pialert_latest.tar
|
||||
ls -l pialert/install/pialert*.tar
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
<td>
|
||||
<table width=100% border=0 bgcolor=#FFD966 cellpadding=5px cellspacing=0 style="border-collapse: collapse; font-size: 16px; text-align:center; color:#5F5000">
|
||||
<tr>
|
||||
<td width=33%> Report Date: <b>2021-01-04 18:08</b> </td>
|
||||
<td width=33%> Report Date: <b>2021-01-01 08:00</b> </td>
|
||||
<td width=34%> Scan Cycle: <b>1</b> </td>
|
||||
<td width=33%> Server: <b>pi4</b> </td>
|
||||
</tr>
|
||||
@@ -34,8 +34,8 @@
|
||||
<td>
|
||||
<table width=100% border=0 bgcolor=#70AD47 cellpadding=5px cellspacing=0 style="border-collapse: collapse; font-size: 12px; font-weight: bold; color:#385723">
|
||||
<tr>
|
||||
<td width=25% style="text-align:Left"> Puche 2020</td>
|
||||
<td width=50% style="text-align:center"> Pi.Alert DEV 2.50 / 2020-12-30 </td>
|
||||
<td width=25% style="text-align:Left"> Puche 2021</td>
|
||||
<td width=50% style="text-align:center"> Pi.Alert 2.50 / 2021-01-01 </td>
|
||||
<td width=25% style="text-align:right"> GNU GPLv3</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
Pi.Alert Report
|
||||
========================================
|
||||
|
||||
Report Date: 2021-01-01 00:00
|
||||
Report Date: 2021-01-01 08:00
|
||||
Scan Cycle: 1
|
||||
Server: pi4
|
||||
|
||||
@@ -12,4 +12,4 @@ Events
|
||||
|
||||
|
||||
----------------------------------------------------------------------
|
||||
Puche 2020 Pi.Alert 2.50 / 2020-12-30 GNU GPLv3
|
||||
Puche 2021 Pi.Alert 2.50 / 2021-01-01 GNU GPLv3
|
||||
|
||||