Différences
Ci-dessous, les différences entre deux révisions de la page.
| Les deux révisions précédentesRévision précédente | |||
| elearning:workbooks:debian:11:sec:l106 [2025/12/04 09:29] – admin | elearning:workbooks:debian:11:sec:l106 [2025/12/04 09:40] (Version actuelle) – admin | ||
|---|---|---|---|
| Ligne 2555: | Ligne 2555: | ||
| =====Les Contres-Mesures===== | =====Les Contres-Mesures===== | ||
| - | Les contre-mesures consistent en la mise en place de chroot pour certains serveurs ainsi que le durcissement de la configuration de serveurs d' | ||
| - | ====LAB #3 - La commande chroot==== | ||
| - | Le chrootage permet de séparer un utilisateur ou un utilisateur système ( et donc un serveur ) du système. | ||
| - | Sous Debian 12 le binaire chroot est installé par défaut : | ||
| - | |||
| - | < | ||
| - | root@debian12: | ||
| - | / | ||
| - | </ | ||
| - | |||
| - | Commencez par créer un répertoire pour l' | ||
| - | |||
| - | < | ||
| - | root@debian12: | ||
| - | </ | ||
| - | |||
| - | Le binaire **/ | ||
| - | |||
| - | < | ||
| - | root@debian12: | ||
| - | |||
| - | root@debian12: | ||
| - | -rwxr-xr-x. 1 root root 48112 Sep 20 2022 / | ||
| - | |||
| - | root@debian12: | ||
| - | |||
| - | root@debian12: | ||
| - | -rwsr-sr-x. 1 root root 48112 Sep 20 2022 / | ||
| - | </ | ||
| - | |||
| - | Créez maintenant un script de connexion générique pour que l' | ||
| - | |||
| - | < | ||
| - | root@debian12: | ||
| - | |||
| - | root@debian12: | ||
| - | #!/bin/bash | ||
| - | exec -c / | ||
| - | </ | ||
| - | |||
| - | Rendez ce script exécutable : | ||
| - | |||
| - | < | ||
| - | root@debian12: | ||
| - | </ | ||
| - | |||
| - | Il est maintenant nécessaire de copier toutes les commandes dont l' | ||
| - | |||
| - | < | ||
| - | root@debian12: | ||
| - | |||
| - | root@debian12: | ||
| - | |||
| - | root@debian12: | ||
| - | linux-vdso.so.1 (0x00007ffd39fcf000) | ||
| - | libtinfo.so.6 => / | ||
| - | libc.so.6 => / | ||
| - | / | ||
| - | | ||
| - | root@debian12: | ||
| - | |||
| - | root@debian12: | ||
| - | |||
| - | root@debian12: | ||
| - | |||
| - | root@debian12: | ||
| - | |||
| - | root@debian12: | ||
| - | |||
| - | root@debian12: | ||
| - | |||
| - | root@debian12: | ||
| - | linux-vdso.so.1 (0x00007fff3db26000) | ||
| - | libselinux.so.1 => / | ||
| - | libc.so.6 => / | ||
| - | libpcre2-8.so.0 => / | ||
| - | / | ||
| - | |||
| - | root@debian12: | ||
| - | |||
| - | root@debian12: | ||
| - | </ | ||
| - | |||
| - | Créez maintenant le groupe chroot : | ||
| - | |||
| - | < | ||
| - | root@debian12: | ||
| - | |||
| - | root@debian12: | ||
| - | chroot: | ||
| - | </ | ||
| - | |||
| - | Créez maintenant l' | ||
| - | |||
| - | < | ||
| - | root@debian12: | ||
| - | </ | ||
| - | |||
| - | Dernièrement, | ||
| - | |||
| - | < | ||
| - | root@debian12: | ||
| - | </ | ||
| - | |||
| - | Essayez maintenant de vous connecter en tant que l' | ||
| - | |||
| - | < | ||
| - | root@debian12: | ||
| - | |||
| - | bash-5.2$ pwd | ||
| - | / | ||
| - | |||
| - | bash-5.2$ ls | ||
| - | bin lib lib64 | ||
| - | |||
| - | bash-5.2$ ls -la | ||
| - | total 20 | ||
| - | drwxr-xr-x. 5 1001 1001 4096 Dec 1 13:59 . | ||
| - | drwxr-xr-x. 5 1001 1001 4096 Dec 1 13:59 .. | ||
| - | drwxr-xr-x. 2 1001 1001 4096 Dec 1 13:56 bin | ||
| - | drwxr-xr-x. 3 1001 1001 4096 Dec 1 13:59 lib | ||
| - | drwxr-xr-x. 2 1001 1001 4096 Dec 1 13:56 lib64 | ||
| - | |||
| - | bash-5.2$ exit | ||
| - | exit | ||
| - | |||
| - | root@debian12: | ||
| - | </ | ||
| - | |||
| - | Notez que l' | ||
| ----- | ----- | ||
| Copyright © 2025 Hugh Norris. | Copyright © 2025 Hugh Norris. | ||