basforge

Search titles, text and the “If it doesn’t work” cases.

    RU

    Router Winbox, WebFig and SSH — from the home network only

    Don’t expose MikroTik management to the outside: not Winbox, not the web UI, not SSH. Nearly every loud MikroTik compromise — 2018, 2021, September 2026 — went through management services open to the internet. Close them with two layers: the firewall and address= on each service.

    In September 2026 MikroTik released fixes for six vulnerabilities, some of them already exploited: command execution over SSH without a password (CVE-2026-67279), key-login bypass (CVE-2026-67276), reading files, password files included, through WebFig (CVE-2026-67281), a crash through bandwidth-test (CVE-2026-67277). Fixed in 7.24.3, 7.23.6 and 6.49.21. Per the MikroTik and CERT Polska bulletins, the attacks targeted routers with SSH and WebFig visible from the internet.

    Two layers, each covering for the other if it breaks:

    # 1. The factory firewall: nothing that isn't from LAN reaches the router
    /ip firewall filter print where comment="defconf: drop all not coming from LAN"
    
    # 2. The service itself answers only home addresses
    /ip service set winbox,ssh,www,www-ssl address=192.168.88.0/24
    /ip service disable telnet,ftp,api,api-ssl
    /tool bandwidth-server set enabled=no

    If you need to manage the router from outside home, keep the service closed to the outside and reach the internal network another way — say, an SSH tunnel through your own server (SSH tunnels). Forwarding port 8291 or 22 on the router to the internet is exactly the setup that got attacked all three times.

    If it doesn’t work

    The log shows login failure for user admin from 203.0.113.50 via ssh every minute

    Cause
    The router’s SSH is visible from the internet: “drop all not coming from LAN” was deleted, or an allow without an interface condition sits above it.
    Fix
    Put the factory deny back in place (MikroTik firewall) and set address= on the service. The attempts from foreign addresses stop at once — verify from outside with a scanner.

    An unfamiliar user, script or scheduler entry appeared in the config

    Cause
    The router has most likely been compromised: that’s what the 2018–2021 botnets did to come back after an update.
    Fix
    Reset and reconfigure from your own /export copy, which you read through first: it may contain the same foreign lines. Change every password the router knew. Check the log for a flagged entry.

    How to check

    From outside — a port scanner against the router’s external address, from another server or a phone on mobile data (Test your server’s protection by action):

    nmap -Pn -p 22,80,443,2000,8291,8728,8729 198.51.100.27
    # every port filtered

    If the router sits behind the ISP’s NAT, scanning the external address tests the ISP’s NAT, not the router: you get filtered whatever the firewall says. You can tell by ether1: it has a private address or one from 100.64.0.0/10, not the one the internet sees (/ip address print where interface=ether1). Then test from somewhere that can reach the router:

    • the ISP’s modem does the NAT — scan the router’s WAN address from a laptop plugged into the modem, bypassing the router;
    • the ISP gave you public IPv6 — scan the router’s IPv6 address from another server: nmap -6 -Pn -p 22,80,443,2000,8291,8728,8729 2001:db8::1;
    • carrier-grade NAT and no IPv6 — nothing outside reaches the router over IPv4. Only neighbours on the ISP’s network can see it, so you need both layers here too.