← blogEShome

Homelab · Security · 2026-09-03 · 4 min read

When the office router became a weapon

I run a 24/7 monitoring stack for an office network in Córdoba: a MikroTik router and UniFi access points, watched from a single Raspberry Pi running Grafana, VictoriaMetrics and VictoriaLogs, fed by mktxp, unpoller, blackbox and IPFIX exporters — ten containers, all docker-compose, with 17 provisioned alert rules firing into Slack.

One of those rules is embarrassingly simple: active connections above threshold. It's the one that caught this.

The alert

The router's connection count, which idles around 700, spiked to ~2,600 and stayed there. No user complaint preceded the alert — attacks like this rarely announce themselves as anything worse than "the internet feels a bit slow".

The flow data from the WAN interface showed the pattern immediately: a flood of small UDP/53 packets arriving from the internet, and much larger UDP/53 packets leaving. The router was answering DNS queries from the WAN.

The diagnosis: an open resolver

MikroTik's DNS client doubles as a DNS server. The setting that makes the router resolve names for your LAN —

/ip dns
set allow-remote-requests=yes servers=8.8.8.8,...

— makes it resolve names for anyone who can reach UDP/53, unless the firewall says otherwise. And the firewall said nothing.

That's an open resolver, and open resolvers get found fast. Attackers use them as reflectors in a DNS amplification attack: they send a small query with the victim's spoofed source address, and the resolver mails the victim a much larger answer. In our capture: a 132-byte query producing a 4,980-byte answer — roughly 37× amplification. The office router wasn't the target; it was being used as ammunition against someone else, burning our uplink and the router's CPU in the process. (Cloudflare has a good primer on the mechanics: DNS amplification attacks.)

The fix, and where it belongs

The obvious move is a filter rule: drop UDP/53 from WAN in the input chain. It works, but there's a subtlety that matters under attack volume: filter runs after connection tracking. Every spoofed packet still creates a conntrack entry before being dropped — so you keep paying CPU and connection-table space for traffic you've already decided to throw away. The connection count stays inflated and, on a small router, conntrack exhaustion becomes its own denial of service.

RouterOS has a table designed exactly for this: raw, whose prerouting chain runs before conntrack (RouterOS firewall docs). Packets dropped there never touch the connection table:

/ip firewall raw
add action=drop chain=prerouting protocol=udp dst-port=53 \
    in-interface-list=WAN \
    comment="Anti DNS amplification - drop pre-conntrack"

Note what this doesn't do: it doesn't disable the resolver. The LAN still resolves through the router normally — allow-remote-requests stays on, but the WAN can no longer reach it. The service isn't the problem; its exposure was.

While I was in there: defense in depth

An incident is a terrible thing to waste, so the rest of the firewall got hardened in the same session:

/ip firewall filter
add action=add-src-to-address-list address-list=wan_stage1 \
    address-list-timeout=1m chain=input connection-state=new \
    dst-port=22,8291,8728 protocol=tcp in-interface-list=WAN
add action=add-src-to-address-list address-list=wan_stage2 \
    address-list-timeout=1m chain=input connection-state=new \
    dst-port=22,8291,8728 protocol=tcp in-interface-list=WAN \
    src-address-list=wan_stage1
add action=add-src-to-address-list address-list=wan_blacklist \
    address-list-timeout=1w chain=input connection-state=new \
    dst-port=22,8291,8728 protocol=tcp in-interface-list=WAN \
    src-address-list=wan_stage2 log=yes log-prefix=WAN-BAN
add action=drop chain=input src-address-list=wan_blacklist

Results

Takeaways

MikroTikDDoSRouterOSGrafanaVictoriaMetrics