Skip to content

X-NET v1.4.6

Choose a tag to compare

@xpanel-cp xpanel-cp released this 15 Oct 13:26
· 1 commit to main since this release

🔒 New Feature: Block the Source IP of a Confirmed Account-Sharer

Previously, when the panel detected two devices using the same SSH account at once, it could only kill the extra session — the offending device would simply reconnect a moment later and leak a bit more traffic on every cycle. Now you can stop that at the network level:

  • New "Ban confirmed sharer's IP" setting under SSH connection-limit enforcement. When sharing is confirmed (every session involved was carrying real traffic — not an inference about a dead connection), the extra device's source IP is denied at the host firewall, for a configurable duration (10s–24h, default 10 minutes; 0 = disabled).
  • New "Blocked IPs" admin section: shows every currently-banned IP, the account it was banned for, the reason, and when the ban expires — with a one-click Unblock button for an IP that was banned by mistake (no need to wait out the timer).
  • Bans are stored in the database, so they survive a panel restart, and are lifted automatically once their timer expires.
  • This never applies to a "dead reconnect" kill — only to a confirmed-sharing or lock-to-IP-mismatch verdict — so a legitimate user who simply dropped and reconnected from the same address can never be locked out by it.

🐛 Bug Fixes: the ban wasn't actually blocking anything

Two real bugs in the host-firewall layer meant a "banned" IP could still get through:

  • ufw: the deny rule was appended to the end of the rule list. Since the panel's own "open this port" rule has no source restriction and is always inserted first, that rule matched before the ban ever got a chance to. The deny rule is now inserted at position 1.
  • firewalld: the rich-rule ban was added without --permanent, so the very next --reload discarded it before it ever blocked a packet.
  • New: nftables fallback. A host that runs neither ufw nor firewalld (a deliberate choice on some servers, since both would also gate the panel's own ports) now gets IP banning anyway — through a dedicated nftables chain, hooked ahead of any existing rule, that blocks the IP on every port and protocol without touching the host's existing firewall configuration at all.

Install the latest version:

apt update
bash <(curl -fsSL https://raw.githubusercontent.com/xpanel-cp/x-net/main/install/xnet.sh)