Compare commits

..

19 Commits
v2.50 ... v2.51

Author SHA1 Message Date
pucherot
8bf95aed5b v2.51
Fix Bug #1
2021-01-11 14:16:22 +01:00
pucherot
2f9ccddd09 tar update 2021-01-10 10:54:20 +01:00
pucherot
d0d5512e89 Doc update 2021-01-10 10:46:49 +01:00
pucherot
4c51e6cd43 Docs update 2021-01-10 10:41:21 +01:00
pucherot
35be1e65ea Update RAMDOM_MAC.md 2021-01-10 10:21:14 +01:00
pucherot
6b53dc54f5 Create RAMDOM_MAC.md 2021-01-10 10:20:48 +01:00
pucherot
3f0b7d9e2d Add files via upload 2021-01-10 10:18:50 +01:00
pucherot
f2b6cf9f0c tar 2021-01-09 22:10:37 +01:00
pucherot
1e6093fa50 Update README.md 2021-01-09 21:24:47 +01:00
pucherot
5026b8c66e Update README.md 2021-01-09 21:20:54 +01:00
pucherot
3a622b05be Doc 2021-01-09 21:08:05 +01:00
pucherot
97ae38fbbf tar 2021-01-09 20:44:00 +01:00
pucherot
ec07af84a9 Tar 2021-01-09 20:41:56 +01:00
pucherot
49f5dd3c39 Tar 2021-01-09 20:26:19 +01:00
pucherot
f74246a1ec Update README.md 2021-01-09 15:41:38 +01:00
pucherot
2cf457e145 Update README.md 2021-01-09 15:04:15 +01:00
pucherot
d7913af341 Update README.md 2021-01-09 14:20:30 +01:00
pucherot
0c55310ca8 Update README.md 2021-01-09 14:20:02 +01:00
pucherot
87fbf1d587 Update README.md 2021-01-09 14:19:33 +01:00
23 changed files with 202 additions and 33 deletions

View File

@@ -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"

View File

@@ -1,6 +1,6 @@
VERSION = '2.50'
VERSION_YEAR = '2020'
VERSION_DATE = '2020-12-30'
VERSION = '2.51'
VERSION_YEAR = '2021'
VERSION_DATE = '2021-01-11'
DB_PATH = '/home/pi/pialert/db/pialert.db'
LOG_PATH = '/home/pi/pialert/log'

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
# Pi.Alert v2.50 / 2020-12-30
# Pi.Alert v2.51 / 2021-01-11
# Puche 2020
# GNU GPLv3
@@ -486,10 +486,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")

95
docs/DEVICE_MANAGEMENT.md Normal file
View 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"

View File

@@ -91,7 +91,8 @@ Stimated time: 20'
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
<!--- --------------------------------------------------------------------- --->
@@ -135,7 +136,8 @@ 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
@@ -184,6 +186,13 @@ Stimated time: 20'
9 - Use admin panel to configure the devices
- http://pi.alert/
## Device Management
<!--- --------------------------------------------------------------------- --->
- [Device Management instructions](./DEVICE_MANAGEMENT.md)
### License
GPL 3.0
[Read more here](LICENSE.txt)

44
docs/RAMDOM_MAC.md Normal file
View 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"

View File

Before

Width:  |  Height:  |  Size: 168 KiB

After

Width:  |  Height:  |  Size: 168 KiB

View File

Before

Width:  |  Height:  |  Size: 129 KiB

After

Width:  |  Height:  |  Size: 129 KiB

View File

Before

Width:  |  Height:  |  Size: 106 KiB

After

Width:  |  Height:  |  Size: 106 KiB

View File

Before

Width:  |  Height:  |  Size: 135 KiB

After

Width:  |  Height:  |  Size: 135 KiB

View File

Before

Width:  |  Height:  |  Size: 136 KiB

After

Width:  |  Height:  |  Size: 136 KiB

View File

Before

Width:  |  Height:  |  Size: 43 KiB

After

Width:  |  Height:  |  Size: 43 KiB

View File

Before

Width:  |  Height:  |  Size: 78 KiB

After

Width:  |  Height:  |  Size: 78 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 551 KiB

View File

@@ -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-11 08:00</b> </td>
<td width=34%> Scan Cycle: <b>Internet</b> </td>
<td width=33%> Server: <b>pi4</b> </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 &nbsp; / &nbsp; 2020-12-30 </td>
<td width=25% style="text-align:Left"> Puche 2021</td>
<td width=50% style="text-align:center"> Pi.Alert 2.51 &nbsp; / &nbsp; 2021-01-11 </td>
<td width=25% style="text-align:right"> GNU GPLv3</td>
</tr>
</table>

View File

@@ -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-11 08:00</b> </td>
<td width=34%> Scan Cycle: <b>1</b> </td>
<td width=33%> Server: <b>pi4</b> </td>
</tr>
@@ -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 &nbsp; / &nbsp; 2020-12-30 </td>
<td width=25% style="text-align:Left"> Puche 2021</td>
<td width=50% style="text-align:center"> Pi.Alert 2.51 &nbsp; / &nbsp; 2021-01-11 </td>
<td width=25% style="text-align:right"> GNU GPLv3</td>
</tr>
</table>

View File

@@ -1,10 +1,10 @@
<!-- Main Footer -->
<footer class="main-footer">
<!-- Default to the left -->
&copy; 2020 Puche
&copy; 2021 Puche
<!-- To the right -->
<div class="pull-right no-hidden-xs">
Pi.alert&nbsp&nbsp2.50&nbsp&nbsp<small>(2019-12-30)</small>
Pi.alert&nbsp&nbsp2.51&nbsp&nbsp<small>(2021-01-11)</small>
</div>
</footer>

View File

@@ -1,3 +1,9 @@
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=2.50
PIALERT_DEV_PATH=/media/WD_4TB/dev
cd $PIALERT_DEV_PATH
tar tvf pialert/install/pialert_$PIALERT_VERSION.tar | wc -l
rm pialert/install/pialert_$PIALERT_VERSION.tar
tar cvf pialert/install/pialert_$PIALERT_VERSION.tar --exclude="pialert/install" --exclude="pialert/.git" pialert | wc -l

Binary file not shown.

Binary file not shown.

View File

@@ -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 &nbsp; / &nbsp; 2020-12-30 </td>
<td width=25% style="text-align:Left"> Puche 2021</td>
<td width=50% style="text-align:center"> Pi.Alert DEV 2.51 &nbsp; / &nbsp; 2021-01-11 </td>
<td width=25% style="text-align:right"> GNU GPLv3</td>
</tr>
</table>

View File

@@ -2,7 +2,7 @@
Pi.Alert Report
========================================
Report Date: 2021-01-01 00:00
Report Date: 2021-01-11 00: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.51 / 2021-01-11 GNU GPLv3