Files
tchivert 22f1e8f555
build / build (push) Successful in 19s
add non-daemon mode
2024-08-10 12:44:27 +02:00

1.6 KiB

Portus

Portus checks a range of ports on multiple hosts and can list the open ports in a log file.

Usage

Usage of portus:
  -D	Debug mode
  -d	Start in daemon mode to scan all IPs continuously
  -i string
		File containing list of IPs (default "ips.txt")
  -l string
		Directory to store logs
  -p string
		Ports to scan (default "1-1024")
  -t int
		Timeout in milliseconds (default 200)
  -w int
		Wait time between scans in milliseconds (default 2000)

Installation

This is an example of installation on an amd64 Linux system with systemd.

Download the binary and the systemd service file:

wget https://git.rznet.fr/tchivert/portus/releases/download/latest/portus-linux-amd64 -O /usr/local/bin/portus
chmod +x /usr/local/bin/portus

If you want to use the systemd service file, download it:

wget https://git.rznet.fr/tchivert/portus/raw/branch/main/systemd/portus.service -O /etc/systemd/system/portus.service

Or configure a cron job to use portus without daemon mode:

crontab -e
0 */6 * * * /usr/local/bin/portus -i /etc/portus/ips.txt -l /var/log/portus -p 1-10000

Create the logs and configuration directories:

mkdir /var/log/portus
mkdir /etc/portus

Add your IPs list in the ips.txt file:

vim /etc/portus/ips.txt

Edit the systemd service if needed, then enable and start it:

vim /etc/systemd/system/portus.service
systemctl enable --now portus

Build

go build -o portus

License

This project is licensed under the MIT License. See the LICENSE file for more information.