2024-03-11 17:49:36 +01:00
2023-08-28 15:46:37 +02:00
2024-03-11 17:49:36 +01:00
2023-09-06 14:46:24 +02:00

Welcome to my portscan protector.

This software aims to allow you to easily secure your server from hackers.
Its super lightweight and has no third party dependencies.
All it does is open a few ports that you arent using (You have to define these ports yourself) and whenever someone connect to such a port, you can be certain that its someone trying to break into your system, as you as the owner of the system know that there is no legit service behind the port.

Requirements:

  • A server that you want to protect
  • Any somewhat modern nodejs version (preferrably go with the current LTS version)

Considering that the service utilises iptables to ban malicious ips, you need to run it with privileges, either sudo or running it directly through root.
Also make sure you have iptables installed, it should be installed by default, but just check with iptables --help

If you just want to run the program

go into the directory and type into the terminal

node main

If you want to run it as a service

Create a service file

nano /lib/systemd/system/portscan_protector.service

Enter the service instructions into the file

[Unit]
Description=Honeypot to protect against portscanners
After=network.target

[Service]
Type=simple
User=root
ExecStart=/usr/bin/node /root/portscan_protector/main.js
Restart=on-failure

[Install]
WantedBy=multi-user.target

Reload the service daemon

systemctl daemon-reload

Enable the service

systemctl enable portscan_protector

Start the service

systemctl start portscan_protector

Check if the service is running

systemctl status portscan_protector
S
Description
A simple NodeJS HTTP server setup used to act as a honeypot for portscanners. If a portscanner scans the port, it establishes a connection, and then the ip will get added to the firewall to be blocked.
Readme 39 KiB
Languages
JavaScript 100%