Over 500k routers and gateways are estimated to be infected with malware dubbed VPNFilter, first reported in https://blog.talosintelligence.com/2018/05/VPNFilter.html .
It has 3 stages. Router restart was recommended to prevent phase 2,3 being used.
“The first action taken by the ssler module is to configure the device’s iptables to redirect all traffic destined for port 80 to its local service listening on port 8888. It starts by using the insmod command to insert three iptables modules into the kernel (ip_tables.ko, iptable_filter.ko, iptable_nat.ko) and then executes the following shell commands:
- iptables -I INPUT -p tcp –dport 8888 -j ACCEPT
- iptables -t nat -I PREROUTING -p tcp –dport 80 -j REDIRECT –to-port 8888
- Example: ./ssler logs src:192.168.201.0/24 dst:10.0.0.0/16
-A PREROUTING -s 192.168.201.0/24 -d 10.0.0.0/16 -p tcp -m tcp –dport 80 -j REDIRECT –to-ports 8888
To ensure that these rules do not get removed, ssler deletes them and then adds them back approximately every four minutes.“
More behaviors of the malware are described at https://news.sophos.com/en-us/2018/05/27/vpnfilter-botnet-a-sophoslabs-analysis-part-2/ including photobucket request, fake CA certs claiming Microsoft issued them and ipify lookups.
YARA rules for detection –
YARA (yet another recursive acronym) is a format to specify rules match malware based on string patterns, regular expressions and their frequency of occurrence. A guide to writing effective ones is here.
User-Agent rule –
Ipify self-ip address querying service, with json output. http://api.ipify.org/