Page 1 sur 2
[backdoor!] mon archlinux est une passoire
Publié : mer. 05 nov. 2014, 16:54
par rasta
Bonjour,
J'écrie un sujet car je viens de découvrir un serveur telnet, ftp et autre joyeuserie lancé sur ma machine contre toute volonté de ma part.
Quelqu'un peut-il me dire si cela est normal? ou pas du tout!
Peut-être un problème de configuration automatique?
Mercie de votre aide....
Code : Tout sélectionner
Nmap scan report for 192.168.0.157
Host is up (0.000071s latency).
Not shown: 996 closed ports
PORT STATE SERVICE
21/tcp open ftp
23/tcp open telnet
513/tcp open login
514/tcp open shell
Device type: general purpose
Running: Linux 3.X
OS CPE: cpe:/o:linux:linux_kernel:3
OS details: Linux 3.7 - 3.15
Network Distance: 0 hops
Re: [backdoor!] mon archlinux est une passoire
Publié : mer. 05 nov. 2014, 17:25
par benjarobin
Non ce n'est pas normal que je sache... Quelle commande nmap as tu utilisé ?
Et non il n'y a pas de configuration automatique.
Quelle est la sortie en root de :
Re: [backdoor!] mon archlinux est une passoire
Publié : mer. 05 nov. 2014, 17:43
par rasta
la sorite de "netstat -taupen" est:
Code : Tout sélectionner
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State User Inode PID/Program name
tcp 0 0 0.0.0.0:5355 0.0.0.0:* LISTEN 195 13527 386/systemd-resolve
tcp 0 0 192.168.0.162:46093 5.39.81.167:443 TIME_WAIT 0 0 -
tcp6 0 0 :::5355 :::* LISTEN 195 13529 386/systemd-resolve
tcp6 0 0 :::19532 :::* LISTEN 0 9882 1/init
tcp6 0 0 :::754 :::* LISTEN 0 9880 1/init
tcp6 0 0 :::21 :::* LISTEN 0 13419 391/ftpd
tcp6 0 0 :::23 :::* LISTEN 0 9883 1/init
tcp6 0 0 :::513 :::* LISTEN 0 9881 1/init
tcp6 0 0 :::514 :::* LISTEN 0 11965 1/init
udp 0 0 0.0.0.0:68 0.0.0.0:* 0 14682 634/dhcpcd
udp 0 0 0.0.0.0:518 0.0.0.0:* 0 9884 1/init
udp 0 0 0.0.0.0:53841 0.0.0.0:* 192 42419 291/systemd-timesyn
udp 0 0 0.0.0.0:5355 0.0.0.0:* 195 13526 386/systemd-resolve
udp6 0 0 :::5355 :::* 195 13528 386/systemd-resolve
J'ai scanné mon pc avec:
sinon la sortie suivante de "nmap -A -T4 <mon ip>" donne la sortie suivante avec l'erreur suivante:
erreur:
Code : Tout sélectionner
NSOCK ERROR [23.8220s] mksock_bin_addr(): Bind to 0.0.0.0:23 failed (IOD #5): Adress already in use (98)
Code : Tout sélectionner
#nmap -A -T4 <mon ip>
Starting Nmap 6.47 ( http://nmap.org ) at 2014-11-05 17:37 CET
Nmap scan report for 192.168.0.162
Host is up (0.000064s latency).
Not shown: 996 closed ports
PORT STATE SERVICE VERSION
21/tcp open ftp GNU Inetutils FTPd 1.9.2
|_ftp-anon: Anonymous FTP login allowed (FTP code 230)
23/tcp open telnet Openwall GNU/*/Linux telnetd
513/tcp open login?
514/tcp open tcpwrapped
Device type: general purpose
Running: Linux 3.X
OS CPE: cpe:/o:linux:linux_kernel:3
OS details: Linux 3.7 - 3.15
Network Distance: 0 hops
Service Info: Host: rop; OS: Linux
OS and Service detection performed. Please report any incorrect results at http://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 28.88 seconds
???????
Re: [backdoor!] mon archlinux est une passoire
Publié : mer. 05 nov. 2014, 17:54
par benjarobin
Peux tu donner la sortie de :
Re: [backdoor!] mon archlinux est une passoire
Publié : mer. 05 nov. 2014, 18:03
par rasta
sortie de systemctl --no-pager:
Code : Tout sélectionner
UNIT LOAD ACTIVE SUB
proc-sys-fs-binfmt_misc.automount loaded active running Arbitrary Executable File Formats File System Automount Point
sys-devices-pci0000:00-0000:00:01.0-0000:01:00.0-backlight-acpi_video0.device loaded active plugged /sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0/backlight/acpi_video0
sys-devices-pci0000:00-0000:00:1b.0-sound-card0.device loaded active plugged 82801H (ICH8 Family) HD Audio Controller
sys-devices-pci0000:00-0000:00:1d.7-usb2-2\x2d3-2\x2d3:1.0-ieee80211-phy0-rfkill0.device loaded active plugged /sys/devices/pci0000:00/0000:00:1d.7/usb2/2-3/2-3:1.0/ieee80211/phy0/rfkill0
sys-devices-pci0000:00-0000:00:1d.7-usb2-2\x2d3-2\x2d3:1.0-net-wlp0s29f7u3.device loaded active plugged RT2770 Wireless Adapter
sys-devices-pci0000:00-0000:00:1e.0-0000:03:00.0-ssb1:0-net-eth0.device loaded active plugged BCM4401-B0 100Base-TX
sys-devices-pci0000:00-0000:00:1f.1-ata1-host0-target0:0:0-0:0:0:0-block-sr0.device loaded active plugged TSSTcorp_DVD+_-RW_TS-L632H
sys-devices-pci0000:00-0000:00:1f.2-ata3-host2-target2:0:0-2:0:0:0-block-sda-sda1.device loaded active plugged FUJITSU_MHY2250BH 1
sys-devices-pci0000:00-0000:00:1f.2-ata3-host2-target2:0:0-2:0:0:0-block-sda-sda2.device loaded active plugged FUJITSU_MHY2250BH 2
sys-devices-pci0000:00-0000:00:1f.2-ata3-host2-target2:0:0-2:0:0:0-block-sda-sda3.device loaded active plugged FUJITSU_MHY2250BH 3
sys-devices-pci0000:00-0000:00:1f.2-ata3-host2-target2:0:0-2:0:0:0-block-sda-sda4.device loaded active plugged FUJITSU_MHY2250BH 4
sys-devices-pci0000:00-0000:00:1f.2-ata3-host2-target2:0:0-2:0:0:0-block-sda.device loaded active plugged FUJITSU_MHY2250BH
sys-devices-platform-serial8250-tty-ttyS0.device loaded active plugged /sys/devices/platform/serial8250/tty/ttyS0
sys-devices-platform-serial8250-tty-ttyS1.device loaded active plugged /sys/devices/platform/serial8250/tty/ttyS1
sys-devices-platform-serial8250-tty-ttyS2.device loaded active plugged /sys/devices/platform/serial8250/tty/ttyS2
sys-devices-platform-serial8250-tty-ttyS3.device loaded active plugged /sys/devices/platform/serial8250/tty/ttyS3
sys-module-configfs.device loaded active plugged /sys/module/configfs
sys-subsystem-net-devices-eth0.device loaded active plugged BCM4401-B0 100Base-TX
sys-subsystem-net-devices-wlp0s29f7u3.device loaded active plugged RT2770 Wireless Adapter
-.mount loaded active mounted /
boot.mount loaded active mounted /boot
dev-hugepages.mount loaded active mounted Huge Pages File System
dev-mqueue.mount loaded active mounted POSIX Message Queue File System
home.mount loaded active mounted /home
proc-sys-fs-binfmt_misc.mount loaded active mounted Arbitrary Executable File Formats File System
run-user-1001.mount loaded active mounted /run/user/1001
sys-kernel-config.mount loaded active mounted Configuration File System
sys-kernel-debug.mount loaded active mounted Debug File System
tmp.mount loaded active mounted Temporary Directory
systemd-ask-password-console.path loaded active waiting Dispatch Password Requests to Console Directory Watch
systemd-ask-password-wall.path loaded active waiting Forward Password Requests to Wall Directory Watch
session-c1.scope loaded active running Session c1 of user rasta
blk-availability.service loaded active exited Availability of block devices
dbus.service loaded active running D-Bus System Message Bus
● dhcpcd.service loaded failed failed dhcpcd on all interfaces
dm-event.service loaded active running Device-mapper event daemon
ftpd.service loaded active running FTPD Daemon
getty@tty1.service loaded active running Getty on tty1
● ip6tables.service loaded failed failed IPv6 Packet Filtering Framework
● iptables.service loaded failed failed Packet Filtering Framework
kmod-static-nodes.service loaded active exited Create list of required static device nodes for the current kernel
● krb5-kadmind.service loaded failed failed Kerberos 5 administration server
● krb5-kdc.service loaded failed failed Kerberos 5 KDC
ldconfig.service loaded active exited Rebuild Dynamic Linker Cache
lvm2-lvmetad.service loaded active running LVM2 metadata daemon
lvm2-monitor.service loaded active exited Monitoring of LVM2 mirrors, snapshots etc. using dmeventd or progress polling
● mdadm.service loaded failed failed MDADM Event Monitor
netctl.service loaded active exited (Re)store the netctl profile state
nscd.service loaded active running Name Service Cache Daemon
● shadow.service loaded failed failed Verify integrity of password and group files
systemd-backlight@backlight:acpi_video0.service loaded active exited Load/Save Screen Backlight Brightness of backlight:acpi_video0
systemd-fsck@dev-disk-by\x2duuid-5fe1f199\x2d97bc\x2d4cb3\x2d8b09\x2d394037597c49.service loaded active exited File System Check on /dev/disk/by-uuid/5fe1f199-97bc-4cb3-8b09-394037597c49
systemd-fsck@dev-disk-by\x2duuid-78f90c81\x2d3ed9\x2d4f25\x2d8062\x2dc1b2789fc246.service loaded active exited File System Check on /dev/disk/by-uuid/78f90c81-3ed9-4f25-8062-c1b2789fc246
systemd-journal-catalog-update.service loaded active exited Rebuild Journal Catalog
● systemd-journal-upload.service loaded failed failed Journal Remote Upload Service
systemd-journald.service loaded active running Journal Service
systemd-logind.service loaded active running Login Service
systemd-networkd.service loaded active running Network Service
systemd-random-seed.service loaded active exited Load/Save Random Seed
systemd-readahead-collect.service loaded active exited Collect Read-Ahead Data
systemd-readahead-replay.service loaded active exited Replay Read-Ahead Data
systemd-remount-fs.service loaded active exited Remount Root and Kernel File Systems
systemd-resolved.service loaded active running Network Name Resolution
systemd-rfkill@rfkill0.service loaded active exited Load/Save RF Kill Switch Status of rfkill0
systemd-sysctl.service loaded active exited Apply Kernel Variables
systemd-sysusers.service loaded active exited Create System Users
systemd-timesyncd.service loaded active running Network Time Synchronization
systemd-tmpfiles-setup-dev.service loaded active exited Create Static Device Nodes in /dev
systemd-tmpfiles-setup.service loaded active exited Create Volatile Files and Directories
systemd-udev-hwdb-update.service loaded active exited Rebuild Hardware Database
systemd-udev-trigger.service loaded active exited udev Coldplug all Devices
systemd-udevd.service loaded active running udev Kernel Device Manager
systemd-update-done.service loaded active exited Update is Completed
systemd-update-utmp.service loaded active exited Update UTMP about System Boot/Shutdown
systemd-user-sessions.service loaded active exited Permit User Sessions
systemd-vconsole-setup.service loaded active exited Setup Virtual Console
user@1001.service loaded active running User Manager for UID 1001
-.slice loaded active active Root Slice
system-getty.slice loaded active active system-getty.slice
system-rlogin.slice loaded active active system-rlogin.slice
system-rsh.slice loaded active active system-rsh.slice
system-systemd\x2dbacklight.slice loaded active active system-systemd\x2dbacklight.slice
system-systemd\x2dfsck.slice loaded active active system-systemd\x2dfsck.slice
system-systemd\x2drfkill.slice loaded active active system-systemd\x2drfkill.slice
system-telnet.slice loaded active active system-telnet.slice
system.slice loaded active active System Slice
user-1001.slice loaded active active user-1001.slice
user.slice loaded active active User and Session Slice
dbus.socket loaded active running D-Bus System Message Bus Socket
dm-event.socket loaded active running Device-mapper event daemon FIFOs
krb5-kpropd.socket loaded active listening Kerberos 5 propagation server
lvm2-lvmetad.socket loaded active running LVM2 metadata daemon socket
rlogin.socket loaded active listening Remote Login Facilities Activation Socket
rsh.socket loaded active listening Remote Shell Facilities Activation Socket
systemd-initctl.socket loaded active listening /dev/initctl Compatibility Named Pipe
systemd-journal-remote.socket loaded active listening Journal Remote Sink Socket
systemd-journald-dev-log.socket loaded active running Journal Socket (/dev/log)
systemd-journald.socket loaded active running Journal Socket
systemd-shutdownd.socket loaded active listening Delayed Shutdown Socket
systemd-udevd-control.socket loaded active running udev Control Socket
systemd-udevd-kernel.socket loaded active running udev Kernel Socket
talk.socket loaded active listening Talk Server Activation Socket
telnet.socket loaded active listening Telnet Server Activation Socket
uuidd.socket loaded active listening UUID daemon activation socket
dev-sda2.swap loaded active active /dev/sda2
basic.target loaded active active Basic System
cryptsetup.target loaded active active Encrypted Volumes
getty.target loaded active active Login Prompts
graphical.target loaded active active Graphical Interface
local-fs-pre.target loaded active active Local File Systems (Pre)
local-fs.target loaded active active Local File Systems
multi-user.target loaded active active Multi-User System
network.target loaded active active Network
paths.target loaded active active Paths
remote-fs.target loaded active active Remote File Systems
slices.target loaded active active Slices
sockets.target loaded active active Sockets
sound.target loaded active active Sound Card
swap.target loaded active active Swap
sysinit.target loaded active active System Initialization
time-sync.target loaded active active System Time Synchronized
timers.target loaded active active Timers
fstrim.timer loaded active waiting Discard unused blocks once a week
logrotate.timer loaded active waiting Daily rotation of log files
man-db.timer loaded active waiting Daily man-db cache update
shadow.timer loaded active waiting Daily verification of password and group files
systemd-readahead-done.timer loaded active elapsed Stop Read-Ahead Data Collection 10s After Completed Startup
systemd-tmpfiles-clean.timer loaded active waiting Daily Cleanup of Temporary Directories
LOAD = Reflects whether the unit definition was properly loaded.
ACTIVE = The high-level unit activation state, i.e. generalization of SUB.
SUB = The low-level unit activation state, values depend on unit type.
128 loaded units listed. Pass --all to see loaded but inactive units, too.
To show all installed unit files use 'systemctl list-unit-files'.
sortie de tree /etc/systemd/system:
Code : Tout sélectionner
/etc/systemd/system
├── default.target.wants
│ ├── systemd-readahead-collect.service -> /usr/lib/systemd/system/systemd-readahead-collect.service
│ └── systemd-readahead-replay.service -> /usr/lib/systemd/system/systemd-readahead-replay.service
├── getty.target.wants
│ └── getty@tty1.service -> /usr/lib/systemd/system/getty@.service
├── multi-user.target.wants
│ ├── dhcpcd.service -> /usr/lib/systemd/system/dhcpcd.service
│ ├── fstrim.timer -> /usr/lib/systemd/system/fstrim.timer
│ ├── ftpd.service -> /usr/lib/systemd/system/ftpd.service
│ ├── ip6tables.service -> /usr/lib/systemd/system/ip6tables.service
│ ├── iptables.service -> /usr/lib/systemd/system/iptables.service
│ ├── krb5-kadmind.service -> /usr/lib/systemd/system/krb5-kadmind.service
│ ├── krb5-kdc.service -> /usr/lib/systemd/system/krb5-kdc.service
│ ├── krb5-kpropd.service -> /usr/lib/systemd/system/krb5-kpropd.service
│ ├── mdadm.service -> /usr/lib/systemd/system/mdadm.service
│ ├── netctl.service -> /usr/lib/systemd/system/netctl.service
│ ├── nscd.service -> /usr/lib/systemd/system/nscd.service
│ ├── remote-fs.target -> ../../../../usr/lib/systemd/system/remote-fs.target
│ ├── systemd-journal-upload.service -> /usr/lib/systemd/system/systemd-journal-upload.service
│ ├── systemd-networkd.service -> /usr/lib/systemd/system/systemd-networkd.service
│ └── systemd-resolved.service -> /usr/lib/systemd/system/systemd-resolved.service
├── sleep.target.wants
│ └── netctl-sleep.service -> /usr/lib/systemd/system/netctl-sleep.service
├── sockets.target.wants
│ ├── krb5-kpropd.socket -> /usr/lib/systemd/system/krb5-kpropd.socket
│ ├── rlogin.socket -> /usr/lib/systemd/system/rlogin.socket
│ ├── rsh.socket -> /usr/lib/systemd/system/rsh.socket
│ ├── systemd-journal-remote.socket -> /usr/lib/systemd/system/systemd-journal-remote.socket
│ ├── talk.socket -> /usr/lib/systemd/system/talk.socket
│ ├── telnet.socket -> /usr/lib/systemd/system/telnet.socket
│ └── uuidd.socket -> /usr/lib/systemd/system/uuidd.socket
├── sysinit.target.wants
│ ├── blk-availability.service -> /usr/lib/systemd/system/blk-availability.service
│ ├── dm-event.service -> /usr/lib/systemd/system/dm-event.service
│ ├── lvm2-lvmetad.service -> /usr/lib/systemd/system/lvm2-lvmetad.service
│ ├── lvm2-monitor.service -> /usr/lib/systemd/system/lvm2-monitor.service
│ └── systemd-timesyncd.service -> /usr/lib/systemd/system/systemd-timesyncd.service
└── system-update.target.wants
└── systemd-readahead-drop.service -> /usr/lib/systemd/system/systemd-readahead-drop.service
7 directories, 32 files
Re: [backdoor!] mon archlinux est une passoire
Publié : mer. 05 nov. 2014, 18:15
par Moviuro
sortie de tree /etc/systemd/system:
Code : Tout sélectionner
/etc/systemd/system
├── multi-user.target.wants
│ ├── ftpd.service -> /usr/lib/systemd/system/ftpd.service
│ ├── krb5-kadmind.service -> /usr/lib/systemd/system/krb5-kadmind.service
│ ├── krb5-kdc.service -> /usr/lib/systemd/system/krb5-kdc.service
│ ├── krb5-kpropd.service -> /usr/lib/systemd/system/krb5-kpropd.service
│ ├── nscd.service -> /usr/lib/systemd/system/nscd.service
├── sockets.target.wants
│ ├── krb5-kpropd.socket -> /usr/lib/systemd/system/krb5-kpropd.socket
│ ├── rlogin.socket -> /usr/lib/systemd/system/rlogin.socket
│ ├── rsh.socket -> /usr/lib/systemd/system/rsh.socket
│ ├── talk.socket -> /usr/lib/systemd/system/talk.socket
│ ├── telnet.socket -> /usr/lib/systemd/system/telnet.socket
Voilà pour les trucs louches et/ou que je ne connais pas.
Je suppose que krb5, c'est Kerberos.
Il faudra que tu vérifies si tout fonctionne encore après avoir désactivé (disable) lesdits service sus-cités.
Re: [backdoor!] mon archlinux est une passoire
Publié : mer. 05 nov. 2014, 18:28
par rasta
Mercie de ta sortie Moviuro mais je voudrais comprendre comment un serveur telnet et ftp ce sont invitées sur les ports de ma machine? ???
Surtout que le pire c'est que je ne sais pas comment désactivé tout ses services (telnetd, ftpd, login, shell):
il semble que pour desactiver telnetd il faut uiliser ixnetd???
lien
https://wiki.archlinux.org/index.php/telnet
Re: [backdoor!] mon archlinux est une passoire
Publié : mer. 05 nov. 2014, 18:31
par Moviuro
Parce que tu les as systemctl enable <machin>
? Ou au pire, tu avais ouvert un des ports louches, genre telnet et quelqu'un les a lancés... Ou un de tes collègues/enfants/collocataires t'a fait une bonne blague.
Re: [backdoor!] mon archlinux est une passoire
Publié : mer. 05 nov. 2014, 18:39
par rasta
Soit je suis amnésique soit skyso.Mais j'ai jamais activé tout ses services. Il faut connaitre un minimum systemd pour activer ces services donc le coup du
"collègues/enfants/collocataires t'a fait une bonne blague." j'ai du mal a y croire. Surtout que je vis pas entouré de geek ou de gens qui font de l'informatique mais alors vraiment pas.
Re: [backdoor!] mon archlinux est une passoire
Publié : mer. 05 nov. 2014, 19:38
par bobo
Déjà tu peux faire :
Code : Tout sélectionner
systemctl stop telnet
systemctl disable telnet
systemctl stop ftpd
systemctl disable ftpd
À suivre, si ces services « réapparaissent ». Ce qui aussi pourrait être sympa serait de fouiller dans les logs systemd pour voir quand ces services ont été activés (je ne sais pas|plus comment faire).
Ensuite ce serait intéressant de voir le contenu de tes config
iptables, étant donné que iptables à l'air de tourner :
Bon courage !
Édition :
Petites variations à partir de ce que je connais pour essayer de dépiler l'historique de ces services chelous, avec ça tu devrais parvenir à dater les choses
# journalctl -u sshd | head
-- Logs begin at jeu. 1970-01-01 01:00:06 CET, end at mer. 2014-11-05 19:48:24 CET. --
août 20 00:18:42 alarmpi systemd[1]: Starting OpenSSH Daemon...
août 20 00:18:42 alarmpi systemd[1]: Started OpenSSH Daemon.
août 20 00:18:42 alarmpi sshd[142]: Server listening on 0.0.0.0 port 22.
août 20 00:18:42 alarmpi sshd[142]: Server listening on :: port 22.
-- Reboot --
août 20 00:18:16 alarmpi systemd[1]: Started OpenSSH Daemon.
août 20 00:18:17 alarmpi sshd[127]: Server listening on 0.0.0.0 port 22.
août 20 00:18:17 alarmpi sshd[127]: Server listening on :: port 22.
sept. 28 14:33:21 alarmpi systemd[1]: Stopped OpenSSH Daemon.
# which sshd
/usr/bin/sshd
# pacman -Qo /usr/bin/sshd
/usr/bin/sshd appartient à openssh 6.6p1-2
# pacman -Qi openssh
Nom : openssh
Version : 6.6p1-2
Description : Free version of the SSH connectivity tools
Architecture : armv6h
URL :
http://www.openssh.org/portable.html
Licences : custom:BSD
Groupes : --
Fournit : --
Dépend de : krb5 openssl libedit ldns
Dépendances opt. : xorg-xauth: X11 forwarding
x11-ssh-askpass: input passphrase in X
Requis par : --
Optionnel pour : --
Est en conflit avec : --
Remplace : --
Taille installé : 4358,00 KiB
Paqueteur : Arch Linux ARM Build System <
builder+xu3@archlinuxarm.org>
Compilé le : mer. 23 avril 2014 23:06:13 CEST
Installé le : sam. 06 sept. 2014 22:22:04 CEST
Motif d’installation : Explicitement installé
Script d’installation : Oui
Validé par : Somme SHA256
# ls -l /var/cache/pacman/pkg
Re: [backdoor!] mon archlinux est une passoire
Publié : mer. 05 nov. 2014, 22:58
par rasta
bien le merci bobo pour le :
cependant ceci de fonctionnent pas:
Code : Tout sélectionner
#systemctl stop telnet
Failed to stop telnet.service: Unit telnet.service not loaded.
de même en essayant telnetd:
Code : Tout sélectionner
#systemctl stop telnetd
Failed to stop telnetd.service: Unit telnetd.service not loaded.
et même retour pour les services login et shell
.
voici la sortie de iptable:
/etc/iptables/simple_firewall.rules:
Code : Tout sélectionner
*filter
:INPUT DROP [0:0]
:FORWARD DROP [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -p icmp -j ACCEPT
-A INPUT -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -p tcp -j REJECT --reject-with tcp-reset
-A INPUT -p udp -j REJECT --reject-with icmp-port-unreachable
-A INPUT -j REJECT --reject-with icmp-proto-unreachable
COMMIT
/etc/optables/empty.rules:
Code : Tout sélectionner
# Empty iptables rule file
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
COMMIT
Si quelq'un peut m'aider a desactiver les services telnetd, shell et login je le remerci d'avance.
Re: [backdoor!] mon archlinux est une passoire
Publié : jeu. 06 nov. 2014, 08:28
par oktoberfest
Salut,
comme le montre le résultat de tree, la plupart des tes unités sont des .socket. Il te faut donc les désactiver avec (par exemple pour telnet) :
Si tu ne spécifies pas de .XXX, par défaut c'est .service qui est pris en compte.
Il serait aussi intéressant de faire un
En regardant l'heure associé à chaque unité, tu pourras en déduire la date/heure où ces différentes unités ont été activées
Re: [backdoor!] mon archlinux est une passoire
Publié : jeu. 06 nov. 2014, 08:42
par Elbarto
rasta a écrit :Mercie de ta sortie Moviuro mais je voudrais comprendre comment un serveur telnet et ftp ce sont invitées sur les ports de ma machine? ???
c'est simple : la faille de sécurité chez archlinux s'appelle le dépôt AUR
car n'importe qui peut déposer un PKGBUILD douteux sur le dépôt AUR, il n'y a aucune vérification, ni examen d'entrée pour celui qui veut devenir mainteneur chez le dépôt AUR,
si tu as installé un paquet AUR douteux sans vérifier le contenu du PKGBUILD et des fichiers *.install alors ça peut venir de là
Re: [backdoor!] mon archlinux est une passoire
Publié : jeu. 06 nov. 2014, 14:48
par rasta
mercie Elbarto pour m'avoir au moins donné un vecteur de coruption possible et mercie oktoberfest pour m'avoir montré comment utiliser systemd.
pour ce qui de la sortie de "ls -lR /etc/systemd/system":
Code : Tout sélectionner
/etc/systemd/system:
total 28
drwxr-xr-x 2 root root 4096 2 sept. 04:10 default.target.wants
drwxr-xr-x 2 root root 4096 2 sept. 03:57 getty.target.wants
drwxr-xr-x 2 root root 4096 3 sept. 15:38 multi-user.target.wants
drwxr-xr-x 2 root root 4096 2 sept. 04:10 sleep.target.wants
drwxr-xr-x 2 root root 4096 2 sept. 04:10 sockets.target.wants
drwxr-xr-x 2 root root 4096 2 sept. 04:10 sysinit.target.wants
drwxr-xr-x 2 root root 4096 2 sept. 04:10 system-update.target.wants
/etc/systemd/system/default.target.wants:
total 0
lrwxrwxrwx 1 root root 57 2 sept. 04:10 systemd-readahead-collect.service -> /usr/lib/systemd/system/systemd-readahead-collect.service
lrwxrwxrwx 1 root root 56 2 sept. 04:10 systemd-readahead-replay.service -> /usr/lib/systemd/system/systemd-readahead-replay.service
/etc/systemd/system/getty.target.wants:
total 0
lrwxrwxrwx 1 root root 38 2 sept. 03:57 getty@tty1.service -> /usr/lib/systemd/system/getty@.service
/etc/systemd/system/multi-user.target.wants:
total 0
lrwxrwxrwx 1 root root 38 2 sept. 04:10 dhcpcd.service -> /usr/lib/systemd/system/dhcpcd.service
lrwxrwxrwx 1 root root 36 2 sept. 04:10 fstrim.timer -> /usr/lib/systemd/system/fstrim.timer
lrwxrwxrwx 1 root root 36 2 sept. 04:10 ftpd.service -> /usr/lib/systemd/system/ftpd.service
lrwxrwxrwx 1 root root 41 2 sept. 04:10 ip6tables.service -> /usr/lib/systemd/system/ip6tables.service
lrwxrwxrwx 1 root root 40 2 sept. 04:10 iptables.service -> /usr/lib/systemd/system/iptables.service
lrwxrwxrwx 1 root root 44 2 sept. 04:10 krb5-kadmind.service -> /usr/lib/systemd/system/krb5-kadmind.service
lrwxrwxrwx 1 root root 40 2 sept. 04:10 krb5-kdc.service -> /usr/lib/systemd/system/krb5-kdc.service
lrwxrwxrwx 1 root root 43 2 sept. 04:10 krb5-kpropd.service -> /usr/lib/systemd/system/krb5-kpropd.service
lrwxrwxrwx 1 root root 37 2 sept. 04:10 mdadm.service -> /usr/lib/systemd/system/mdadm.service
lrwxrwxrwx 1 root root 38 2 sept. 04:10 netctl.service -> /usr/lib/systemd/system/netctl.service
lrwxrwxrwx 1 root root 36 2 sept. 04:10 nscd.service -> /usr/lib/systemd/system/nscd.service
lrwxrwxrwx 1 root root 51 1 sept. 19:41 remote-fs.target -> ../../../../usr/lib/systemd/system/remote-fs.target
lrwxrwxrwx 1 root root 54 2 sept. 04:10 systemd-journal-upload.service -> /usr/lib/systemd/system/systemd-journal-upload.service
lrwxrwxrwx 1 root root 48 2 sept. 04:10 systemd-networkd.service -> /usr/lib/systemd/system/systemd-networkd.service
lrwxrwxrwx 1 root root 48 2 sept. 04:10 systemd-resolved.service -> /usr/lib/systemd/system/systemd-resolved.service
/etc/systemd/system/sleep.target.wants:
total 0
lrwxrwxrwx 1 root root 44 2 sept. 04:10 netctl-sleep.service -> /usr/lib/systemd/system/netctl-sleep.service
/etc/systemd/system/sockets.target.wants:
total 0
lrwxrwxrwx 1 root root 42 2 sept. 04:10 krb5-kpropd.socket -> /usr/lib/systemd/system/krb5-kpropd.socket
lrwxrwxrwx 1 root root 37 2 sept. 04:10 rlogin.socket -> /usr/lib/systemd/system/rlogin.socket
lrwxrwxrwx 1 root root 34 2 sept. 04:10 rsh.socket -> /usr/lib/systemd/system/rsh.socket
lrwxrwxrwx 1 root root 53 2 sept. 04:10 systemd-journal-remote.socket -> /usr/lib/systemd/system/systemd-journal-remote.socket
lrwxrwxrwx 1 root root 35 2 sept. 04:10 talk.socket -> /usr/lib/systemd/system/talk.socket
lrwxrwxrwx 1 root root 37 2 sept. 04:10 telnet.socket -> /usr/lib/systemd/system/telnet.socket
lrwxrwxrwx 1 root root 36 2 sept. 04:10 uuidd.socket -> /usr/lib/systemd/system/uuidd.socket
/etc/systemd/system/sysinit.target.wants:
total 0
lrwxrwxrwx 1 root root 48 2 sept. 04:10 blk-availability.service -> /usr/lib/systemd/system/blk-availability.service
lrwxrwxrwx 1 root root 40 2 sept. 04:10 dm-event.service -> /usr/lib/systemd/system/dm-event.service
lrwxrwxrwx 1 root root 44 2 sept. 04:10 lvm2-lvmetad.service -> /usr/lib/systemd/system/lvm2-lvmetad.service
lrwxrwxrwx 1 root root 44 2 sept. 04:10 lvm2-monitor.service -> /usr/lib/systemd/system/lvm2-monitor.service
lrwxrwxrwx 1 root root 49 2 sept. 04:10 systemd-timesyncd.service -> /usr/lib/systemd/system/systemd-timesyncd.service
/etc/systemd/system/system-update.target.wants:
total 0
lrwxrwxrwx 1 root root 54 2 sept. 04:10 systemd-readahead-drop.service -> /usr/lib/systemd/system/systemd-readahead-drop.service
Re: [backdoor!] mon archlinux est une passoire
Publié : jeu. 06 nov. 2014, 15:49
par rasta
un nouveau scan avec nmap en scannant tout les ports possible, me montre que d'autre ports sont ouvert sur mon pc:
Code : Tout sélectionner
#nmap -p- -A -T4 192.168.0.162
...
PORT STATE SERVICE VERSION
754 open krb_prop?
5355 open unknow
19532 open tcpwrapped
...
là il y a vraiment un problème!!!! Non
Comment puis-je faire pour desactiver ces ports ouverts ?????
Re: [backdoor!] mon archlinux est une passoire
Publié : jeu. 06 nov. 2014, 21:12
par Elbarto
est-ce que tu as activé le mode routeur de ta box ADSL ?
ça apporte une certaine protection dans le sens où ta machine sera invisible depuis l'extérieur,
puis un iptable bien réglé empêchera ces serveurs d'atteindre l’extérieur,
ensuite tu peux essayer de voir quel paquet a installé ces fichiers *.socket *.services en faisant un :
le résultat pointera alors le paquet coupable d'avoir installé ces serveurs, il suffit alors de désinstaller ce paquet pour que ces fichiers disparaissent de ton disque dur
il existe aussi une commande pacman qui permet de lister les fichiers présent dans "/" qui n'appartiennent à aucun paquet officiel ( ou qui n'appartiennent qu'à des paquets AUR ), ça aide aussi à faire le tri entre le "bien" et le "mal"
Re: [backdoor!] mon archlinux est une passoire
Publié : jeu. 06 nov. 2014, 21:18
par benjarobin
Sauf que les fichiers dans /etc/systemd/system n'appartienne très souvent à aucun paquet.
Re: [backdoor!] mon archlinux est une passoire
Publié : jeu. 06 nov. 2014, 21:41
par Elbarto
c'est étonnant, je pensais que chaque fichier présent dans "/" était enregistré par pacman dans sa base de données lorsqu'on installe un paquet, histoire ensuite de maintenir une certaine cohérence pour éviter que l'installation d'un futur paquet n'écrase un fichier d'un autre paquet ( pas de conflit de fichiers ),
peut-être que ces fichiers orphelins ont été crées via des scripts bash contenus dans des fichiers *.install d'un paquet, ce qui permet de contourner la surveillance de pacman lors de l'installation du paquet ?
Re: [backdoor!] mon archlinux est une passoire
Publié : jeu. 06 nov. 2014, 22:01
par benjarobin
En effet... C'est pour cela qu'il est très important de lire les fichiers .install
Re: [backdoor!] mon archlinux est une passoire
Publié : jeu. 06 nov. 2014, 22:07
par bobo
benjarobin a écrit :Sauf que les fichiers dans /etc/systemd/system n'appartienne très souvent à aucun paquet.
Je pense que Elbarto voulait parler des fichiers sur lesquels pointent les liens de /etc/systemd/system
Avec cette méthode il est possible de retrouver à quel paquet appartient tel service.
Code : Tout sélectionner
$ ls -l /etc/systemd/system/multi-user.target.wants
total 0
lrwxrwxrwx 1 root root 44 6 juil. 16:14 cups-browsed.service -> /usr/lib/systemd/system/cups-browsed.service
lrwxrwxrwx 1 root root 33 6 juil. 13:45 cups.path -> /usr/lib/systemd/system/cups.path
lrwxrwxrwx 1 root root 41 1 oct. 19:47 ip6tables.service -> /usr/lib/systemd/system/ip6tables.service
lrwxrwxrwx 1 root root 40 6 juil. 15:42 iptables.service -> /usr/lib/systemd/system/iptables.service
lrwxrwxrwx 1 root root 42 8 juil. 18:42 lm_sensors.service -> /usr/lib/systemd/system/lm_sensors.service
lrwxrwxrwx 1 root root 59 6 avril 2014 netctl@wlp3s7\x2dHITRON\x2d1C50.service -> /etc/systemd/system/netctl@wlp3s7\x2dHITRON\x2d1C50.service
lrwxrwxrwx 1 root root 39 9 avril 2014 ntpdate.service -> /usr/lib/systemd/system/ntpdate.service
lrwxrwxrwx 1 root root 36 9 avril 2014 ntpd.service -> /usr/lib/systemd/system/ntpd.service
lrwxrwxrwx 1 root root 43 31 oct. 12:46 org.cups.cupsd.path -> /usr/lib/systemd/system/org.cups.cupsd.path
lrwxrwxrwx 1 root root 39 27 juin 21:36 preload.service -> /usr/lib/systemd/system/preload.service
lrwxrwxrwx 1 root root 51 1 sept. 19:41 remote-fs.target -> ../../../../usr/lib/systemd/system/remote-fs.target
$ pacman -Qo ../../../../usr/lib/systemd/system/remote-fs.target
../../../../usr/lib/systemd/system/remote-fs.target appartient à systemd 216-3
@rasta :
— Comme dit par mp, sans fichier /etc/iptables/iptables.rules, il n'y a pas de pare-feu…
— C'est louche que la plupart de tes services aient des dates genre « 2 sept. 04:10 »,
que faisais-tu le 2 septembre à 4h10 ?
— Il serait intéressant de voir si ces
telnet et
ftpd sont utilisés, et à quelle fréquence, je ne sais pas ce que journalctl peut nous en dire.
Édition :
Un exemple de que ce peut dire journalctl à propos du serveur ssh de mon Raspberry Pi. On voit que toutes les connections sont « logguées » avec des lignes « Accepted password for bobo from 192.168.0.11 » qui permettent d'identifier l'adresse IP de la personne se connectant…
Code : Tout sélectionner
# journalctl --no-pager -r -u sshd | head -n 20
-- Logs begin at jeu. 1970-01-01 01:00:06 CET, end at jeu. 2014-11-06 22:19:09 CET. --
nov. 06 22:18:53 rpi sshd[18191]: pam_unix(sshd:session): session opened for user bobo by (uid=0)
nov. 06 22:18:53 rpi sshd[18191]: Accepted password for bobo from 192.168.0.11 port 45957 ssh2
nov. 05 22:48:27 rpi sshd[164]: Server listening on :: port 22.
nov. 05 22:48:27 rpi sshd[164]: Server listening on 0.0.0.0 port 22.
nov. 05 22:48:26 rpi systemd[1]: Started OpenSSH Daemon.
nov. 05 22:48:26 rpi systemd[1]: Starting OpenSSH Daemon...
-- Reboot --
nov. 05 20:14:09 rpi sshd[175]: Server listening on :: port 22.
nov. 05 20:14:09 rpi sshd[175]: Server listening on 0.0.0.0 port 22.
nov. 05 20:14:09 rpi systemd[1]: Started OpenSSH Daemon.
nov. 05 20:14:09 rpi systemd[1]: Starting OpenSSH Daemon...
-- Reboot --
nov. 05 19:48:00 rpi sshd[213]: pam_unix(sshd:session): session opened for user bobo by (uid=0)
nov. 05 19:48:00 rpi sshd[213]: Accepted password for bobo from 192.168.0.11 port 42686 ssh2
oct. 17 20:39:56 rpi sshd[173]: pam_unix(sshd:session): session opened for user bobo by (uid=0)
oct. 17 20:39:56 rpi sshd[173]: Accepted password for bobo from 192.168.0.11 port 42685 ssh2
oct. 17 20:39:49 rpi sshd[171]: PAM 1 more authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=192.168.0.11 user=root
oct. 17 20:39:49 rpi sshd[171]: Connection closed by 192.168.0.11 [preauth]
oct. 17 20:39:47 rpi sshd[171]: Failed password for root from 192.168.0.11 port 42683 ssh2