wifeye/README.md
2024-11-17 14:33:33 -08:00

113 lines
7.6 KiB
Markdown

# Wifeye
Track all Wi-Fi connected devices for real-time updates and better network security. This program works with routers that use 10.0.0.1 as the admin panel, like Xfinity routers.
<p align="center"><img src="docs/assets/img/preview.png" width=80% alt=""></p>
## Installation
```
virtualenv -p python .venv
source .venv/bin/activate
pip install -r requirements.txt
```
## Usage
```
python wifeye.py
```
### Configuration
Edit `conf.yml`:
```yaml
ADMIN_USERNAME: admin
ADMIN_PASSWORD: Password
REFRESH_TIME: 10
```
- ADMIN_USERNAME: Username for the router's admin panel
- ADMIN_PASSWORD: Password for the router's admin panel
- REFRESH_TIME: How often the data refreshes (in seconds)
### Log Files
1. `device_data.log` saves the status of all devices every time it refreshes. Each record has the time and details about each device.
**Example**:
```json
{
"timestamp": "2024-01-01 00:00:00",
"data": [
{
"name": "phone",
"online": true,
"ip_type": "DHCP",
"rssi": -40,
"network": "Wi-Fi 5G",
"frequency": 5000,
"distance": 0.02,
"device_info": {
"ipv4_address": "10.0.0.2",
"ipv6_address": "1111:000:ffff:0000:0000:000:0000:1111",
"local_link_ipv6_address": "fe80::1111:0000:ffff:1111",
"mac_address": "01:00:01:00:00:01"
}
},
{
"name": "laptop",
"online": false,
"ip_type": null,
"rssi": null,
"network": null,
"frequency": null,
"distance": null,
"device_info": {
...
}
}
]
}
{
"timestamp": "2024-01-01 00:01:00",
"data": [
{
...
```
| Key | Description |
| ----------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| timestamp | Date and time of the log (YYYY-MM-DD HH:mm:ss) |
| data | Array of device objects |
| name | Device name (e.g., "Phone") |
| online | Connection status (true for online, false for offline) |
| ip_type | Type of IP allocation (e.g., "DHCP" or "Reserved") |
| rssi | Signal strength (dBm) |
| network | Wi-Fi network name (e.g., "Wi-Fi 5G" or "Wi-Fi 2.4G") |
| frequency | Wi-Fi frequency in MHz |
| distance | Distance to the router in meters.<br><img src="./docs/assets/img/math.png" width=300px alt="The distance is equal to ten raised to the power of the fraction where the numerator is 30 minus the received signal strength indicator (RSSI) minus twenty times the base ten logarithm of the frequency minus 32.44, and the denominator is 20."> |
| device_info | Detailed device information, including: |
| ipv4_address | Assigned IPv4 address |
| ipv6_address | Assigned IPv6 address |
| local_link_ipv6_address | Local link IPv6 address |
| mac_address | Device MAC address |
2. `device_list.log` keeps a list of all unique devices and tracks when they go online or offline, including the time of each change.
**Example**:
```json
{
"timestamp": "2024-01-01 00:00:00",
"name": "phone",
"online": true
}
{
"timestamp": "2024-01-01 00:01:00",
"name": "phone",
"online": false
}
```