- Go 74.1%
- HTML 25.9%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
nmap/v3 v3.1.0, gorilla/websocket v1.5.3, x/sync v0.25.0; x/net dropped. x/sync v0.25.0 requires Go 1.26. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> |
||
| docs | ||
| export | ||
| i18n | ||
| internal/version | ||
| scanner | ||
| server | ||
| validator | ||
| websocket | ||
| yggdrasil | ||
| .gitignore | ||
| go.mod | ||
| go.sum | ||
| LICENSE | ||
| main.go | ||
| README.md | ||
| yggnmap.service | ||
Usage · Running a server · Reverse proxy · Building
YggNmap is a port scanner for Yggdrasil users. Open the page, press a button, and see which ports on your address are reachable from the network. A port that is open here is open to every node in Yggdrasil.
It scans the visitor and nobody else. The target is the address the request came from, and it must be in
200::/7. There is no field to type someone else's address into.
Usage
Open the service address in a browser while connected to Yggdrasil. The page shows the address it will scan.
| Mode | Ports | Takes |
|---|---|---|
| Quick | the 1000 most common | 1–3 min |
| Full | all 65 535 | 10–30 min |
| Custom | your list, e.g. 22,80,8000-8100 |
up to 3 min |
Start with a quick scan, and run a full one when you have the time. Progress and found ports arrive live over a WebSocket. The result lists open TCP ports with the service nmap guesses from the port number, and can be exported as CSV, JSON or PDF.
One scan runs per address at a time. After a scan there is a pause before the next one: 30 s for quick, 45 s for custom, 60 s for full. The server runs at most 10 scans at once.
Running a server
You need nmap and a running Yggdrasil node on the same machine. Root is not required, because nmap does a TCP connect scan.
go build -o yggnmap .
./yggnmap -listen :: -port 8080
| Flag | Default | Meaning |
|---|---|---|
-listen |
:: |
Address to listen on |
-port |
8080 |
Port to listen on |
-nmap |
from PATH |
Path to the nmap binary |
-trusted-proxy |
none | Reverse proxies whose X-Real-IP / X-Forwarded-For headers are trusted |
-version |
Print the version and exit |
systemd
yggnmap.service runs the binary from /opt/yggnmap as a dedicated user, starts after
yggdrasil.service, and writes the log to /var/log/yggnmap/:
sudo useradd --system --no-create-home --shell /usr/sbin/nologin yggnmap
sudo install -d -o yggnmap -g yggnmap /opt/yggnmap /var/log/yggnmap
sudo install -o yggnmap -g yggnmap -m 755 yggnmap /opt/yggnmap/yggnmap
sudo cp yggnmap.service /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable --now yggnmap
Behind a reverse proxy
Without -trusted-proxy the headers are ignored. If they weren't, any visitor could send a forged header and make
the server scan a different host. Bind YggNmap to loopback and name the proxy:
yggnmap -listen ::1 -trusted-proxy ::1,127.0.0.1
The proxy must overwrite X-Real-IP with the peer address and pass WebSocket upgrades. A full scan holds the
request open for up to 30 minutes, so nginx needs a longer read timeout. Caddy has no read timeout by default.
nginx
location / {
proxy_pass http://[::1]:8080;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_read_timeout 2100s;
}
Caddy
http://[200:1234::1]:80 {
reverse_proxy [::1]:8080 {
header_up X-Real-IP {remote_host}
}
}
Building
You need Go 1.26 or newer. The UI is embedded in the binary, so there is nothing else to deploy.
go build -o yggnmap .
GOOS=freebsd GOARCH=amd64 go build -o yggnmap-freebsd . # any other target
go test ./...
The version comes from internal/version/version.go.
License
GNU AGPL v3, see LICENSE.