Thanks. It's not like I don't know how to do a Netinstall. But we are potentially talking about a few hundred devices here. Anyway, the real question is not how to recover from it, but what this worm is precisely, and how to protect ourselves from it. For all I know, it could be exploiting a zero-day that hasn't been fixed in a current version of RouterOS. In that case, Netinstalling a few hundred devices is going to be a big fat waste of time, don't you think? They will all just become infected again.use netinstall for fresh start and keep update your version.
Of course we have always known this is just a naive claim. There is no way they can back that up, because in all software there are bugs and those couldMikrotik always stated that there is no way to run custom code in ros. Hope this was not proved as a lie by this.
I just sent you a supout file from one of remaining infected SXTs to Mikrotik support email.Nathan, RIF and if possible remote access is possible? RC on these or not?
Hi Nathan -srosen,
Interesting. I don't think HTTP is the vector (though I could be wrong), mostly because I don't see infected devices making any attempts to contact other IPs via HTTP...just telnet, TR-069, and Winbox. In our case we haven't seen any kind of visible script, either on the (exposed) filesystem or in '/system script', nor are there any active scripts/jobs running nor logged in users/sessions that are unaccounted for.
Just note that license upgrade is free of charge, if the device doesn't allow you to upgrade by upload+reboot, we will give you a free license upgrade.some devices haven't had the license to upgrade to 6.x
YES, RouterOS has been hardened multiple times since that version, it will not only double check every file, it will also remove all unknown files.Do you know if updating already infected devices will solve the problem
wow thats great - i think i had some old information there.Just note that license upgrade is free of charge, if the device doesn't allow you to upgrade by upload+reboot, we will give you a free license upgrade.some devices haven't had the license to upgrade to 6.x
thats very good news! thank you very muchYES, RouterOS has been hardened multiple times since that version, it will not only double check every file, it will also remove all unknown files.Do you know if updating already infected devices will solve the problem
We will do that once we have more confirmation that upgrade to v6.38.5 or above does indeed fix this. Please report your results.Would it be possible for MT staff to create a pinned thread about this. With info about what attack vector was used, from what version of ROS are you safe and how to mitigate if you are effected.
I know you can read all here, if HTTP vulnerability is confirmed to be used, but it would be great to have everything in one post for all to read.
Great. Personally not affected on any device but I'm on 6.41.3 on every device but I still follow this to know what the attack vector was.We will do that once we have more confirmation that upgrade to v6.38.5 or above does indeed fix this. Please report your results.Would it be possible for MT staff to create a pinned thread about this. With info about what attack vector was used, from what version of ROS are you safe and how to mitigate if you are effected.
I know you can read all here, if HTTP vulnerability is confirmed to be used, but it would be great to have everything in one post for all to read.
Does it require valid username and password to do that, or is it sufficient to have access to the webserver?checks if port 80 is available, then uses the vulnerability that was fixed in 6.38.4 to copy itself into that system
I think you mean 8291It seems the system scans for winbox port 8192 to quickly identify MikroTik devices (since this is a unique port)...
If it's a botnet using ChimayRed, as suggested earlier in the thread, then it's exploiting a security vulnerability — it doesn't need valid credentials to gain access, just an open HTTP server :(Does it require valid username and password to do that, or is it sufficient to have access to the webserver?checks if port 80 is available, then uses the vulnerability that was fixed in 6.38.5 to copy itself into that system
Yes. Webfig specifically. Hotspot NOT affected.If it's a botnet using ChimayRed, as suggested earlier in the thread, then it's exploiting a security vulnerability — it doesn't need valid credentials to gain access, just an open HTTP server
Excellent work! Many thanks for this, Nathan!I finally got my hands on an infected device, spent some time with it, and can confirm that this appears to be Hajime
I can confirm that upgrading to 6.40.6 removes the /flash/etc/rc.d directory tree, which of course deletes the startup script and thus renders the Hajime binaries in /flash/bin inert. So an infected router can in fact be "cured" just by updating it.
I think it is a bit imprudent to run the webserver under a user-id that has write access to the filesystem. No Linux system admin would do that; all wellknown Linux distributions run the webserver under a user like "wwwrun", "httpd" or so, which has no write permissions on the persistent filesystem.If it's a botnet using ChimayRed, as suggested earlier in the thread, then it's exploiting a security vulnerability — it doesn't need valid credentials to gain access, just an open HTTP serverDoes it require valid username and password to do that, or is it sufficient to have access to the webserver?checks if port 80 is available, then uses the vulnerability that was fixed in 6.38.4 to copy itself into that system
This is going to be tough...All infected routers were customers, and thankfully not our network core, which were properly protected. Our customers can use whatever router they want, and we offer to sell MikroTiks to them if they want to buy a router from us, but as mentioned earlier we don't actively maintain them. So many of them run with various configs that I'm sure are unsafe, and the software is not going to get updated unless the customer does it. We have resisted "managed router service" until now but this may no longer be tenable.
Can you tell me please, how can I upgrade my RB532A (mipsle) to this level ?Upgrade to v6.38.5 or above should fix the issue and clean your system.
You can read: ip6, ad2:id20, ping1, infohash20, get_peersd2:ip6:T.e.. .1:ad2:id20:..6i sQ.J.)......F|.g e1:t4:....1:q4:p ing1:y1:qe
E..}.n@. 6.....O.T.e..... .i..d1:ad2:id20: .f.;6.......O.Q. S..N9:info_hash2 0:/......[.5.e.. ;.&.,.e1:q9:get_ peers1:t4:gp/.1: y1:qe
In my experience, the last version of RouterOS to work *well* on RB532 was 5.x. When I upgrade a 532 to 6.x it starts acting like a RB100-series board that has just been upgraded from 2.9 to 3.x or anything newer...slow, laggy console, CPU spiking up all the time, etc. even when it really isn't busy doing anything. I'm not sure why this is or why a similar thing happened in both cases (100 and 500) and MT devs couldn't fix it, but there you go. I would suggest the time has come to retire the venerable RB500.Please make a security release for those old, but perfectly working boards on mipsle!
Read up on Hajime. Rather than phoning home to a centralized command & control server, it constructs a BitTorrent-like P2P mesh with other infected devices, and they all pass along information to each other. It's primarily used to transmit the latest config and to distribute software updates. From my experiments yesterday, it appears that every time Hajime starts up on an infected host, it picks a random UDP port to listen on and make the P2P exchange with, so if you reboot your infected router, then you will see the same traffic coming/going to a different UDP port #.I detected strange traffic on UDP/33549 port. In the packets some readable parts:
[snip]
So... not just copying themself from one router to another, but there is some hidden activity I think!
Firewall protects against this issue. You should only worry if your MIPSLE device has no firewall on the internet side. You can also simply Netinstall to clear away any malicious files.Can you tell me please, how can I upgrade my RB532A (mipsle) to this level ?
Please make a security release for those old, but perfectly working boards on mipsle!
I'm on the other side of the World, in here torrents and other file sharing is still at large, so some if not most responsibility is taken by customer when he signs the agreement.@macgaiver
Isn't your proposal going hand-in-hand with the new sex trafficking law ? https://www.wired.com/story/how-a-contr ... e-the-web/
Mar/26/2018 23:45:13 memory info created new share: pub
Mar/26/2018 23:45:15 memory info fetch: file ".i" downloaded
I haven't, though fully-fleshed example exploits of this vulnerability were released for both mipsbe and x86 earlier this month, and Hajime supports mipsbe, x86, and arm, so it is at least *likely* that an x86 version exists but that there simply aren't enough x86 ROS boxes out there for it to spread at the same rate. If the author simply lifted the exploits from the examples that were released, then that means it's unlikely that arm, powerpc, or tile are being infected, both because it would require some additional/original work on the author's part for arm support and also because AFAIK Hajime doesn't even have binaries for powerpc or tile at this time.So far my testing show that only mipsbe devices are getting exploited. Anyone notice other architectures affected?
I'm not sure if it executes straight away or only does so after a reboot. As I implied in a prior post, I have been able, as a test, to copy the Hajime loader onto a clean device and run it manually, and it will start up and run; however it will not install the rc.d (startup) script itself, so whatever host is pushing the Hajime loader onto the device is also pushing the rc.d script onto it. If you only put the actual Hajime binary onto a device and run it, it will not automatically start up after reboot.Also all of the devices actually required reboot to get the exploit part going, from what i read here i had idea that everything will happen straight away...
It is actually YOU who doesn't know you had to update...There's a worm infecting RouterOS and i guess Mikrotik doesn't know or just ignore the problem
What?We have the same problem, i noticed the problem is in versions before 6.37, i was able to resolve this problem upgrading the RouterOS to 6.42.1 and upgrading the firmware. No need to fresh install anything just upgrade to the last version and the problem is fixe. There's a worm infecting RouterOS and i guess Mikrotik doesn't know or just ignore the problem
That's a really interesting one. I hadn't thought to check that!Another important check is:
check if you have static entrien on IP/DNS/Static
i found DNS A Record and CNAME to fake mikrotik download site
maybe for download an altered version of routeros
Wrong wrong wrong. You cannot remove this sheite by simple means.Just check in System -> Schedule.
There will be a schedule to run a script every minute that continues to allow the hackers in.
Remove the script from System -> scripts too.
SOCKS proxy has probably been enabled. turn that off.
check there are no new users added under System -> users
change the password of the existing user.
kill the existing connections from the IP -> firewall -> connections table.
Also check for NAT rules.
obviously if possible restrict Winbox access too.
oh, and yeah, upgrade routerOS to a version that doesn't allow the whole internet to pull down the username & password table
Agree with this. I had the same issue some time back because my external Winbox access (for trusted networks) had been incorrectly configured and Winbox was in fact exposed to the entire internet. Ouch.Wrong wrong wrong. You cannot remove this sheite by simple means.
Stop, dont check anything, dont waste your time...........
The only approved method once infected/hacked is to use netinstall with a fresh install of the latest firmware and start from scratch.
Actually, nobody above told you to restore the config! They all mention "start from scratch" after netinstall. Restoring the config is not safe, and when you did that you need to repeat the netinstall.to supplement as i had similar issue.
best is to run as stated netinstal but do not restore the config.
/export file=export
/interface l2tp-client
remove [find]
/ip socks
set enabled=no port=666
/system scheduler
remove [find]
/file remove [find]
/interface l2tp-client remove [find]
/ip socks set enabled=no port=1080
/system script remove [find]
/system scheduler remove [find]
/file remove [find where name!="flash"]