Summary of events
On 7 June I was made aware of attempted logins on PTAWUG router from CTWUG IP. This was in the evening.
Once I heard this I checked our router logs and saw that this IP had broadly attacked routers on CTWUG between 12h05 and 12h25 earlier on the 7th.
I then did the following:
- I firstly null routed (blackhole) the whole highsite range from which this originated by broadcasting null routes on OSPF.
- Upon further investigation of the IP I null routed only the particular client’s IP range. This was after establishing the routes on the high site for the client.
- I obtained logs from our radius server and verified that no radius accounts were breached. These logs are also indicative of the breadth of the attack.
- I obtained logs of all routers running WMS where the particular IP was referenced. This was 661 lines. Basically 661 login attempts, actual logins or logouts.
- I contacted the high site admin and eventually the wugger (a client of the highsite) to find out what the situation was.
- It took some time to get a response from the wugger as I only obtained an email address for them. I obtained logins to the wugger’s routers both on the wug and on his internet.
- By the time I was able to login to the routers they had been rebooted (a couple of days later) and no logs from the time were present.
- I did however review the configurations on both the WUG router as well as the internet facing router. Both were Mikrotik.
Speed
The first log entry on WMS router was at 12:06:13 and the last entry was at 12:23:44. Just over a 1000 seconds. It generated 661 logins, failed logins or logouts. That’s 37.7 actions per minute. This was an automated attack using a program or script. This may be far higher as the attacker probably also attacked non WMS routers.
Usernames
The hacker attempted to login using admin
account multiple times. It also attempted to login using CTWUG user accounts including wug users as well as ctwug
user. This is concerning. The presence of wug user names made us concerned that this is a targeted attack, but the speed seems to oppose this. I confirmed that it did breach at least some usernames where passwords had been set.
Ports targeted
All logins were targeted on the web portal of these routers (port 80) and not ftp, winbox or other ports.
Setup of the node
The node from which the attack originated had internet as well as wug access. Both these were run using Mikrotik devices. The Mikrotik device on the internet:
- Had bruteforce firewalls protections on 2 ports.
- But no protection on other ports including the web port and winbox ports.
- Did not have a default drop all on the input chain of the router from the internet.
It was therefore quite insecure. Unfortunately this device was rebooted before I gained access.
Previous attacks
I have seen two similar incidents before where a user’s router was compromised from the internet. This was then used as a launch pad for a further attack on the CTWUG. These attacks however were limited to brute-force user / password attacks and used generic usernames. Not wug specific usernames.
Mikrotik Vulnerabilities
The following seems likely to be relevant:
- Vulnerability on Winbox port:
Advisory: Vulnerability exploiting the Winbox port [SOLVED] - Announcements - MikroTik community forum - Recent activity on old vulnerability involving the web server on RouterOS:
Urgent security advisory - Announcements - MikroTik community forum - A further SMB vulnerability is not considered here as this is not activated by default.
Both the above would compromise user accounts on a router and make them available to the attacker.
Likely cause
- We believe that it’s unlikely that the user completed the attack. They did not appear to have the skills involved as well as the poor quality of the firewall seems to indicate poor security awareness.
- Furthermore the user had poor firewalls on their internet facing Mikrotik. It would have been easy for an attacker to exploit the above vulnerabilities or simply bruteforce the password/username on the router.
- The attacker could then have used either vulnerabilities on the CTWUG. In particular it seems likely they used the above web port vulnerability since they targeted web port for logins to compromise other routers.
- It would then re-use discovered usernames and passwords to attack further routers.
- Further poor security on CTWUG worsened the impact:
- Default logins (
admin
with no password) - Out of date routers running old versions of RouterOS
- Re-use of user accounts and passwords across routers.
- No wug wide protection for these rapid attacks.
- It is unclear why the attack stopped after such a short time. We were lucky.
Implications
An outside entity probably has the user accounts and passwords for a number of wuggers available to them. These accounts are compromised and may be attacked in future if the same attacker gains access to CTWUG or, if these get published on the dark web or simply on a website somewhere.
Actions Taken
- The committee has given the wugger involved a warning about security and their node remains null routed until they implement improved firewalls on their internet side. I will assist if needs be.
- I have implemented wug wide bruteforce protection that will automatically null route mass logins of this nature. This covers many of our routers (but not all) .
- I have also improved notifications of such attacks so that we are aware sooner when it happens.
- We have updated minimum Router OS version to avoid these vulnerabilities. This will be enforced on all OSPF rotuers with immediate effect. I also propose that we update this more frequently in future and especially so if RouterOS security vulnerabilities are made public.
- I will ensure that I ask any wugger which is the source of such an attack try and retain the relevant logs if possible.
- @dizzle will review routers and find routers with
admin
accounts without password.
Further possible actions
- Consider what to do with the compromised accounts and routers.
- Consider further basic firewall as part of WMS
- Consider what to do with non OSPF or non WMS routers. It might be good idea to requuire all routers be updated as per OSPF router requirements. It is a bit more difficult to enforce.
- Re-enable NMS and also consider adding brute-force protections and alerts there.
- Wuggers should review their logs on all their routers and establish if they were attacked at this point.
- Wuggers should also keep their RouterOS updated and ensure secure firewalls on internet facing routers.
- Wuggers should practice good password security by using a tool such as KeePass or similar to store unique passwords per services/router/website.