Skip to main content

A lightweight Flask-based dashboard for scanning and monitoring LAN devices

Project description

======================================================================= 🌐 UbuntuWebServer - Flask Network Scanner

A modern, lightweight network device scanner built with Flask and Python. Detects all devices on your local network (IP, MAC, hostname, vendor, OS) and provides a clean, auto-refreshing web UI. Optional cron-based deep scans and tagging/notes for known hosts.


✅ PROJECT GOAL

Create a web-based dashboard that:

  • Scans LAN for connected devices (IP, MAC, Hostname, Vendor, OS)
  • Stores and displays known devices in a SQLite database
  • Provides an editable UI for tagging/notes
  • Supports automated OS scanning and refresh via cron
  • Can run persistently with systemd or a background process

🛠 TOOLS & TECHNOLOGIES

Task Tool
Web Server Flask (Apache2 optional)
Backend Python 3.10+
Network Scanning nmap, mac-vendor-lookup
Frontend UI HTML/CSS, Bootstrap
Database Storage SQLite
Scheduling cron (Linux/macOS)
Startup Service systemd (Linux)

🧱 ARCHITECTURE OVERVIEW

[ Ubuntu Server / Windows / Mac ] | [ Flask App - app.py ] | [ nmap scan → parsed into DB ] | [ SQLite + MAC Vendor DB ] | [ Auto-refresh Web UI /cron ]


🧪 INSTALLATION INSTRUCTIONS

  1. Clone and Set Up Environment

git clone https://github.com/tjohnsonII/UbuntuWebServer.git cd UbuntuWebServer python3 -m venv venv source venv/bin/activate pip install -r requirements.txt

  1. Install System Dependencies (Linux/macOS)

sudo apt update sudo apt install nmap sqlite3 -y

  1. Initialize the Database

bash init_db.sh

  1. Run the Web App

bash run_flask.sh

Then open in browser: http://:5000


🔁 GITHUB SYNC & AUTO RESTART

To sync latest updates from GitHub and restart Flask: bash sync_from_github.sh


🔂 AUTOMATE DEEP OS SCANNING

To install cron job that scans every 30 minutes: bash install_cron.sh

This creates: */30 * * * * /usr/bin/python3 /home//UbuntuWebServer/deep_scan.py


🚀 ENABLE ON BOOT (systemd)

sudo cp flaskscanner.service /etc/systemd/system/ sudo systemctl daemon-reload sudo systemctl enable flaskscanner sudo systemctl start flaskscanner


🧾 ADD / EDIT KNOWN HOSTS

Run this to insert devices with notes: python insert_known_host.py

Prompts for:

  • MAC
  • IP
  • Hostname
  • Vendor
  • OS
  • Notes

📂 PROJECT LAYOUT

File/Folder Purpose
ubuntuwebserver/app.py Flask scanner logic
deep_scan.py OS detection w/ cron
insert_known_host.py CLI insert known devices
init_db.py SQLite DB init
templates/scan_results.html Auto-refresh UI
known_hosts.db Local device info
sync_to_github.sh Push latest code
sync_from_github.sh Pull + restart
run_flask.sh Run web server
start-networkscanner.sh Smart launch script
flask.log / app_errors.log Logging

🌐 WEB UI FEATURES

  • Auto-refresh every 15 seconds
  • Search/filter by IP, MAC, hostname, vendor
  • Bootstrap responsive design
  • Color-coded vendor badges
  • OS detection support
  • Notes/comments per device

🛠 CROSS-PLATFORM NOTES

✔ Linux - Full support (cron, systemd, bash) ✔ macOS - Supported with brew install nmap sqlite3 ✔ Windows - Use Git Bash or WSL + Python 3.10+ - Adjust paths in bash scripts as needed - Flask auto-refresh supported


🩺 TROUBLESHOOTING

  • Port 5000 busy? Run: lsof -i :5000 or sudo fuser -k 5000/tcp
  • nmap not found? Run: sudo apt install nmap
  • Python error? Verify Python 3.10+ and correct venv
  • No output? Check scan logs in flask.log or run scanScript.py

⚠️ SECURITY WARNING

This tool is for private/internal LANs only. Do NOT expose to the public internet. There is no built-in authentication or encryption. Use firewalls, VPN, or nginx basic auth if needed.


📄 LICENSE

MIT License © 2025 Timothy Johnson II


🙋 AUTHOR

Timothy Johnson II Hosted PBX Engineer, 123NET GitHub: https://github.com/tjohnsonII

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ubuntuwebscanner-1.0.19.tar.gz (88.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ubuntuwebscanner-1.0.19-py3-none-any.whl (18.8 kB view details)

Uploaded Python 3

File details

Details for the file ubuntuwebscanner-1.0.19.tar.gz.

File metadata

  • Download URL: ubuntuwebscanner-1.0.19.tar.gz
  • Upload date:
  • Size: 88.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for ubuntuwebscanner-1.0.19.tar.gz
Algorithm Hash digest
SHA256 090f16fdf82bc4737a6d11f0079c048fdb26b4ee0c4d0c75ccbe9cdf550475ad
MD5 0671daa019d476c42cc3cb767a0202ed
BLAKE2b-256 f8728ad07ec79485dd08b1ad829c7eadcb1700ae943492b8adeb14e00c8a3b85

See more details on using hashes here.

File details

Details for the file ubuntuwebscanner-1.0.19-py3-none-any.whl.

File metadata

File hashes

Hashes for ubuntuwebscanner-1.0.19-py3-none-any.whl
Algorithm Hash digest
SHA256 7f3879e5a2bb4213882908fce2fc6f9182678c0844ac593fae95e388508315db
MD5 df2f5d4c40259cee07018750fcc4ca49
BLAKE2b-256 385dc3aa869930a623b8b19e86e06ce00ff9ea1cc8db4d4dc6001e3ea03b4596

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page