tech:audit
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 | |||
| tech:audit [2026/05/13 17:46] – Jean-Baptiste | tech:audit [2026/05/29 14:57] (Version actuelle) – Jean-Baptiste | ||
|---|---|---|---|
| Ligne 1: | Ligne 1: | ||
| + | < | ||
| + | {{tag> | ||
| + | # Notes audit | ||
| + | |||
| + | Liens : | ||
| + | * http:// | ||
| + | |||
| + | Note : | ||
| + | * Penser à vérifier le NTP / l' | ||
| + | * Penser à vérifier le SMTP des fax, scanners, imprimantes | ||
| + | |||
| + | |||
| + | ## Quelques commande pour Audit système | ||
| + | |||
| + | Disques | ||
| + | ~~~bash | ||
| + | lsblk | ||
| + | ~~~ | ||
| + | |||
| + | Réseaux | ||
| + | ~~~bash | ||
| + | nft list ruleset | ||
| + | iptables -vnxL | ||
| + | ip6tables -vnxL | ||
| + | ip -s macsec show | ||
| + | ss -peaonmi | ||
| + | resolvectl status | ||
| + | resolvectl statistics | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | ### Fichier de conf | ||
| + | |||
| + | Debian DEB | ||
| + | Voir [[audit_debian_differences_de_version_entre_un_fichier_d_origine_et_le_fichier_actuelle]] | ||
| + | |||
| + | ~~~bash | ||
| + | dpkg -l | ||
| + | LANG=C find /etc -type f -exec dpkg -S {} 2>&1 \; |grep -e ' | ||
| + | LANG=C debsums -as 2>&1 |tee jb_debsums.txt | ||
| + | ~~~ | ||
| + | |||
| + | Pour RedHat/ | ||
| + | ~~~bash | ||
| + | rpm -Va | ||
| + | ~~~ | ||
| + | |||
| + | Exemple | ||
| + | ~~~bash | ||
| + | rpm -V -a |egrep -v -e ' | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | ### Matos | ||
| + | |||
| + | [[linux-avoir-des-infos-sur-le-materiel]] | ||
| + | |||
| + | |||
| + | #### Drivers | ||
| + | |||
| + | ~~~bash | ||
| + | for MODULE in $(lsmod |sed 1d |awk ' | ||
| + | do | ||
| + | modinfo $MODULE |grep -e ' | ||
| + | done 2>&1 |tee jb_modules.txt | ||
| + | ~~~ | ||
| + | |||
| + | Voir DKMS | ||
| + | / | ||
| + | |||
| + | ~~~ | ||
| + | # LANG=C dpkg -S / | ||
| + | dpkg-query: no path found matching pattern / | ||
| + | |||
| + | # dpkg -S / | ||
| + | megaraid-sas-dkms: | ||
| + | ~~~ | ||
| + | |||
| + | `/ | ||
| + | ~~~ | ||
| + | megaraid-sas | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | ### sudoers | ||
| + | |||
| + | ~~~bash | ||
| + | for user in $(awk -F':' | ||
| + | ~~~ | ||
| + | |||
| + | Est-ce que cela fonctionne avec les groupes ? Les netgroups ? etc.... | ||
| + | |||
| + | Ne liste pas les utilisateurs ayant des droits sur sh, bash, perl, python etc... | ||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | ### Config | ||
| + | |||
| + | Flux réseaux : | ||
| + | ~~~bash | ||
| + | tcpdump tcp -p -qtn -nn -i eth0 and not host 192.168.1.11 | ||
| + | ~~~ | ||
| + | |||
| + | Config Apache | ||
| + | ~~~bash | ||
| + | apache2ctl -S | ||
| + | ~~~ | ||
| + | |||
| + | ~~~bash | ||
| + | cat / | ||
| + | ~~~ | ||
| + | |||
| + | Comptes système | ||
| + | ~~~bash | ||
| + | # uid0 | ||
| + | cat /etc/passwd |awk -F':' | ||
| + | |||
| + | # list active account | ||
| + | for compte in $(cat /etc/shadow |awk -F':' | ||
| + | do grep -e " | ||
| + | done > / | ||
| + | |||
| + | #cat ftp1.txt | ||
| + | ~~~ | ||
| + | |||
| + | Réseaux. Serveur | ||
| + | ~~~bash | ||
| + | netstat -tapen |grep LISTEN |grep -v ' | ||
| + | ~~~ | ||
| + | |||
| + | Comptes système. Clefs SSH | ||
| + | ~~~bash | ||
| + | for hom in $(cut -d':' | ||
| + | ~~~ | ||
| + | |||
| + | ~~~bash | ||
| + | perl -a -F':' | ||
| + | ~~~ | ||
| + | |||
| + | Zones DNS | ||
| + | ~~~bash | ||
| + | for zone in $(cat / | ||
| + | ~~~ | ||
| + | |||
| + | MySQL | ||
| + | ~~~bash | ||
| + | mysql -u root -p < <(echo " | ||
| + | mysql -u root -p < <(echo "show databases;" | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | ## Logs | ||
| + | |||
| + | à un jour et une heure précise | ||
| + | |||
| + | ~~~bash | ||
| + | journalctl --since " | ||
| + | |||
| + | touch -t 1910160600 fic1 | ||
| + | touch -t 1910161000 fic2 | ||
| + | find / -newer fic1 -not -newer fic2 | ||
| + | |||
| + | atop -r 20191016 | ||
| + | |||
| + | sar -A -f / | ||
| + | |||
| + | last | ||
| + | ~~~ | ||
