• This repository has been archived on 26/Feb/2023
  • Stars
    star
    161
  • Rank 233,470 (Top 5 %)
  • Language
    Go
  • License
    GNU Affero Genera...
  • Created about 4 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

List, wake and scan nodes in a network.

liwasc

liwasc demo video

List, wake and scan nodes in a network.

hydrun CI Docker CI Go Reference Matrix Docker Pulls Binary Downloads

Overview

liwasc is a high-performance network and port scanner. It can quickly give you a overview of the nodes in your network, the services that run on them and manage their power status.

It can ...

  • Scan a network: Using an ARP scan and the mac2vendor database, liwasc can list the nodes in a network, their power status, manufacturer information, IP & MAC addresses and more metadata
  • Scan a node: Using a high-performance custom TCP and UDP port scanner, liwasc can list the ports and services of a node and provide metadata (service names, registration dates etc.) using the Service Name and Transport Protocol Port Number Registry
  • Power on a node: By sending Wake-on-LAN packets, liwasc can turn on nodes in a network
  • Periodically scan a network: Using the integrated periodic scans feature, liwasc can periodically (based on a CRON syntax) scan a network and persist the results in a database
  • Give remote insight into a network: Because liwasc is based on open web technologies, has a gRPC API and supports OpenID Connect authentication, liwasc can be securely exposed to the public internet and serve as a remote controller for a network

Installation

Containerized

You can get the Docker container like so:

$ docker pull pojntfx/liwasc-backend

Natively

If you prefer a native installation, static binaries are also available on GitHub releases.

You can install them like so:

$ curl -L -o /tmp/liwasc-backend https://github.com/pojntfx/liwasc/releases/latest/download/liwasc-backend.linux-$(uname -m)
$ sudo install /tmp/liwasc-backend /usr/local/bin
$ sudo setcap cap_net_raw+ep /usr/local/bin/liwasc-backend # This allows rootless execution

About the Frontend

The frontend is also available on GitHub releases in the form of a static .tar.gz archive; to deploy it, simply upload it to a CDN or copy it to a web server. For most users, this shouldn't be necessary though; thanks to @maxence-charriere's go-app package, liwasc is a progressive web app. By simply visiting the public deployment once, it will be available for offline use whenever you need it.

Usage

1. Setting up Authentication

liwasc uses OpenID Connect for authentication, which means you can use almost any authentication provider, both self-hosted and as a service, that you want to. We've created a short tutorial video which shows how to set up Auth0 for this purpose, but feel free to use something like Ory if you prefer a self-hosted solution:

Setting up OpenID Connect for Internal Apps YouTube Video

2. (Option 1): Starting the Backend (Containerized)

Using Docker (or an alternative like Podman), you can easily start & configure the backend; see the Reference for more configuration parameters:

$ docker run \
    --name liwasc-backend \
    -d \
    --restart always \
    --net host \
    --cap-add NET_RAW \
    --ulimit nofile=16384:16384 \
    -v ${HOME}/.local/share/liwasc:/root/.local/share/liwasc:z \
    -e LIWASC_BACKEND_OIDCISSUER=https://pojntfx.eu.auth0.com/ \
    -e LIWASC_BACKEND_OIDCCLIENTID=myoidcclientid \
    -e LIWASC_BACKEND_DEVICENAME=eth0 \
    pojntfx/liwasc-backend

You can get the logs like so:

$ docker logs liwasc-backend

2. (Option 2): Starting the Backend (Natively)

If you prefer a native setup, you can also do a more traditional setup.

First, set up a config file at ~/.local/share/liwasc/etc/liwasc/liwasc-backend-config.yaml; see the Reference for more configuration parameters:

$ mkdir -p ~/.local/share/liwasc/etc/liwasc/
$ cat <<EOT >~/.local/share/liwasc/etc/liwasc/liwasc-backend-config.yaml
oidcIssuer: https://pojntfx.eu.auth0.com/
oidcClientID: myoidcclientid
deviceName: eth0
EOT

Now, create a systemd service for it:

$ mkdir -p ~/.config/systemd/user/
$ cat <<EOT >~/.config/systemd/user/liwasc-backend.service
[Unit]
Description=liwasc

[Service]
ExecStart=/usr/local/bin/liwasc-backend -c \${HOME}/.local/share/liwasc/etc/liwasc/liwasc-backend-config.yaml
LimitNOFILE=16384:16384

[Install]
WantedBy=multi-user.target
EOT

Finally, reload systemd and enable the service:

$ systemctl --user daemon-reload
$ systemctl --user enable --now liwasc-backend

You can get the logs like so:

$ journalctl --user -u liwasc-backend

3. Connecting the Frontend

Now that the backend is running, head over to https://pojntfx.github.io/liwasc/:

Alternatively, as described in About the Frontend, you can also choose to self-host. Once you're on the page, you should be presented with the following setup page:

Setup page

You'll have to enter your own information here; the Backend URL is the URL on which the backend runs, the OIDC Issuer, Client ID and Redirect URL are the same values that you've set the backend up with above.

Finally, click on Login, and if everything worked out fine you should be presented with the initial launch screen:

Initial page

🚀 That's it! We hope you enjoy using liwasc.

Reference

Command Line Arguments

$ liwasc-backend --help
liwasc is a high-performance network and port scanner. It can quickly give you a overview of the nodes in your network, the services that run on them and manage their power status.

For more information, please visit https://github.com/pojntfx/liwasc.

Usage:
  liwasc-backend [flags]

Flags:
  -c, --configFile string                            Config file to use
  -d, --deviceName string                            Network device name (default "eth0")
  -h, --help                                         help for liwasc-backend
  -l, --listenAddress string                         Listen address (default "localhost:15123")
      --mac2vendorDatabasePath string                Path to the mac2vendor database (default "/home/pojntfx/.local/share/liwasc/etc/liwasc/oui-database.sqlite")
      --mac2vendorDatabaseURL string                 URL to the mac2vendor database; will be downloaded on the first run if it doesn't exist (default "https://mac2vendor.com/download/oui-database.sqlite")
  -u, --maxConcurrentPortScans int                   Maximum concurrent port scans. Be sure to set this value to something lower than the systems ulimit or increase the latter (default 100)
      --nodeAndPortScanDatabasePath string           Path to the node and port scan database (default "/home/pojntfx/.local/share/liwasc/var/lib/liwasc/node_and_port_scan.sqlite")
      --nodeWakeDatabasePath string                  Path to the node wake database (default "/home/pojntfx/.local/share/liwasc/var/lib/liwasc/node_wake.sqlite")
  -t, --oidcClientID string                          OIDC client ID (default "myoidcclientid")
  -i, --oidcIssuer string                            OIDC issuer (default "https://pojntfx.eu.auth0.com/")
  -n, --periodicNodeScanTimeout int                  Time in milliseconds to wait for all nodes in a network to respond in the periodic node scans (default 500)
  -p, --periodicPortScanTimeout int                  Time in milliseconds to wait for a response per port in the periodic port scans (default 10)
  -e, --periodicScanCronExpression string            Cron expression for the periodic network scans & node scans. The default value will run a network & node scan every ten minutes. See https://pkg.go.dev/github.com/robfig/cron for more information (default "*/10 * * * *")
      --ports2PacketsDatabasePath string             Path to the ports2packets database (default "/home/pojntfx/.local/share/liwasc/etc/liwasc/ports2packets.csv")
      --ports2PacketsDatabaseURL string              URL to the ports2packets database; will be downloaded on the first run if it doesn't exist (default "https://github.com/pojntfx/ports2packets/releases/download/weekly-csv/ports2packets.csv")
  -o, --prepareOnly                                  Only download external databases & prepare them, then exit
      --serviceNamesPortNumbersDatabasePath string   Path to the CSV input file containing the registered services (default "/home/pojntfx/.local/share/liwasc/etc/liwasc/service-names-port-numbers.csv")
      --serviceNamesPortNumbersDatabaseURL string    URL to the CSV input file containing the registered services; will be downloaded on the first run if it doesn't exist (default "https://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.csv")
  -w, --webSocketListenAddress string                Listen address (for the WebSocket proxy) (default "localhost:15124")

Environment Variables

All command line arguments described above can also be set using environment variables; for example, to set --deviceName to tap0 with an environment variable, use LIWASC_BACKEND_DEVICENAME=tap0.

Configuration File

Just like with the environment variables, liwasc can also be configured using a configuration file; see examples/liwasc-backend-config.yaml for an example configuration file.

gRPC API

liwasc exposes a full-featured streaming gRPC and gRPC-Web API, which is also used internally to connect the front- and backend. You can find the relevant .proto files in api/proto/v1; send the OpenID Connect token with the X-Liwasc-Authorization metadata key.

Acknowledgements

  • This project would not have been possible were it not for @maxence-charriere's go-app package; if you enjoy using liwasc, please donate to him!
  • The open source PatternFly design system provides a professional design and reduced the need for custom CSS to a minimium (less than 50 SLOC!).
  • The mac2vendor database is an awesome resource for OUI database lookups and is used to provide node metadata in liwasc.
  • UDP packets for status checks have been extracted from nmap using ports2packets, which allows liwasc to provide it's UDP port scans.
  • All the rest of the authors who worked on the dependencies used! Thanks a lot!

Contributing

To contribute, please use the GitHub flow and follow our Code of Conduct.

To build and start a development version of liwasc locally, run the following:

$ git clone https://github.com/pojntfx/liwasc.git
$ cd liwasc
$ make depend
$ LIWASC_BACKEND_OIDCISSUER=https://pojntfx.eu.auth0.com/ LIWASC_BACKEND_OIDCCLIENTID=myoidcclientid LIWASC_BACKEND_DEVICENAME=eth0 make dev

The backend should now be started and the frontend be available on http://localhost:15125/. Whenever you change a source file, the back- and frontend will automatically be re-compiled.

Have any questions or need help? Chat with us on Matrix!

Related Projects

If you want to have a modern network boot server to provision the nodes managed by liwasc, check out bofied!

License

liwasc (c) 2021 Felicitas Pojtinger and contributors

SPDX-License-Identifier: AGPL-3.0

More Repositories

1

weron

Overlay networks based on WebRTC.
Go
1,794
star
2

go-nbd

Pure Go NBD server and client library.
Go
345
star
3

multiplex

Watch torrents with your friends.
Go
238
star
4

bofied

Modern network boot server.
Go
169
star
5

ram-dl

A tool to download more RAM (yes, seriously!)
Go
129
star
6

htorrent

HTTP to BitTorrent gateway with seeking support.
Go
119
star
7

keygaen

Sign, verify, encrypt and decrypt data with PGP in your browser.
Go
115
star
8

octarchive

Simple tool to back up all repos on a GitHub/Gitea account to a local folder.
Go
111
star
9

r3map

High-performance remote memory region mounts and migrations in user space.
Go
78
star
10

gon2n

Go bindings, management daemons and CLIs for n2n edges and supernodes.
Go
76
star
11

pojde

Develop from any device with a browser.
Shell
65
star
12

hydrapp

Build fast apps that run everywhere with Go and a browser engine of your choice.
Go
58
star
13

tinynet

A `net` implementation for Go and TinyGo based on unisockets, targeting both WebAssembly and native platforms.
Go
47
star
14

stfs

Simple Tape File System (STFS), a file system for tapes and tar files.
Go
46
star
15

unisockets

A universal Berkeley sockets implementation for both WebAssembly (based on WebRTC) and native platforms with bindings for C, Go and TinyGo.
TypeScript
34
star
16

alpimager

Build custom Alpine Linux images with Docker.
Go
29
star
17

panrpc

Language-, transport- and serialization-agnostic RPC framework with remote closure support that allows exposing and calling functions on both clients and servers.
TypeScript
28
star
18

nextcloud-talk-bot-framework

A framework for writing Nextcloud Talk chatbots with every language that supports gRPC.
Go
24
star
19

skysweeper

Automatically delete your old skeets from Bluesky.
TypeScript
20
star
20

html2goapp

CLI and web app to convert HTML markup to go-app.dev's syntax.
Go
18
star
21

webnetes

Peer-to-Peer Computing Platform for the Browser and Node.
TypeScript
17
star
22

networked-linux-memsync

Efficient Synchronization of Linux Memory Regions over a Network: A Comparative Study and Implementation (Bachelor's Thesis)
Jupyter Notebook
16
star
23

connmapper

Visualize your system's internet connections on a globe.
TypeScript
16
star
24

nextcloud-talk-bot-jitsi

A bot for Nextcloud Talk that creates Jitsi meetings.
JavaScript
14
star
25

hydrun

Execute a command for the current directory on multiple architectures and operating systems.
Go
11
star
26

xeus-cling-binaries

Weekly builds of https://github.com/jupyter-xeus/xeus-cling.
Shell
10
star
27

goit

Get a OIDC token from your terminal.
Go
10
star
28

felicitas.pojtinger.com

My personal site.
HTML
9
star
29

uni-itsec-notes

Notes for the IT security course at HdM Stuttgart.
Makefile
9
star
30

tapisk

Expose a tape drive as a block device.
Go
9
star
31

uni-bwl-notes

Notes for the Planung und Kalkulation von IT-Projekten (econ 101) course at HdM Stuttgart.
Makefile
9
star
32

deliverance

Universal document publishing system.
Makefile
8
star
33

growlapse

Visualize plant growth over time with Go, WebDAV and WASM; @pojntfx's entry for #growlab.
Go
8
star
34

invaentory

Quickly find all IPv6 and IPv4 hosts in a LAN.
Go
7
star
35

rpiplay-binaries

Weekly builds of https://github.com/FD-/RPiPlay.
Shell
7
star
36

bagop

Build for all Go-supported platforms by default, disable those which you don't want.
Go
7
star
37

webpipe

Share files, sockets, pipes and char devices over WebRTC.
Go
6
star
38

uni-appsecurity-notes

Notes for the Anwendungssicherheit (app security) course at HdM Stuttgart.
6
star
39

webnetesctl

Frontend for webnetes, the peer-to-peer computing platform for the browser and node.
TypeScript
6
star
40

adwaita-gtk-ubuntu

A modern Ambiance replacement that keeps Ubuntu's identity while staying upstream.
CSS
6
star
41

go-app-grpc-chat-frontend-web

Web frontend for an example chat application using the `go-app` package and gRPC over WebSockets (like gRPC-Web).
Go
6
star
42

ipxe-binaries

Weekly builds of https://ipxe.org/, with an embedded script that chainloads /config.ipxe.
Shell
5
star
43

grpc-examples

gRPC example microservices in Go, Rust, C#, Python and JavaScript.
JavaScript
5
star
44

cadmium-builds

Weekly builds of https://github.com/Maccraft123/Cadmium.
Shell
5
star
45

consumat.io

Track, plan and enjoy content.
5
star
46

appl-alg-interpreter-binaries

Weekly builds and source mirror for Prof. Dr. Fridtjof Toenniessen's ApplAlgInterpreter.
Java
5
star
47

the-commitment

A contract requiring you to do one daily public OSS contribution, while allowing time for rest.
5
star
48

learn-chinese-platform

A modern and libre way to learn Chinese.
TypeScript
4
star
49

uni-algodat-notes

Personal notes and snippets for the Algorithms and Data Structures course at HdM Stuttgart.
Go
4
star
50

box

Setup for my personal (pet) server.
Makefile
4
star
51

uni-distributedsystems-notes

Notes for the distributed systems course at HdM Stuttgart.
4
star
52

uni-db1-notes

Personal notes for the DB1 course at HdM Stuttgart.
Makefile
4
star
53

go-isc-dhcp

Management daemons and CLIs for the ISC DHCP server and client.
Go
4
star
54

minitel

Instructions on how to use a Minitel as a Linux terminal.
4
star
55

hydrapile

Reliably cross-compile and distribute complex apps from Linux to macOS and Windows using native toolchains (via Darling/WINE) and package managers (Homebrew/MSYS2) with containers.
Dockerfile
4
star
56

atmosfeed

Create fully custom Bluesky feeds with Wasm modules, powered by Scale Functions.
TypeScript
4
star
57

donna

Minimal personal CRM.
Go
3
star
58

keystoregaen

Generate Java keystores in your browser.
Go
3
star
59

saltpanelo

Fast, smart and secure service mesh.
Go
3
star
60

image-builder

A tool to build KubeVirt disk images. Based on @Tedezed's implementation.
Shell
3
star
61

nebulark

Distribute your workload to the edge.
JavaScript
3
star
62

uni-se1-notes

Assignments for the SE1 course of HDM Stuttgart, as Jupyter notebooks.
Jupyter Notebook
2
star
63

adwaita-gtk-ubuntu-legacy

To test out whether it may be a better idea to use Adwaita instead of Ambiance in LTS if Communitheme won't be done in time.
SCSS
2
star
64

SwiftUIMenuBar

A menu bar app for macOS built with SwiftUI.
Swift
2
star
65

gon2n-frontend

React frontend for @pojntfx/gon2n.
TypeScript
2
star
66

xeus-sql-binaries

Weekly builds of https://github.com/jupyter-xeus/xeus-sql.
Shell
2
star
67

glode

Compute, Network and Storage Node based on WASM, libp2p and IPFS.
TypeScript
2
star
68

weron-archive

Overlay networks based on WebRTC.
Go
2
star
69

consumat.io-api

API spec for https://github.com/alphahorizonio/consumat.io.
2
star
70

gnome-shell-extension-sticky-app

A GNOME shell extension to toggle an app's visibility.
JavaScript
2
star
71

birdid

Bird + Cupid: Find the first interaction between two Twitter users
Go
2
star
72

go-cuse

CUSE bindings for Go.
Go
2
star
73

uni-webdev-backend-notes

Notes for the webdev backend course at HdM Stuttgart.
2
star
74

uni-netpractice-notes

Notes for the Praktikum Rechnernetze (networking practice) course at HdM Stuttgart.
2
star
75

consumat.io-frontend

Frontend for https://github.com/alphahorizonio/consumat.io.
TypeScript
2
star
76

mepi

Middle Earth Property Insurance, a uni project of @jakwai01, @dentremor, @lucas-goldner and @pojntfx for HdM Stuttgart.
2
star
77

jitsi-meet-node-client

A NodeJS client for Jitsi Meet.
JavaScript
2
star
78

ports2packets

Generates a CSV file with the packets that are to be sent in order to check if a UDP port is open.
Go
2
star
79

papilio

CLI and web app to configure the Terminus FE and SL series of USB Hubs.
Go
2
star
80

go-app-grpc-chat-backend

Backend for an example chat application using the `go-app` package and gRPC over WebSockets (like gRPC-Web).
Go
2
star
81

pojntfx

My personal repo.
Go
2
star
82

ppc32-builds

CI/CD build configurations to get binaries for projects on 32-Bit PowerPC (ppc32) machines.
Shell
1
star
83

mosalink-archive

Archive of research from 2017 on AX.25 mesh networks with batman-adv and eoax.
1
star
84

skytheon

Cross-post between Bluesky, Mastodon and Twitter in all directions with ease.
Go
1
star
85

pojde-rs

Experimental Rust implementation of https://github.com/pojntfx/pojde.
Rust
1
star
86

go-auth-utils

Simple auth utilities for Go to secure web APIs with.
Go
1
star
87

webwormhole-binaries

Weekly builds of https://github.com/saljam/webwormhole.
Shell
1
star
88

tftpdd

TFTP server daemon.
Go
1
star
89

go-app-experiments

Experiments with the `go-app` package
Go
1
star
90

gopojde

Experimental Go implementation of https://github.com/pojntfx/pojde.
Go
1
star
91

uni-hacking-notes

Notes for the hacking (IT-Sicherheit: Angriff & Verteidigung) course at HdM Stuttgart.
1
star
92

csv2go

Generates Go code containing a multi-dimensional array with the contents of a CSV file.
Go
1
star
93

clusterplatform

The Lean Distributed Cloud Computing System.
JavaScript
1
star
94

connaections

The TCP and UDP connections of a node, as an API. See https://github.com/pojntfx/connaections-frontend-web/ for a web frontend.
Go
1
star
95

bagccgop

Build for all gccgo-supported platforms by default, disable those which you don't want (bagop with CGo support).
Go
1
star
96

documatio

In goes Markdown, out come indexed HTML and PDF slides and documents.
Shell
1
star
97

uni-supply-chain-paper

A paper on supply chain security in software development for Uni.
1
star
98

simple-direct-democracy-backend

Fast and minimal backend for a simple direct democracy's suggestion and voting system.
JavaScript
1
star
99

ipxebuilderd

Build daemon and CLI for iPXE.
Go
1
star
100

transcommunal-confederation

Flags etc. of the Transcommunal Confederation and it's communes.
1
star