Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Prochaine révision
Révision précédente
elearning:workbooks:debian:11:sec:l108 [2025/12/02 13:10] – créée adminelearning:workbooks:debian:11:sec:l108 [2025/12/04 09:31] (Version actuelle) admin
Ligne 1: Ligne 1:
 ~~PDF:LANDSCAPE~~ ~~PDF:LANDSCAPE~~
 +
 +OPENVPN
  
 Version : **2026.01** Version : **2026.01**
Ligne 5: Ligne 7:
 Dernière mise-à-jour : ~~LASTMOD~~ Dernière mise-à-jour : ~~LASTMOD~~
  
-======LRF408 Sécurité Applicative======+======LDF408 Cryptologie======
  
-=====Contenu du Module=====+=====Contenu du module=====
  
-  * **LRF408 Sécurité Applicative** +  * **LDF408 Cryptologie** 
-    * Contenu du Module+    * Contenu du module
     * Le Problématique     * Le Problématique
-    * Préparation +    * LAB #1 - Utilisation de tcpdump 
-    * Les Outils +      * 1.1 - Utilisation 
-      * LAB #1 - Netwox +        * L'option -i 
-        * 1.1 - Installation +        * L'option -x 
-        * 1.2 Utilisation +        * L'option -X 
-        * 1.Avertissement important +        * L'option -w 
-      * LAB #2 - Greenbone Vulnerability Management (GVM) +        * L'option -v 
-        * 2.1 - Présentation +      * 1.Filtrage à l'écoute 
-        * 2.2 - Préparation +    * Les Contre-Mesures 
-        * 2.3 - Installation +      * Introduction à la cryptologie 
-        * 2.Configuration +        * Définitions 
-        * 2.- Utilisation +        * Algorithmes à clé secrète 
-        2.Analyse des Résultats +          * Le Chiffrement Symétrique 
-    Les Contres-Mesures +        * Algorithmes à clef publique 
-      * LAB #La commande chroot+          * Le Chiffrement Asymétrique 
 +          * La Clef de Session 
 +        * Fonctions de Hachage 
 +        * Signature Numérique 
 +        * PKI 
 +          * Certificats X509 
 +    * LAB #2 - Utilisation de GnuPG 
 +      * 2.1 - Présentation 
 +      * 2.2 - Installation 
 +      * 2.3 - Utilisation 
 +        * Signer un message 
 +        * Chiffrer un message 
 +    * LAB #3 - Mise en place de SSH et SCP 
 +      * 3.Introduction 
 +        * SSH-1 
 +        * SSH-2 
 +        * L'authentification par mot de passe 
 +        * L'authentification par clef asymétrique 
 +      * 3.2 - Configuration du Serveur 
 +      * 3.3 - Utilisation 
 + 3.Mise en place des clefs 
 +      3.5 Tunnels SSH 
 +      * 3.6 - SCP 
 +        * Introduction 
 +        * Utilisation 
 +    * LAB #Mise en place d'un VPN avec OpenVPN 
 +      * Présentation 
 +      * Configuration commune au client et au serveur 
 +      * Configuration du client 
 +      * Configuration du serveur 
 +      * Tests 
 +        * Du client vers le serveur 
 +        * Du serveur vers le client
  
 =====Le Problématique===== =====Le Problématique=====
  
-La plupart des failles de sécurité ne sont pas du fait du système d'exploitation mais des applications installées.+Le **sniffing** des paquets de données est possible sur un réseau utilisant une technologie de diffusion tel un réseau **Ethernet**. En effet certains protocoles ne cryptent pas les données avant de les envoyer dont :
  
-=====Préparation=====+  * Telnet, 
 +  * Rlogin, 
 +  * Ftp, 
 +  * Pop3.
  
-=====Les Outils=====+Un //sniffeur// est un logiciel qui captent les paquets circulant sur un réseau de type diffusion afin de les analyser. Le logiciel les plus utilisé est :
  
-==== LAB #1 - Netwox ====+  * Tcpdump.
  
-Le programme **netwox** est un utilitaire puissant de vérification de la sécurité. +=====LAB #1 - Utilisation de tcpdump=====
  
-===1.1 - Installation===+Le logiciel **tcpdump** sert à écouter le réseau en interceptant les paquets.
  
-Netwox s'installe en utilisant APT :+===1.1 - Utilisation===
  
-<code> +Installez **tcpdump** :
-root@debian12:~# cd /tmp +
- +
-root@debian12:/tmp# cd ~ +
- +
-root@debian12:~# apt install netwox -y +
-</code> +
- +
-===1.2 - Utilisation===+
  
 <code> <code>
-root@debian12:~# netwox +root@debian12:~# apt install tcpdump
-Netwox toolbox version 5.39.0. Netwib library version 5.39.0. +
- +
-######################## MAIN MENU ######################### +
- 0 - leave netwox +
- 3 - search tools +
- 4 - display help of one tool +
- 5 - run a tool selecting parameters on command line +
- 6 - run a tool selecting parameters from keyboard +
- a + information +
- b + network protocol +
- c + application protocol +
- d + sniff (capture network packets) +
- e + spoof (create and send packets) +
- f + record (file containing captured packets) +
- g + client +
- h + server +
- i + ping (check if a computer if reachable) +
- j + traceroute (obtain list of gateways) +
- k + scan (computer and port discovery) +
- l + network audit +
- m + brute force (check if passwords are weak) +
- n + remote administration +
- o + tools not related to network +
-Select a node (key in 03456abcdefghijklmno): +
 </code> </code>
  
-L'utilisation de **netwox** en mode interactif se fait a l'aide des menus proposés. Dans notre cas, nous souhaitons utiliser un des outils de la section **network audit**. Il convient donc de choisir le menu **l** :+==L'option -i==
  
-<code> +Pour écouter sur une **interface spécifique**, utilisez l'option **-i** :
-Select a node (key in 03456abcdefghijklmno): l +
- +
-###################### network audit ####################### +
- 0 - leave netwox +
- 1 - go to main menu +
- 2 - go to previous menu +
- 3 - search tools +
- 4 - display help of one tool +
- 5 - run a tool selecting parameters on command line +
- 6 - run a tool selecting parameters from keyboard +
- a + network audit using Ethernet +
- b + network audit using IP +
- c + network audit using TCP +
- d + network audit using ICMP +
- e + network audit using ARP +
-Select a node (key in 0123456abcde):  +
-</code> +
- +
-Choisissez ensuite le menu **c** :+
  
 <code> <code>
-Select a node (key in 0123456abcde)+root@debian12:~tcpdump -i ens18 -c 10 
- +tcpdump: verbose output suppressed, use -v[v]... for full protocol decode 
-################# network audit using TCP ################## +listening on ens18, link-type EN10MB (Ethernet), snapshot length 262144 bytes 
- leave netwox +17:29:37.411395 IP 10.0.2.46.ssh > 10.0.2.1.42252: Flags [P.], seq 119569853:119570041, ack 3811519177, win 501, options [nop,nop,TS val 3553055771 ecr 1647876767], length 188 
- go to main menu +17:29:37.411528 IP 10.0.2.1.42252 > 10.0.2.46.ssh: Flags [.], ack 188, win 10591, options [nop,nop,TS val 1647876791 ecr 3553055771], length 0 
- go to previous menu +17:29:37.493738 IP 10.0.2.46.36881 > dns.google.domain: 55995+ PTR? 1.2.0.10.in-addr.arpa. (39) 
- search tools +17:29:37.495598 IP dns.google.domain > 10.0.2.46.36881: 55995 NXDomain 0/0/0 (39) 
- 4 - display help of one tool +17:29:37.495837 IP 10.0.2.46.33051 > dns.google.domain: 43187+ PTR? 46.2.0.10.in-addr.arpa. (40) 
- 5 - run a tool selecting parameters on command line +17:29:37.497464 IP dns.google.domain > 10.0.2.46.33051: 43187 NXDomain 0/0/0 (40) 
- run a tool selecting parameters from keyboard +17:29:37.497758 IP 10.0.2.46.ssh > 10.0.2.1.42252: Flags [P.], seq 188:536, ack 1, win 501, options [nop,nop,TS val 3553055857 ecr 1647876791], length 348 
- a - 76:Synflood +17:29:37.497891 IP 10.0.2.1.42252 > 10.0.2.46.ssh: Flags [.], ack 536, win 10591, options [nop,nop,TS val 1647876877 ecr 3553055857], length 0 
- 77:Check if seqnum are predictible +17:29:37.597097 IP 10.0.2.46.52033 > dns.google.domain: 12468+ PTR? 8.8.8.8.in-addr.arpa. (38) 
- c - 78:Reset every TCP packet +17:29:37.598847 IP dns.google.domain > 10.0.2.46.52033: 12468 1/0/0 PTR dns.google. (62) 
- d - 79:Acknowledge every TCP SYN +10 packets captured 
-Select a node (key in 0123456abcd): +14 packets received by filter 
 +0 packets dropped by kernel
 </code> </code>
  
-Notre choix de test s'arrête sur un test du type **Synflood** sur un de nos serveurs internes. Nous choisissons donc le menu **a** :+Notez qu'à la fin, un résumé vous est présenté, par exemple :
  
 <code> <code>
-Select a node (key in 0123456abcd):+... 
- +10 packets captured 
-################# help for tool number 76 ################## +14 packets received by filter 
-Title: Synflood +packets dropped by kernel
-+------------------------------------------------------------------------+ +
-| This tool sends a lot of TCP SYN packets                             | +
-| It permits to check how a firewall behaves when receiving packets      | +
-| which have to be ignored                                             | +
-| Parameter --spoofip indicates how to generate link layer for spoofing| +
-| Values 'best', 'link' or 'raw' are common choices for --spoofip. Here  | +
-| is the list of accepted values:                                        | +
-|  - 'raw' means to spoof at IP4/IP6 level (it uses system IP stack). If | +
-|    a firewall is installed, or on some systems, this might not work.   | +
-|  - 'linkf' means to spoof at link level (currently, only Ethernet is   | +
-|    supported). The 'f' means to Fill source Ethernet address.          | +
-|    However, if source IP address is spoofed, it might be impossible    | +
-|    to Fill it. So, linkf will not work: use linkb or linkfb instead.   | +
-|  - 'linkb' means to spoof at link level. The 'b' means to left a Blank | +
-|    source Ethernet address (0:0:0:0:0:0, do not try to Fill it).       | +
-|  - 'linkfb' means to spoof at link level. The 'f' means to try to Fill | +
-|    source Ethernet address, but if it is not possible, it is left      | +
-|    Blank.                                                              | +
-|  - 'rawlinkf' means to try 'raw', then try 'linkf'                     | +
-|  - 'rawlinkb' means to try 'raw', then try 'linkb'                     | +
-|  - 'rawlinkfb' means to try 'raw', then try 'linkfb'                   | +
-|  - 'linkfraw' means to try 'linkf', then try 'raw'                     | +
-|  - 'linkbraw' means to try 'linkb', then try 'raw'                     | +
-|  - 'linkfbraw' means to try 'linkfb', then try 'raw'                   | +
-|  - 'link' is an alias for 'linkfb'                                     | +
-|  - 'rawlink' is an alias for 'rawlinkfb'                               | +
-|  - 'linkraw' is an alias for 'linkfbraw'                               | +
-|  - 'best' is an alias for 'linkraw'. It should work in all cases.      | +
-|                                                                        | +
-| This tool may need to be run with admin privilege in order to spoof.   | +
-+------------------------------------------------------------------------+ +
-Usage: netwox 76 -i ip -p port [-s spoofip] +
-Parameters: +
- -i|--dst-ip ip                 destination IP address {5.6.7.8} +
- -p|--dst-port port             destination port number {80} +
- -s|--spoofip spoofip           IP spoof initialization type {linkbraw} +
-Example: netwox 76 -i "5.6.7.8" -p "80" +
-Example: netwox 76 --dst-ip "5.6.7.8" --dst-port "80" +
-Press 'r' or 'k' to run this tool, or any other key to continue +
 </code> </code>
  
-Il convient ensuite d'appuyer sur la touche [r] ou [k] pour lancer l'utilitaire.+<WRAP center round important> 
 +**Important** : L'option **-c** limite le nombre de paquets capturés. 
 +</WRAP>
  
-Il est a noter que **netwox**  peut être utilisé sans faire appel au menus interactifs, à condition de connaître le numéro **netwox** du test à lancer:+==L'option -x==
  
-  # netwox 76 -i "10.0.2.3" -p "80" +Pour écouter sur une interface spécifique et voir le contenu en Hexadécimalutilisez les options -i et **-x** :
- +
-===1.3 - Avertissement important=== +
- +
-**netwox** est un outil puissant. Il convient de noter que: +
- +
-  * il ne doit pas être installé sur un serveur de production mais sur le poste de l'administrateur, +
-  * netwox existe aussi en version Windows(tm), +
-  * l'utilisation de netwox à des fins autres que de test est interdite. +
- +
-====LAB #2 Greenbone Vulnerability Management (GVM)==== +
- +
-===2.1 - Présentation=== +
- +
-**Greenbone Vulnerability Management (GVM)**, aussi connu sous le nom d'**OpenVAS**, est le successeur libre du scanner **Nessus**, devenu propriétaire. GVM, tout comme Nessus, est un scanner de vulnérabilité qui balaie un hôte ou une plage d'hôtes pour essayer de détecter des failles de sécurité.  +
- +
-===2.2 Préparation=== +
- +
-Mettez SELinux en mode permissive et désactivez-le dans le fichier **/etc/selinux/config** :+
  
 <code> <code>
-[root@centos7 ~]setenforce permissive +root@debian12:~# tcpdump -i ens18 -x -c 3 
- +tcpdump: verbose output suppressed, use -v[v]... for full protocol decode 
-[root@centos7 ~]# sed -i 's/=enforcing/=disabled/' /etc/selinux/config +listening on ens18, link-type EN10MB (Ethernet), snapshot length 262144 bytes 
- +17:27:24.043320 IP 10.0.2.46.ssh > 10.0.2.1.42252: Flags [P.], seq 119567701:119567889, ack 3811519061, win 501, options [nop,nop,TS val 3552922403 ecr 1647743397], length 188 
-[root@centos7 ~]# reboot+        0x0000:  4510 00f0 84b8 4000 4006 9d11 0a00 022e 
 +        0x0010:  0a00 0201 0016 a50c 0720 7555 e32f 2a55 
 +        0x0020:  8018 01f5 1911 0000 0101 080a d3c5 4b23 
 +        0x0030:  6236 91a5 0000 00b0 77fb cb1f c046 bb66 
 +        0x0040:  c32f 923b a994 d49b f063 5539 130e 764b 
 +        0x0050:  06fe b5be f2d1 7cee ef79 8d3e ec6e 1e7f 
 +        0x0060:  c296 1fbf f4e8 67b0 f16d 5d98 1963 424c 
 +        0x0070:  f6de 9287 5dbe 98c0 2b95 05cb 37f3 a653 
 +        0x0080:  dbff 81a1 d03f c288 bbaf 4756 41be 64ea 
 +        0x0090:  706a 55ff 8322 e32e ea56 2e60 5210 43e6 
 +        0x00a0:  9eec 5bb1 e519 1936 4ee7 809b 6a18 675e 
 +        0x00b0:  29b7 de38 921d a543 4ca7 7132 ff0f e399 
 +        0x00c0:  5338 304d 03a3 beed ddbe 4530 cb71 fea2 
 +        0x00d0:  618b b56d b45c 9ab6 9b71 563e 058d de9a 
 +        0x00e0:  d249 d57e 7a53 f6b5 7bf6 5924 46f0 6c74 
 +17:27:24.043485 IP 10.0.2.1.42252 > 10.0.2.46.ssh: Flags [.], ack 188, win 10548, options [nop,nop,TS val 1647743423 ecr 3552922403], length 0 
 +        0x0000:  4510 0034 41fb 4000 4006 e08a 0a00 0201 
 +        0x0010:  0a00 022e a50c 0016 e32f 2a55 0720 7611 
 +        0x0020:  8010 2934 1855 0000 0101 080a 6236 91bf 
 +        0x0030:  d3c5 4b23 
 +17:27:24.125464 IP 10.0.2.46.42246 > dns.google.domain: 35092+ PTR? 1.2.0.10.in-addr.arpa. (39) 
 +        0x0000:  4500 0043 3869 4000 4011 e603 0a00 022e 
 +        0x0010:  0808 0808 a506 0035 002f 1c7e 8914 0100 
 +        0x0020:  0001 0000 0000 0000 0131 0132 0130 0231 
 +        0x0030:  3007 696e 2d61 6464 7204 6172 7061 0000 
 +        0x0040:  0c00 01 
 +3 packets captured 
 +10 packets received by filter 
 +0 packets dropped by kernel
 </code> </code>
  
-Insérez une règle dans le pare-feu pour permettre la consultation de l'interface HTML du client OpenVAS :+==L'option -X==
  
-<code> +Pour écouter sur une interface spécifique et voir le contenu en Hexadécimal et en ASCII, utilisez les options -et **-X** :
-[root@centos7 ~]# firewall-cmd --zone=public --add-port=9443/tcp --permanent +
-success +
-[root@centos7 ~]# firewall-cmd --reload +
-success +
-</code> +
- +
-===2.3 - Installation=== +
- +
-Téléchargez et installez **epel-release-7-14.noarch.rpm** :+
  
 <code> <code>
-[root@centos7 ~]wget https://archives.fedoraproject.org/pub/archive/epel/7/x86_64/Packages/e/epel-release-7-14.noarch.rpm +root@debian12:~# tcpdump -i ens18 --c 3 
---2025-12-01 15:29:01--  https://archives.fedoraproject.org/pub/archive/epel/7/x86_64/Packages/e/epel-release-7-14.noarch.rpm +tcpdump: verbose output suppressed, use -v[v]... for full protocol decode 
-Resolving archives.fedoraproject.org (archives.fedoraproject.org)... 38.145.32.23, 38.145.32.22, 38.145.32.24 +listening on ens18, link-type EN10MB (Ethernet), snapshot length 262144 bytes 
-Connecting to archives.fedoraproject.org (archives.fedoraproject.org)|38.145.32.23|:443... connected+13:07:32.922306 IP 10.0.2.46.ssh > 10.0.2.1.42252: Flags [P.], seq 119572449:119572637, ack 3811519901, win 501, options [nop,nop,TS val 3553115863 ecr 1647936856], length 188 
-HTTP request sent, awaiting response... 200 OK +        0x0000:  4510 00f0 84d9 4000 4006 9cf0 0a00 022e  E.....@.@....... 
-Length15608 (15K) [application/x-rpm] +        0x0010 0a00 0201 0016 a50c 0720 87e1 e32f 2d9d  ............./-. 
-Saving to‘epel-release-7-14.noarch.rpm’ +        0x0020:  8018 01f5 1911 0000 0101 080a d3c8 3ed7  ..............>
- +        0x0030:  6239 8558 0000 00b0 daef 47be bc64 8630  b9.X......G..d.
-100%[========================================================================================================================================================================>] 15,608      --.-K/s   in 0.03s    +        0x0040:  968c 107d ba16 f8fb 45db 05ff e566 a1af  ...}....E....f.. 
- +        0x0050:  728f e777 583b 64ac 09a6 f099 c570 ad4f  r..wX;d......p.O 
-2025-12-01 15:29:01 (532 KB/s- ‘epel-release-7-14.noarch.rpm’ saved [15608/15608] +        0x0060 17d1 afa8 dbb3 1d59 122a 3e9d e4be 07f7  .......Y.*>..... 
- +        0x0070:  7b85 75fc 49f4 e0fe 37ab f924 acc6 4f43  {.u.I...7..$..OC 
-[root@centos7 ~]# yum localinstall epel-release-7-14.noarch.rpm --nogpgcheck+        0x0080 6231 f469 e3b2 ebb9 e9a4 6bfb cd89 66e2  b1.i......k...f. 
 +        0x0090:  9fda ccf9 39ad 272a f373 167e 13e2 b56c  ....9.'*.s.~...l 
 +        0x00a0:  3625 f2e2 7898 d061 6191 d5c4 a268 b1e0  6%..x..aa....h.. 
 +        0x00b0 1f4a a1f9 e319 18c9 e55a b700 e281 1f71  .J.......Z.....q 
 +        0x00c0:  06fb 4e11 1145 23e2 a194 d91c 8e22 f8ef  ..N..E#......".. 
 +        0x00d0:  5e96 6e34 f24f 1b67 754b 4c7e 5e51 a2cf  ^.n4.O.guKL~^Q.. 
 +        0x00e0:  e2ed c5bb 409e eae3 c905 54ab cfc2 5a55  ....@.....T...ZU 
 +13:07:32.922462 IP 10.0.2.1.42252 10.0.2.46.ssh: Flags [.], ack 188, win 10611, options [nop,nop,TS val 1647936883 ecr 3553115863], length 0 
 +        0x0000:  4510 0034 4232 4000 4006 e053 0a00 0201  E..4B2@.@..S.... 
 +        0x0010:  0a00 022e a50c 0016 e32f 2d9d 0720 889d  ........./-..... 
 +        0x0020:  8010 2973 1855 0000 0101 080a 6239 8573  ..)s.U......b9.s 
 +        0x0030:  d3c8 3ed7                                ..>. 
 +13:07:33.008324 IP 10.0.2.46.47533 > dns.google.domain: 49115+ PTR? 1.2.0.10.in-addr.arpa. (39) 
 +        0x0000:  4500 0043 2e6b 4000 4011 f001 0a00 022e  E..C.k@.@....... 
 +        0x0010:  0808 0808 b9ad 0035 002f 1c7e bfdb 0100  .......5./.~.... 
 +        0x0020:  0001 0000 0000 0000 0131 0132 0130 0231  .........1.2.0.1 
 +        0x0030:  3007 696e 2d61 6464 7204 6172 7061 0000  0.in-addr.arpa.
 +        0x0040:  0c00 01                                  ... 
 +3 packets captured 
 +10 packets received by filter 
 +0 packets dropped by kernel
 </code> </code>
  
-Installez ensuite **openvas-scanner**, **openvas-manager**, **openvas-gsa** et **openvas-cli** en utilisant yum :+==L'option -w==
  
-<code> +Pour écouter sur une interface spécifique et envoyer la sortie dans un fichier, utilisez les options -i et **-w** et patientez 5 minutes :
-[root@centos7 ~]# yum install openvas-scanner openvas-manager openvas-gsa openvas-cli coreutils openssl +
-</code> +
- +
-===2.4 - Configuration=== +
- +
-Les commandes d'OpenVAS sont les suivantes :+
  
 <code> <code>
-[root@centos7 ~]# ls -l /usr/sbin/openvas* +root@debian12:~# tcpdump -i ens18 -w log.dump 
--rwxr-xr-x. 1 root root   18066 Sep  6  2016 /usr/sbin/openvas-certdata-sync +tcpdumplistening on ens18, link-type EN10MB (Ethernet), snapshot length 262144 bytes 
--rwxr-xr-x. 1 root root 2182496 Sep  6  2016 /usr/sbin/openvasmd +^C42 packets captured 
--rwxr-xr-x. 1 root root   37993 Sep  6  2016 /usr/sbin/openvas-migrate-to-postgres +45 packets received by filter 
--rwxr-xr-x. 1 root root   11998 Sep  6  2016 /usr/sbin/openvas-mkcert +packets dropped by kernel
--rwxr-xr-x. 1 root root   10976 Sep  6  2016 /usr/sbin/openvas-nvt-sync +
--rwxr-xr-x. 1 root root     766 Sep  6  2016 /usr/sbin/openvas-nvt-sync-cron +
--rwxr-xr-x. 1 root root    2555 Sep  6  2016 /usr/sbin/openvas-portnames-update +
--rwxr-xr-x. 1 root root   38378 Sep  6  2016 /usr/sbin/openvas-scapdata-sync +
--rwxr-xr-x. 1 root root   86640 Sep  6  2016 /usr/sbin/openvassd +
-</code> +
- +
-  * **/usr/sbin/openvas-mkcert**, +
-    * Cette commande permet de générer un certificat SSL, +
-  * **/usr/sbin/openvas-nvt-sync**, +
-    * Cette commande permet la mise à jour des modules d'extensions de OpenVAS, +
-  * **/usr/sbin/openvasd**, +
-    * Cette commande lance le serveur OpenVAS. +
- +
-Exécutez maintenant la commande **openvas-check-setup** : +
- +
-<code> +
-[root@centos7 ~]openvas-check-setup  +
-openvas-check-setup 2.3.3 +
-  Test completeness and readiness of OpenVAS-8 +
-  (add '--v6' or '--v7' or '--v9' +
-   if you want to check for another OpenVAS version) +
- +
-  Please report us any non-detected problems and +
-  help us to improve this check routine: +
-  http://lists.wald.intevation.org/mailman/listinfo/openvas-discuss +
- +
-  Send us the log-file (/tmp/openvas-check-setup.logto help analyze the problem. +
- +
-  Use the parameter --server to skip checks for client tools +
-  like GSD and OpenVAS-CLI. +
- +
-Step 1: Checking OpenVAS Scanner ...  +
-        OK: OpenVAS Scanner is present in version 5.0.6. +
-        ERROR: No CA certificate file of OpenVAS Scanner found. +
-        FIX: Run 'openvas-mkcert'+
- +
- ERROR: Your OpenVAS-8 installation is not yet complete! +
- +
-Please follow the instructions marked with FIX above and run this +
-script again.+
  
-If you think this result is wrong, please report your observation +root@debian12:~# ls -l log.dump 
-and help us to improve this check routine: +-rw-r--r-- 1 tcpdump tcpdump 25555 Nov 28 13:11 log.dump
-http://lists.wald.intevation.org/mailman/listinfo/openvas-discuss +
-Please attach the log-file (/tmp/openvas-check-setup.log) to help us analyze the problem.+
 </code> </code>
  
 <WRAP center round important 50%> <WRAP center round important 50%>
-**Important** - Notez l'erreur **ERROR: No CA certificate file of OpenVAS Scanner found.**+**Important** - Arrêtez la sortie de la commande à l'aide des touches **^C**.
 </WRAP> </WRAP>
  
-Créez donc un certificat SSL :+Notez que le fichier log.dump est au format **libpcap** et non au format texte. Il est donc inutile d'essayer de lire son contenu avec une commande telle **cat** :
  
 <code> <code>
-[root@centos7 ~]openvas-mkcert+root@debian12:~# file log.dump 
 +log.dump: pcap capture file, microsecond ts (little-endian) - version 2.4 (Ethernet, capture length 262144) 
 +</code>
  
-------------------------------------------------------------------------------- +==L'option -v==
- Creation of the OpenVAS SSL Certificate +
--------------------------------------------------------------------------------+
  
-This script will now ask you the relevant information to create the SSL certificate of OpenVAS. +Tcpdump peut être utilisé avec un de trois modes verbose.
-Note that this information will *NOT* be sent to anybody (everything stays local), but anyone with the ability to connect to your OpenVAS daemon will be able to retrieve this information.+
  
 +^ Mode ^ Option ^
 +| Light verbose | -v |
 +| Medium verbose | -vv |
 +| Full verbose | -vvv |
  
-CA certificate life time in days [1460]3650 +<code> 
-Server certificate life time in days [365]3650 +root@debian12:~# tcpdump -i ens18 -v -c 3 
-Your country (two letter code) [DE]: UK +tcpdumplistening on ens18, link-type EN10MB (Ethernet), snapshot length 262144 bytes 
-Your state or province name [none]: SURREY +13:13:22.869956 IP (tos 0x10, ttl 64, id 34138, offset 0, flags [DF], proto TCP (6), length 176) 
-Your location (e.g. town) [Berlin]: ADDLESTONE +    10.0.2.46.ssh > 10.0.2.1.42252Flags [P.], cksum 0x18d1 (incorrect -> 0x3397), seq 119580817:119580941, ack 3811523793, win 501, options [nop,nop,TS val 3553465811 ecr 1648286807], length 124 
-Your organization [OpenVAS Users United]: I2TCH LIMITED +13:13:22.870085 IP (tos 0x10, ttl 64, id 17171, offset 0, flags [DF], proto TCP (6), length 52) 
- +    10.0.2.1.42252 > 10.0.2.46.sshFlags [.], cksum 0x1855 (incorrect -> 0x174a), ack 124, win 10660, options [nop,nop,TS val 1648286831 ecr 3553465811], length 0 
-------------------------------------------------------------------------------- +13:13:22.951837 IP (tos 0x10, ttl 64, id 34139, offset 0, flags [DF], proto TCP (6), length 176) 
- Creation of the OpenVAS SSL Certificate +    10.0.2.46.ssh > 10.0.2.1.42252: Flags [P.], cksum 0x18d1 (incorrect -> 0x5f7e), seq 124:248, ack 1, win 501, options [nop,nop,TS val 3553465893 ecr 1648286831], length 124 
-------------------------------------------------------------------------------- +3 packets captured 
- +10 packets received by filter 
-CongratulationsYour server certificate was properly created. +0 packets dropped by kernel
- +
-The following files were created: +
- +
-Certification authority: +
-   Certificate = /etc/pki/openvas/CA/cacert.pem +
-   Private key = /etc/pki/openvas/private/CA/cakey.pem +
- +
-OpenVAS Server :  +
-    Certificate = /etc/pki/openvas/CA/servercert.pem +
-    Private key = /etc/pki/openvas/private/CA/serverkey.pem +
- +
-Press [ENTERto exit +
- +
-[Entrée+
-[root@centos7 ~]# +
 </code> </code>
  
-Exécutez de nouveau la commande **openvas-check-setup** :+===1.2 Filtrage à l'écoute===
  
-<code> +Tcpdump peut effectuer du filtrage lors de l'écoute.
-[root@centos7 ~]# openvas-check-setup  +
-openvas-check-setup 2.3.3 +
-  Test completeness and readiness of OpenVAS-8 +
-  (add '--v6' or '--v7' or '--v9' +
-   if you want to check for another OpenVAS version)+
  
-  Please report us any non-detected problems and +Pour uniquement écouter les paquets en provenance de l'adresse IP 192.168.1.11, utilisez la condition **src host** :
-  help us to improve this check routine: +
-  http://lists.wald.intevation.org/mailman/listinfo/openvas-discuss+
  
-  Send us the log-file (/tmp/openvas-check-setup.log) to help analyze the problem.+  # tcpdump src host 192.168.1.11 [Entrée]
  
-  Use the parameter --server to skip checks for client tools +Pour uniquement écouter les paquets en provenance de l'adresse IP 192.168.1.11 et vers l'adresse 192.168.1.2, utilisez les conditions src host et **dst host** :
-  like GSD and OpenVAS-CLI.+
  
-Step 1: Checking OpenVAS Scanner ...  +  # tcpdump src host 192.168.1.11 and dst host 192.168.1.2 [Entrée]
-        OK: OpenVAS Scanner is present in version 5.0.6. +
-        OK: OpenVAS Scanner CA Certificate is present as /etc/pki/openvas/CA/cacert.pem. +
-/bin/openvas-check-setup: line 219: redis-server: command not found +
-        ERROR: No redis-server installation found. +
-        FIX: You should install redis-server for improved scalability and ability to trace/debug the KB+
  
- ERRORYour OpenVAS-8 installation is not yet complete!+Pour uniquement écouter les paquets d'un port précis, utilisez la condition **port** :
  
-Please follow the instructions marked with FIX above and run this +  # tcpdump -i eth0 port 80 [Entrée]
-script again.+
  
-If you think this result is wrongplease report your observation +Pour uniquement écouter les paquets d'un protocole précisutilisez une condition telle **ip**, **icmp**, **arp**, **rarp**, **udp** ou **tcp**:
-and help us to improve this check routine: +
-http://lists.wald.intevation.org/mailman/listinfo/openvas-discuss +
-Please attach the log-file (/tmp/openvas-check-setup.log) to help us analyze the problem. +
-</code>+
  
-<WRAP center round important 50%> +  # tcpdump -i eth0 udp [Entrée]
-**Important** Notez l'erreur **ERROR: No redis-server installation found.** +
-</WRAP>+
  
-Installez donc **redis** :+Pour uniquement écouter les paquets d'une taille inférieure à 100 octets, utilisez la condition **less** :
  
-<code> +  # tcpdump -i eth0 less 100 [Entrée]
-[root@centos7 ~]# yum install redis +
-</code>+
  
-Activez les deux lignes suivantes dans le fichier **/etc/redis.conf** :+Pour uniquement écouter les paquets d'une taille supérieure à 100 octets, utilisez la condition **great** :
  
-<file> +  tcpdump -i eth0 greater 100 [Entrée]
-... +
-unixsocket /tmp/redis.sock +
-# unixsocketperm 700... +
-</file>+
  
-<code> +L'utilisation des ses options et conditions peut être combinée pour donner des commandes telles :
-[root@centos7 ~]# sed -i '/^#.*unixsocket/s/^# //' /etc/redis.conf +
-</code>+
  
-Ajoutez la ligne **kb_location = /tmp/redis.sock** dans le fichier **/etc/openvas/openvassd.conf** :+  # tcpdump -i eth0 -X src host 192.168.1.11 and dst host 192.168.1.2 and port 21 and ftp [Entrée]
  
-<file> +===Options de la commande===
-... +
-# KB test replay : +
-kb_dont_replay_scanners no +
-kb_dont_replay_info_gathering no +
-kb_dont_replay_attacks no +
-kb_dont_replay_denials no +
-kb_max_age 864000 +
-kb_location /tmp/redis.sock +
-#--- end of the KB section +
-... +
-</file>+
  
-Activez et démarrez le service **redis** :+Les options de cette commande sont :
  
 <code> <code>
-[root@centos7 ~]systemctl enable redis +root@debian12:~# tcpdump --help 
-Created symlink from /etc/systemd/system/multi-user.target.wants/redis.service to /usr/lib/systemd/system/redis.service+tcpdump version 4.99.
-[root@centos7 ~]systemctl start redis +libpcap version 1.10.3 (with TPACKET_V3) 
-[root@centos7 ~]# systemctl status redis +OpenSSL 3.0.17 1 Jul 2025 
-● redis.service Redis persistent key-value database +Usage: tcpdump [-AbdDefhHIJKlLnNOpqStuUvxX#-B size -c count ] [--count] 
-   Loaded: loaded (/usr/lib/systemd/system/redis.service; enabled; vendor presetdisabled) +                [ -C file_size ] [ -E algo:secret ] [ -F file ] [ -G seconds ] 
-  Drop-In: /etc/systemd/system/redis.service.d +                -i interface ] [ --immediate-mode ] [ -j tstamptype ] 
-           └─limit.conf +                -M secret ] [ --number ] [ --print ] [ -Q in|out|inout ] 
-   Active: active (running) since Mon 2025-12-01 15:45:16 CET; 3s ago +                -r file ] [ -s snaplen ] [ -T type ] [ --version ] 
- Main PID: 13037 (redis-server) +                -V file ] [ -w file ] [ -W filecount ] [ -y datalinktype ] 
-   CGroup: /system.slice/redis.service +                --time-stamp-precision precision --micro ] [ --nano ] 
-           └─13037 /usr/bin/redis-server 127.0.0.1:6379 +                -z postrotate-command -Z user ] [ expression ]
- +
-Dec 01 15:45:16 centos7.fenestros.loc systemd[1]: Starting Redis persistent key-value database... +
-Dec 01 15:45:16 centos7.fenestros.loc systemd[1]: Started Redis persistent key-value database.+
 </code> </code>
  
-Exécutez encore une fois la commande **openvas-check-setup** :+=====Les Contre-Mesures=====
  
-<code> +Les contre-mesures incluent l'utilisation du chiffrement sous la forme de SSH, de SCP et d'OpenVPN.
-[root@centos7 ~]# openvas-check-setup +
-... +
-Step 1: Checking OpenVAS Scanner ...  +
-        OK: OpenVAS Scanner is present in version 5.0.6. +
-        OK: OpenVAS Scanner CA Certificate is present as /etc/pki/openvas/CA/cacert.pem. +
-        OK: redis-server is present in version v=3.2.10. +
-        OK: scanner (kb_location setting) is configured properly using the redis-server socket: /tmp/redis.sock +
-        OK: redis-server is running and listening on socket: /tmp/redis.sock. +
-        OK: redis-server configuration is OK and redis-server is running. +
-        ERROR: The NVT collection is very small. +
-        FIX: Run a synchronization script like openvas-nvt-sync or greenbone-nvt-sync. +
-... +
-</code>+
  
-<WRAP center round important 50%> +====Introduction à la cryptologie====
-**Important** - Notez l'erreur **ERROR: The NVT collection is very small.** +
-</WRAP>+
  
-Téléchargez le script **greenbone-nvt-sync** :+===Définitions===
  
-<code> +  * **La Cryptologie** 
-[root@centos7 ~]# wget https://www.dropbox.com/scl/fi/10hf8fpdq2yhd821qb5pk/greenbone-nvt-sync?rlkey=7f4taliexlpg54pa1c1yz8czx&st=tkvnjg55+    * La science qui étudie les aspects scientifiques de ces techniques, c'est-à-dire qu'elle englobe la cryptographie et la cryptanalyse 
 +  * **La Cryptanalyse** 
 +    * Lorsque la clef de déchiffrement n'est pas connue de l'attaquant on parle alors de cryptanalyse ou cryptoanalyse (on entend souvent aussi le terme plus familier de cassage). 
 +  * **La Cryptographie** 
 +    * Un terme générique désignant l'ensemble des techniques permettant de chiffrer des messages, c'est-à-dire permettant de les rendre inintelligibles sans une action spécifique. Les verbes crypter et chiffrer sont utilisés. 
 +  * **Le Décryptement ou Décryptage** 
 +    * Est le fait d'essayer de déchiffrer illégitimement le message (que la clé de déchiffrement soit connue ou non de l'attaquant).
  
-[root@centos7 ~]# mv greenbone-nvt-sync?rlkey=7f4taliexlpg54pa1c1yz8czx greenbone-nvt-sync +{{ :redhat:lx04:crypto1.gif|Cette image issue de Comment Ça Marche (www.commentcamarche.net) est mise à disposition sous les termes de la licence Creative Commons. Vous pouvez copier, modifier des copies de l'image, dans les conditions fixées par la licence, tant que cette note apparaît clairement. }}
-</code>+
  
-Si vous ne pouvez pas téléchargez le script **greenbone-nvt-sync**, copiez son contenu ci-dessous et créez-le :+**La Cryptographie**
  
-<code> +La cryptographie apporte quatre points clefs
-[root@centos7 ~]# vi greenbone-nvt-sync +
-[root@centos7 ~]# cat greenbone-nvt-sync +
-#!/bin/sh +
-# Copyright (C) 2009-2021 Greenbone Networks GmbH +
-+
-# SPDX-License-IdentifierGPL-2.0-or-later +
-+
-# This program is free software; you can redistribute it and/or +
-# modify it under the terms of the GNU General Public License +
-# as published by the Free Software Foundation; either version 2 +
-# of the License, or (at your option) any later version. +
-+
-# This program is distributed in the hope that it will be useful, +
-# but WITHOUT ANY WARRANTY; without even the implied warranty of +
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the +
-# GNU General Public License for more details. +
-+
-# You should have received a copy of the GNU General Public License +
-# along with this program; if not, write to the Free Software +
-# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.+
  
-# This script updates the local Network Vulnerability Tests (NVTs) from the +  * La confidentialité 
-# Greenbone Security Feed (GSF) or the Greenbone Community Feed (GCF). +    * consiste à rendre l'information inintelligible à d'autres personnes que les acteurs de la transaction. 
 +  * L'intégrité 
 +    * consiste à déterminer si les données n'ont pas été altérées durant la communication (de manière fortuite ou intentionnelle)
 +  * L'authentification 
 +    * consiste à assurer l'identité d'un utilisateur. 
 +  * La non-répudiation 
 +    * est la garantie qu'aucun des correspondants ne pourra nier la transaction
  
-VERSION=@OPENVAS_VERSION@+La cryptographie est basée sur l'arithmétique. Il s'agit, dans le cas d'un texte, de transformer les lettres qui composent le message en une succession de chiffres (sous forme de bits dans le cas de l'informatique), puis ensuite de faire des calculs sur ces chiffres pour:
  
-# SETTINGS +  * Procéder au chiffrement 
-# ========+    * Le résultat de cette modification (le message chiffré) est appelé cryptogramme (Ciphertext) par opposition au message initial, appelé message en clair (Plaintext) 
 +  * Procéder au déchiffrement
  
-# PRIVATE_SUBDIR defines a subdirectory of the NVT directory that is excluded +Le chiffrement se fait à l'aide d'une clef de chiffrementLe déchiffrement nécessite  une clef de déchiffrement.
-# from the feed syncThis is where to place your own NVTs. +
-if [ -z "$PRIVATE_SUBDIR"+
-then +
-  PRIVATE_SUBDIR="private" +
-fi+
  
-# RSYNC_DELETE controls whether files which are not part of the repository will +On distingue deux types de clefs:
-# be removed from the local directory after synchronization. The default value +
-# for this setting is +
-# "--delete --exclude \"$PRIVATE_SUBDIR/\"", +
-# which means that files which are not part of the feed or private directory +
-# will be deleted. +
-RSYNC_DELETE="--delete --exclude $PRIVATE_SUBDIR/"+
  
-# RSYNC_SSH_OPTS contains options which should be passed to ssh for the rsync +  * Les clés symétriques:  
-# connection to the repository+    * des clés utilisées pour le chiffrement ainsi que pour le déchiffrement. On parle alors de chiffrement symétrique ou de chiffrement à clé secrète
-RSYNC_SSH_OPTS="-o \"UserKnownHostsFile=/dev/null\" -o \"StrictHostKeyChecking=no\""+  * Les clés asymétriques:  
 +    * des clés utilisées dans le cas du chiffrement asymétrique (aussi appelé chiffrement à clé publique). Dans ce cas, une clé différente est utilisée pour le chiffrement et pour le déchiffrement.
  
-# RSYNC_COMPRESS specifies the compression level to use for the rsync connection. +**Le Chiffrement par Substitution** 
-RSYNC_COMPRESS="--compress-level=9"+  
 +Le chiffrement par substitution consiste à remplacer dans un message une ou plusieurs entités (généralement des lettres) par une ou plusieurs autres entités. On distingue généralement plusieurs types de cryptosystèmes par substitution :
  
-# RSYNC_CHMOD specifies the permissions to chmod the files to. +  * La substitution **monoalphabétique** 
-RSYNC_CHMOD="--perms --chmod=Fugo+r,Fug+w,Dugo-s,Dugo+rx,Dug+w"+    * consiste à remplacer chaque lettre du message par une autre lettre de l'alphabet 
 +  * La substitution **polyalphabétique**  
 +    * consiste à utiliser une suite de chiffres monoalphabétique réutilisée périodiquement 
 +  * La substitution **homophonique**  
 +    * permet de faire correspondre à chaque lettre du message en clair un ensemble possible d'autres caractères 
 +  * La substitution de **polygrammes**   
 +    * consiste à substituer un groupe de caractères (polygramme) dans le message par un autre groupe de caractères
  
-# Verbosity flag for rsync. "-q" means a quiet rsync, "-v" a verbose rsync. +===Algorithmes à clé secrète===
-RSYNC_VERBOSE="-q"+
  
-# RSYNC_OPTIONS controls the general parameters for the rsync connection. +==Le Chiffrement Symétrique==
-RSYNC_OPTIONS="--links --times --omit-dir-times $RSYNC_VERBOSE --recursive --partial --progress"+
  
-# Script and feed information which will be made available to user through +Ce système est aussi appelé le système à **Clef Secrète** ou à **clef privée**.
-# command line options and automated tools. +
-# Script name which will be used for logging +
-SCRIPT_NAME="greenbone-nvt-sync"+
  
-# Result of selftest () is stored here. If it is not 0the selftest has failed +Ce système consiste à effectuer une opération de chiffrement par algorithme mais comporte un inconvénientà savoir qu'il nécessite un canal sécurisé pour la transmission de la clef de chiffrement/déchiffrement.
-# and the sync script is unlikely to work. +
-SELFTEST_FAIL=0+
  
-# Port to use for synchronizationDefault value is 24. +{{:redhat:lx04:crypto2.gif|Cette image issue de Comment Ça Marche (www.commentcamarche.net) est mise à disposition sous les termes de la licence Creative Commons. Vous pouvez copier, modifier des copies de l'image, dans les conditions fixées par la licence, tant que cette note apparaît clairement.}}
-PORT=24+
  
-# Directory where the OpenVAS configuration is located +<WRAP center round important 50%> 
-OPENVAS_SYSCONF_DIR="@OPENVAS_SYSCONF_DIR@"+**Important** - Le système de Méthode du Masque Jetable (One Time Pad) fût mis au point dans les années 1920. Il utilisait une clef générée aléatoirement à usage unique. 
 +</WRAP>
  
-# Directory where the feed update lock file will be placed. +Les algorithmes de chiffrement symétrique couramment utilisés en informatique sont:
-OPENVAS_FEED_LOCK_PATH="@OPENVAS_FEED_LOCK_PATH@"+
  
-# Location of the GSF Access Key +  * **[[wpfr>Data_Encryption_Standard|Data Encryption Standard]]** (DES), 
-ACCESS_KEY="@GVM_ACCESS_KEY_DIR@/gsf-access-key"+  * **[[wpfr>Triple_DES|Triple DES]]** (3DES), 
 +  * **[[wpfr>RC2]]**,  
 +  * **[[wpfr>Blowfish|Blowfish]]**, 
 +  * **[[wpfr>International_Data_Encryption_Algorithm|International Data Encryption Algorithm]]** (IDEA), 
 +  * **[[wpfr>Standard_de_chiffrement_avancé|Advanced Encryption Standard]]** (AES).
  
-# If ENABLED is set to 0, the sync script will not perform a synchronization. +===Algorithmes à clef publique===
-ENABLED=1+
  
-# LOG_CMD defines the command to use for logging. To have logger log to stderr +==Le Chiffrement Asymétrique==
-# as well as syslog, add "-s" here. The logging facility is checked. In case of error +
-# all will be logged in the standard error and the socket error check will be +
-# disabled. +
-LOG_CMD="logger -t $SCRIPT_NAME"+
  
-check_logger () { +Ce système est aussi appelé **Système à Clef Publique**.
-  logger -p daemon.info -t $SCRIPT_NAME "Checking logger" --no-act 1>/dev/null 2>&+
-  if [ $? -gt 0 ] +
-  then +
-    LOG_CMD="logger -s -t $SCRIPT_NAME" +
-    $LOG_CMD -p daemon.warning "The log facility is not working as expected. All messages will be written to the standard error stream." +
-  fi +
-+
-check_logger+
  
 +Ce système consiste à avoir deux clefs appelées des **bi-clefs**:
  
-# Source configuration file if it is readable +  * Une clef **publique** pour le chiffrement 
-[ -r $OPENVAS_SYSCONF_DIR/greenbone-nvt-sync.conf ] && . $OPENVAS_SYSCONF_DIR/greenbone-nvt-sync.conf+  * Une clef **secrète** ou **privée** pour le déchiffrement
  
-# NVT_DIR is the place where the NVTs are located. +{{:redhat:lx04:crypto3.gif|Cette image issue de Comment Ça Marche (www.commentcamarche.net) est mise à disposition sous les termes de la licence Creative Commons. Vous pouvez copier, modifier des copies de l'image, dans les conditions fixées par la licence, tant que cette note apparaît clairement.}}
-if [ -z "$NVT_DIR"+
-then +
-  NVT_DIR="@OPENVAS_NVT_DIR@" +
-fi+
  
-log_write () { +  * L'utilisateur A (celui qui déchiffrechoisit une clef privée.  
-  $LOG_CMD -p daemon.notice $1 +  * A partir de cette clef il génère plusieurs clefs publiques grâce à un algorithme
-}+  * L'utilisateur B (celui qui chiffre) choisit une des clefs publiques à travers un canal non-sécurisé pour chiffrer les données à l'attention de l'utilisateur A.
  
-log_debug () { +Ce système est basé sur ce que l'on appelle une **fonction à trappe à sens unique** ou **one-way trap door**.
-  $LOG_CMD -p daemon.debug "$1" +
-}+
  
-log_info () { +Il existe toutefois un problème – s'assurer que la clef publique récupérée est bien celle qui correspond au destinataire !
-  $LOG_CMD -p daemon.info "$1" +
-}+
  
-log_notice () { +Les algorithmes de chiffrement asymétrique couramment utilisés en informatique sont:
-  $LOG_CMD -p daemon.notice "$1" +
-}+
  
-log_warning () { +  * **[[wpfr>Digital_Signature_Algorithm|Digital Signature Algorithm]]** (DSA
-  $LOG_CMD -p daemon.warning "$1" +  * **[[wpfr>Rivest_Shamir_Adleman|Rivest, Shamir, Adleman]]** (RSA)
-}+
  
-log_err () { +==La Clef de Session==
-  $LOG_CMD -p daemon.err "$1" +
-}+
  
-stderr_write () +Ce système est un compromis entre le système symétrique et le système asymétrique. Il permet l'envoie de données chiffrées à l'aide d'un algorithme de chiffrement symétrique par un canal non-sécurisé et a été mis au point pour palier au problème de lenteur de déchiffrement du système asymétrique.
-+
-  echo "$1" > /dev/stderr +
-}+
  
-# Read the general information about the feed origin from +{{:redhat:lx04:crypto4.gif|Cette image issue de Comment Ça Marche (www.commentcamarche.netest mise à disposition sous les termes de la licence Creative CommonsVous pouvez copier, modifier des copies de l'image, dans les conditions fixées par la licence, tant que cette note apparaît clairement.}}
-# the file "plugin_feed_info.inc" inside the feed directory. +
-get_feed_info () +
-+
-  INFOFILE="$NVT_DIR/plugin_feed_info.inc" +
-  if [ -r $INFOFILE ] ; then +
-    FEED_VERSION=`grep PLUGIN_SET $INFOFILE | sed -e 's/[^0-9]//g'+
-    FEED_NAME=`awk -F\" '/PLUGIN_FEED/ { print $2 }' $INFOFILE` +
-    FEED_VENDOR=`awk -F\" '/FEED_VENDOR/ { print $2 }' $INFOFILE` +
-    FEED_HOME=`awk -F\" '/FEED_HOME/ { print $2 }' $INFOFILE` +
-    FEED_PRESENT=1 +
-  else +
-    FEED_PRESENT=0 +
-  fi+
  
-  if [ -z "$FEED_NAME" ] ; then +Ce système fonctionne de la façon suivante :
-    FEED_NAME="Unidentified Feed" +
-  fi+
  
-  if [ -z "$FEED_VENDOR" ] ; then +  * L'utilisateur A chiffre une clef privée générée aléatoirement, appelée une « clef de session », en utilisant une des clefs publiques de l'utilisateur B. 
-    FEED_VENDOR="Unidentified Vendor" +  * L'utilisateur A chiffre les données avec la clef de session. 
-  fi+  * L'utilisateur B déchiffre la clef de session en utilisant sa propre clef privée. 
 +  * L'utilisateur B déchiffre les données en utilisant la clef de session.
  
-  if [ -z "$FEED_HOME" ] ; then +===Fonctions de Hachage===
-    FEED_HOME="Unidentified Feed Homepage" +
-  fi +
-}+
  
-# Prevent that root executes this script +La fonction de **hachage**, aussi appelée une fonction de **condensation**, est à **sens unique** (one way function)Il « condense » un message en clair et produit un haché unique.
-if [ "`id -u`" -eq "0"+
-then +
-  stderr_write "$0 must not be executed as privileged user root" +
-  stderr_write +
-  stderr_write "Unlike the actual scanner the sync routine does not need privileges.+
-  stderr_write "Accidental execution as root would prevent later overwriting of" +
-  stderr_write "files with a non-privileged user."+
  
-  log_err "Denied to run as root" +{{:redhat:lx04:crypto5.gif|Cette image issue de Comment Ça Marche (www.commentcamarche.net) est mise à disposition sous les termes de la licence Creative Commons. Vous pouvez copier, modifier des copies de l'image, dans les conditions fixées par la licence, tant que cette note apparaît clairement.}}
-  exit 1 +
-fi+
  
-# Always try to get the information when started. +Les deux algorithmes de hachage utilisés sont: 
-# This also ensures variables like FEED_PRESENT are set. +
-get_feed_info+
  
-# Determine whether a GSF access key is present. If yes, +  * **[[wpfr>MD5|Message Digest 5]]** (MD5)  
-# then use the Greenbone Security Feed. Else use the +  * **[[wpfr>SHA-1|Secure Hash Algorithm]]** (SHA)
-# Greenbone Community Feed. +
-if -e $ACCESS_KEY ] +
-then +
-  RESTRICTED=1 +
-else +
-  RESTRICTED=0+
  
-  if [ -z "$COMMUNITY_NVT_RSYNC_FEED" ]; then +Lors de son envoie, le message est accompagné de son haché et il est donc possible de garantir son intégrité:
-    COMMUNITY_NVT_RSYNC_FEED=rsync://feed.community.greenbone.net:/nvt-feed +
-    # An alternative syntax which might work if the above doesn't: +
-    # COMMUNITY_NVT_RSYNC_FEED=rsync@feed.community.greenbone.net::/nvt-feed +
-  fi +
-fi+
  
-RSYNC=`command -v rsync`+{{:redhat:lx04:crypto6.gif|Cette image issue de Comment Ça Marche (www.commentcamarche.net) est mise à disposition sous les termes de la licence Creative Commons. Vous pouvez copier, modifier des copies de l'image, dans les conditions fixées par la licence, tant que cette note apparaît clairement.}} 
 +  
 +  * A la réception du message, le destinataire ou l’utilisateur B calcule le haché du message reçu et le compare avec le haché accompagnant le document.  
 +  * Si le message ou le haché a été falsifié durant la communication, les deux empreintes ne correspondront pas. 
  
-if [ -z "$TMPDIR" ]; then +<WRAP center round important 50%> 
-  SYNC_TMP_DIR=/tmp +**Important** Ce système permet de vérifier que l'empreinte correspond bien au message reçumais ne permet pas de prouver que le message bien été envoyé par l’utilisateur A. 
-  # If we have mktempcreate temporary dir (safer) +</WRAP>
-  if [ -n "`which mktemp`" ]; then +
-    SYNC_TMP_DIR=`mktemp -t -d greenbone-nvt-sync.XXXXXXXXXX` || { echo "ERROR: Cannot create temporary directory for file download" >&2; exit 1 ; } +
-    trap "rm -rf $SYNC_TMP_DIR" EXIT HUP INT TRAP TERM +
-  fi +
-else +
-  SYNC_TMP_DIR="$TMPDIR" +
-fi+
  
-# Initialize this indicator variable with default assuming the +===Signature Numérique===
-# feed is not up-to-date. +
-FEED_CURRENT=0+
  
-# This function uses gos-state-manager to get information about the settings. +Pour garantir l'authentification du message l‘utilisateur A va chiffrer ou **signer** le haché à l'aide de sa clé privéeLe haché signé est appelé un **sceau**.
-# If gos-state-manager is not installed the values of the settings can not be +
-# retrieved. +
-+
-# Input: option +
-# Output: value as string or empty String if gos-state-manager is not installed +
-#         or option not set +
-get_value () +
-+
-  value="" +
-  key=$1 +
-  if which gos-state-manager 1>/dev/null 2>&+
-  then +
-    if gos-state-manager get "$key.value" 1>/dev/null 2>&+
-    then +
-      value="$(gos-state-manager get "$key.value")" +
-    fi +
-  fi +
-  echo "$value" +
-}+
  
-# Creates a restricted access copy of the access key if necessary. +{{:redhat:lx04:crypto7.gif|Cette image issue de Comment Ça Marche (www.commentcamarche.netest mise à disposition sous les termes de la licence Creative Commons. Vous pouvez copier, modifier des copies de l'image, dans les conditions fixées par la licence, tant que cette note apparaît clairement.}}
-setup_temp_access_key () +
-  if [ -e "$ACCESS_KEY"+
-  then +
-    FILE_ACCESS=`stat -c%a "$ACCESS_KEY" | cut -c2-` +
-  fi +
-  if [ -n "$FILE_ACCESS" ] && [ "00" != "$FILE_ACCESS"+
-  then +
-    TEMP_ACCESS_KEY_DIR=`mktemp -d` +
-    TEMP_ACCESS_KEY="$TEMP_ACCESS_KEY_DIR/gsf-access-key" +
-    cp "$ACCESS_KEY" "$TEMP_ACCESS_KEY" +
-    chmod 400 "$TEMP_ACCESS_KEY" +
-  else +
-    TEMP_ACCESS_KEY_DIR="" +
-    TEMP_ACCESS_KEY="$ACCESS_KEY" +
-  fi +
-}+
  
-# Deletes the read-only copy of the access key. +  * L’utilisateur A envoie le sceau au destinataire
-cleanup_temp_access_key () { +  * A la réception du message L’utilisateur B déchiffre le sceau avec la clé publique de l’utilisateur A. 
-  if [ -n "$TEMP_ACCESS_KEY_DIR" ] +  * Il compare le haché obtenu au haché reçu en pièce jointe. 
-  then +  
-    rm -rf "$TEMP_ACCESS_KEY_DIR" +Ce mécanisme de création de sceau est appelé **scellement**.
-  fi +
-  TEMP_ACCESS_KEY_DIR="" +
-  TEMP_ACCESS_KEY="" +
-}+
  
-is_feed_current () { +Ce mécanisme est identique au procédé utilisé par SSH lors d'une connexion 
-  if [ -z "$FEED_VERSION"+
-  then +
-    log_write "Could not determine feed version." +
-    FEED_CURRENT=0 +
-    return $FEED_CURRENT +
-  fi+
  
-  if [ -z "$RSYNC"+===PKI===
-  then +
-    log_notice "rsync not available, skipping feed version test" +
-    FEED_CURRENT=+
-    rm -rf $FEED_INFO_TEMP_DIR +
-    cleanup_temp_access_key +
-    return 0 +
-  fi+
  
-  FEED_INFO_TEMP_DIR=`mktemp -d`+On appelle **[[wpfr>Public_Key_Infrastructure|PKI]]** (Public Key Infrastucture, ou en français **infrastructure à clé publique (ICP)**, parfois **infrastructure de gestion de clés (IGC)**) l’ensemble des solutions techniques basées sur la cryptographie à clé publique.
  
-  if [ -e $ACCESS_KEY ] +Les cryptosystèmes à clés publiques permettent de s'affranchir de la nécessité d'avoir recours systématiquement à un canal sécurisé pour s'échanger les clés. En revanche, la publication de la clé publique à grande échelle doit se faire en toute confiance pour assurer que :
-  then +
-    gsmproxy=$(get_value proxy_feed | sed -r -e 's/^.*\/\///-e 's/:([0-9]+)$/ \1/'+
-    syncport=$(get_value syncport) +
-    if [ "$syncport"+
-    then +
-      PORT="$syncport" +
-    fi+
  
-    read feeduser < $ACCESS_KEY +    * La clé publique est bien celle de son propriétaire ; 
-    custid=`awk -F@ 'NR > 1 { exit }{ print $1 }' $ACCESS_KEY` +    * Le propriétaire de la clé est digne de confiance 
-    if [ -z "$feeduser" ] || [ -z "$custid"+    * La clé est toujours valide
-    then +
-      log_err "Could not determine credentials, aborting synchronization.+
-      exit 1 +
-    fi+
  
-    setup_temp_access_key+Ainsi, il est nécessaire d'associer au bi-clé (ensemble clé publique / clé privée) un certificat délivré par un **tiers de confiance** : l'infrastructure de gestion de clés.
  
-    if [ "$gsmproxy" = "proxy_feed" ] || [ -z "$gsmproxy"+Le tiers de confiance est une entité appelée communément autorité de certification (ou en anglais Certification authority, abrégé CA) chargée d'assurer la véracité des informations contenues dans le certificat de clé publique et de sa validité.
-    then +
-      RSYNC_SSH_PROXY_CMD="" +
-    else +
-      if [ -e $OPENVAS_SYSCONF_DIR/proxyauth ] && [ -r $OPENVAS_SYSCONF_DIR/proxyauth ] +
-      then +
-        RSYNC_SSH_PROXY_CMD="-o \"ProxyCommand corkscrew $gsmproxy %h %p $OPENVAS_SYSCONF_DIR/proxyauth\"" +
-      else +
-        RSYNC_SSH_PROXY_CMD="-o \"ProxyCommand corkscrew $gsmproxy %h %p\"" +
-      fi +
-    fi+
  
-    rsync -e "ssh $RSYNC_SSH_OPTS $RSYNC_SSH_PROXY_CMD -p $PORT -i $TEMP_ACCESS_KEY" $RSYNC_OPTIONS $RSYNC_DELETE $RSYNC_COMPRESS $RSYNC_CHMOD "$feeduser"plugin_feed_info.inc $FEED_INFO_TEMP_DIR+Pour ce faire, l'autorité signe le certificat de clé publique à l'aide de sa propre clé en utilisant le principe de signature numérique.
  
-    if [ $? -ne 0 ] +Le rôle de l'infrastructure de clés publiques est multiple et couvre notamment les champs suivants :
-    then +
-      log_err "Errorrsync failed." +
-      rm -rf "$FEED_INFO_TEMP_DIR" +
-      exit 1 +
-    fi +
-  else +
-    # Sleep for five seconds (a previous feed might have been synced a few seconds before) to prevent +
-    # IP blocking due to network equipment in between keeping the previous connection too long open. +
-    sleep 5 +
-    log_notice "No Greenbone Security Feed access key found, falling back to Greenbone Community Feed" +
-    eval "$RSYNC -ltvrP \"$COMMUNITY_NVT_RSYNC_FEED/plugin_feed_info.inc\" \"$FEED_INFO_TEMP_DIR\"" +
-    if [ $? -ne 0 ] +
-    then +
-      log_err "rsync failed, aborting synchronization." +
-      rm -rf "$FEED_INFO_TEMP_DIR" +
-      exit 1 +
-    fi +
-  fi+
  
-  FEED_VERSION_SERVER=`grep PLUGIN_SET $FEED_INFO_TEMP_DIR/plugin_feed_info.inc | sed -e 's/[^0-9]//g'`+    * enregistrer des demandes de clés en vérifiant l'identité des demandeurs ; 
 +    * générer les paires de clés (clé privée clé publique) ; 
 +    * garantir la confidentialité des clés privées correspondant aux clés publiques ; 
 +    * certifier l'association entre chaque utilisateurs et sa clé publique ; 
 +    * révoquer des clés (en cas de perte par son propriétaire, d'expiration de sa date de validité ou de compromission). 
  
-  if [ -z "$FEED_VERSION_SERVER"+Une infrastructure à clé publique est en règle générale composée de trois entités distinctes :
-  then +
-    log_err "Could not determine server feed version." +
-    rm -rf $FEED_INFO_TEMP_DIR +
-    cleanup_temp_access_key +
-    exit 1 +
-  fi +
-  # Check against FEED_VERSION +
-  if [ $FEED_VERSION -lt $FEED_VERSION_SERVER ] ; then +
-    FEED_CURRENT=0 +
-  else +
-    FEED_CURRENT=1 +
-  fi +
-  # Cleanup +
-  rm -rf "$FEED_INFO_TEMP_DIR" +
-  cleanup_temp_access_key+
  
-  return $FEED_CURRENT +    * L'autorité d'enregistrement (AE ou RA pour Recording authority), chargée des formalité administratives telles que la vérification de l'identité des demandeurs, le suivi et la gestion des demandes, etc.) ; 
-}+    * L'autorité de certification (AC ou CA pour Certification Authority), chargée des tâches techniques de création de certificats. L'autorité de certification est ainsi chargée de la signature des demandes de certificat (CSR pour Certificate Signing Request, parfois appelées PKCS#10, nom du format correspondant). L'autorité de certification a également pour mission la signature des listes de révocations (CRL pour Certificate Revocation List) ; 
 +    * L'Autorité de dépôt (Repository) dont la mission est de conserver en sécurité les certificats.
  
-do_rsync_community_feed () { +==Certificats X509==
-  # Sleep for five seconds (a previous feed might have been synced a few seconds before) to prevent +
-  # IP blocking due to network equipment in between keeping the previous connection too long open. +
-  sleep 5 +
-  log_notice "Configured NVT rsync feed: $COMMUNITY_NVT_RSYNC_FEED" +
-  mkdir -p "$NVT_DIR" +
-  eval "$RSYNC -ltvrP $RSYNC_DELETE \"$COMMUNITY_NVT_RSYNC_FEED\" \"$NVT_DIR\" --exclude=plugin_feed_info.inc" +
-  if [ $? -ne 0 ] ; then +
-    log_err "rsync failed." +
-    exit 1 +
-  fi +
-  # Sleep for five seconds (after the above rsync call) to prevent IP blocking due +
-  # to network equipment in between keeping the previous connection too long open. +
-  sleep 5 +
-  eval "$RSYNC -ltvrP $RSYNC_DELETE \"$COMMUNITY_NVT_RSYNC_FEED/plugin_feed_info.inc\" \"$NVT_DIR\"" +
-  if [ $? -ne 0 ] ; then +
-    log_err "rsync failed." +
-    exit 1 +
-  fi +
-}+
  
-sync_nvts(){ +Pour palier aux problèmes liés à des clefs publiques piratéesun système de certificats a été mis en place.
-  if [ $ENABLED -ne 1 ] +
-  then +
-    log_write "NVT synchronization is disabledexiting.+
-    exit 0 +
-  fi+
  
-  if [ -e $ACCESS_KEY ] +Le certificat permet d’associer la clef publique à une entité ou une personneLes certificats sont délivrés par des Organismes de Certification.
-  then +
-    log_write "Synchronizing NVTs from the Greenbone Security Feed into $NVT_DIR..." +
-    if [ $FEED_PRESENT -eq 1 ] ; then +
-      FEEDCOUNT=`grep -E "nasl$|inc$" $NVT_DIR/md5sums | wc -l` +
-      log_write "Current status: Using $FEED_NAME at version $FEED_VERSION ($FEEDCOUNT NVTs)" +
-    else +
-      log_write "Current status: No feed installed." +
-    fi +
-    notsynced=1 +
-    retried=0+
  
-    mkdir -p "$NVT_DIR" +Les certificats sont des fichiers divisés en deux parties : 
-    read feeduser < $ACCESS_KEY +
-    custid=`awk -F@ 'NR > 1 { exit }; { print $1 }' $ACCESS_KEY` +
-    if [ -z "$feeduser" ] || [ -z "$custid"+
-    then +
-      log_err "Could not determine credentials, aborting synchronization." +
-      exit 1 +
-    fi+
  
-    setup_temp_access_key+  * La partie contenant les informations  
 +  * La partie contenant la signature de l'autorité de certification
  
-    while $notsynced -eq 1 ] +La structure des certificats est normalisée par le standard **[[wpfr>X.509|X.509]]** de l’**[[wpfr>UIT|Union internationale des télécommunications]]**. 
-    do+
  
-      gsmproxy=$(get_value proxy_feed | sed -r -e 's/^.*\/\///' -e 's/:([0-9]+)$/ \1/'+Elle contient 
-      syncport=$(get_value syncport) +
-      if [ "$syncport"+
-      then +
-        PORT="$syncport" +
-      fi+
  
-      if [ "$gsmproxy" = "proxy_feed" ] || [ -z "$gsmproxy" ] +  * Le nom de l'autorité de certification  
-      then +  * Le nom du propriétaire du certificat  
-        RSYNC_SSH_PROXY_CMD="" +  * La date de validité du certificat  
-      else +  * L'algorithme de chiffrement utilisé  
-        if [ -e $OPENVAS_SYSCONF_DIR/proxyauth ] && [ -r $OPENVAS_SYSCONF_DIR/proxyauth ]; then +  * La clé publique du propriétaire 
-          RSYNC_SSH_PROXY_CMD="-o \"ProxyCommand corkscrew $gsmproxy %h %p $OPENVAS_SYSCONF_DIR/proxyauth\"" +
-        else +
-          RSYNC_SSH_PROXY_CMD="-o \"ProxyCommand corkscrew $gsmproxy %h %p\"" +
-        fi +
-      fi +
-      rsync -e "ssh $RSYNC_SSH_OPTS $RSYNC_SSH_PROXY_CMD -p $PORT -i $TEMP_ACCESS_KEY" --exclude=plugin_feed_info.inc $RSYNC_OPTIONS $RSYNC_DELETE $RSYNC_COMPRESS $RSYNC_CHMOD $feeduser $NVT_DIR +
-      if [ $? -ne 0 ]  ; then +
-        log_err "rsync failed, aborting synchronization." +
-        exit 1 +
-      fi +
-      rsync -e "ssh $RSYNC_SSH_OPTS $RSYNC_SSH_PROXY_CMD -p $PORT -i $TEMP_ACCESS_KEY" $RSYNC_OPTIONS $RSYNC_DELETE $RSYNC_COMPRESS $RSYNC_CHMOD "$feeduser"plugin_feed_info.inc $NVT_DIR +
-      if [ $? -ne 0 ]  ; then +
-        log_err "rsync failed, aborting synchronization." +
-        exit 1 +
-      fi +
-      eval "cd \"$NVT_DIR\" ; md5sum -c --status \"$NVT_DIR/md5sums\"" +
-      if [ $? -ne 0 ]  ; then +
-        if [ -n "$retried"+
-        then +
-          log_err "Feed integrity check failed twice, aborting synchronization." +
-          cleanup_temp_access_key +
-          exit 1 +
-        else +
-          log_write "The feed integrity check failed. This may be due to a concurrent feed update or other temporary issues." +
-          log_write "Sleeping 15 seconds before retrying ..." +
-          sleep 15 +
-          retried=1 +
-        fi +
-      else +
-        notsynced=0 +
-      fi +
-    done +
-    cleanup_temp_access_key +
-    log_write "Synchronization with the Greenbone Security Feed successful." +
-    get_feed_info +
-    if [ $FEED_PRESENT -eq 1 ] ; then +
-      FEEDCOUNT=`grep -E "nasl$|inc$" $NVT_DIR/md5sums | wc -l` +
-      log_write "Current status: Using $FEED_NAME at version $FEED_VERSION ($FEEDCOUNT NVTs)" +
-    else +
-      log_write "Current status: No feed installed." +
-    fi +
-  else +
-    log_notice "No Greenbone Security Feed access key found, falling back to Greenbone Community Feed" +
-    do_rsync_community_feed +
-  fi +
-}+
  
-do_self_test () +Le Certificat est signé par l'autorité de certification:
-+
-  MD5SUM_AVAIL=`command -v md5sum` +
-  if [ $? -ne 0 ] ; then +
-    SELFTEST_FAIL=1 +
-    stderr_write "The md5sum binary could not be found." +
-  fi+
  
-  RSYNC_AVAIL=`command -v rsync` +{{:redhat:lx04:crypto8.gif|Cette image issue de Comment Ça Marche (www.commentcamarche.net) est mise à disposition sous les termes de la licence Creative Commons. Vous pouvez copier, modifier des copies de l'image, dans les conditions fixées par la licence, tant que cette note apparaît clairement.}}
-  if [ $? -ne 0 ] ; then +
-    SELFTEST_FAIL=1 +
-    stderr_write "The rsync binary could not be found.+
-  fi +
-}+
  
-do_describe () +La vérification se passe ainsi:
-+
-  echo "This script synchronizes an NVT collection with the '$FEED_NAME'." +
-  echo "The '$FEED_NAME' is provided by '$FEED_VENDOR'." +
-  echo "Online information about this feed'$FEED_HOME'." +
-}+
  
-do_feedversion () +{{:redhat:lx04:crypto9.gif|Cette image issue de Comment Ça Marche (www.commentcamarche.netest mise à disposition sous les termes de la licence Creative Commons. Vous pouvez copier, modifier des copies de l'image, dans les conditions fixées par la licence, tant que cette note apparaît clairement.}}
-  if [ $FEED_PRESENT -eq 1 ] ; then +
-    echo $FEED_VERSION +
-  else +
-    stderr_write "The file containing the feed version could not be found.+
-    exit 1 +
-  fi +
-}+
  
-do_sync () +=====LAB #2 Utilisation de GnuPG=====
-+
-  do_self_test +
-  if [ $SELFTEST_FAIL -ne 0 ] ; then +
-    exit $SELFTEST_FAIL +
-  fi+
  
-  if [ $FEED_CURRENT -eq 1 ] +====2.1 - Présentation====
-  then +
-    log_write "Feed is already current, skipping synchronization.+
-  else +
-    ( +
-      chmod +660 $OPENVAS_FEED_LOCK_PATH +
-      flock -n 9 +
-      if [ $? -eq 1 ] ; then +
-          log_warning "Another process related to the feed update is already running" +
-          exit 1 +
-      fi +
-      date > $OPENVAS_FEED_LOCK_PATH +
-      sync_nvts +
-      echo -n $OPENVAS_FEED_LOCK_PATH +
-    )9>>$OPENVAS_FEED_LOCK_PATH +
-  fi +
-}+
  
-do_help () { +**GNU Privacy Guard** permet aux utilisateurs de transférer des messages chiffrés et/ou signés.
-  echo "$0: Sync NVT data" +
-  echo " --describe     display current feed info" +
-  echo " --feedcurrent  just check if feed is up-to-date" +
-  echo " --feedversion  display version of this feed" +
-  echo " --help         display this help" +
-  echo " --identify     display information" +
-  echo " --nvtdir dir   set dir as NVT directory" +
-  echo " --selftest     perform self-test and set exit code" +
-  echo " --verbose      makes the sync process print details" +
-  echo " --version      display version" +
-  echo "" +
-  echo "" +
-  echo "Environment variables:" +
-  echo "NVT_DIR         where to extract plugins (absolute path)" +
-  echo "PRIVATE_SUBDIR  subdirectory of \$NVT_DIR to exclude from synchronization" +
-  echo "TMPDIR          temporary directory used to download the files" +
-  echo "Note that you can use standard ones as well (e.g. RSYNC_PROXY) for rsync" +
-  echo "" +
-  exit 0 +
-}+
  
-while test $# -gt 0; do +====2.2 - Utilisation====
-  case "$1" in +
-    --version) +
-      echo $VERSION +
-      exit 0 +
-      ;; +
-    --identify) +
-      echo "NVTSYNC|$SCRIPT_NAME|$VERSION|$FEED_NAME|$RESTRICTED|NVTSYNC" +
-      exit 0 +
-      ;; +
-    --selftest) +
-      do_self_test +
-      exit $SELFTEST_FAIL +
-      ;; +
-    --describe) +
-      do_describe +
-      exit 0 +
-      ;; +
-    --feedversion) +
-      do_feedversion +
-      exit 0 +
-      ;; +
-    --help) +
-      do_help +
-      exit 0 +
-      ;; +
-    --nvt-dir) +
-      NVT_DIR="$2+
-      shift +
-      ;; +
-    --feedcurrent) +
-      is_feed_current +
-      exit $? +
-      ;; +
-    --verbose) +
-      RSYNC_VERBOSE="-v" +
-      ;; +
-  esac +
-  shift +
-done+
  
-do_sync +Pour initialiser %%GnuPG%%, saisissez la commande suivante :
- +
-exit 0 +
-</code> +
- +
-Rendez le script exécutable :+
  
 <code> <code>
-[root@centos7 ~]chmod +x greenbone-nvt-sync+root@debian12:~# gpg 
 +gpg: directory '/root/.gnupg' created 
 +gpg: keybox '/root/.gnupg/pubring.kbx' created 
 +gpg: WARNING: no command supplied.  Trying to guess what you mean ... 
 +gpg: Go ahead and type your message ... 
 +^C 
 +gpg: signal Interrupt caught ... exiting
 </code> </code>
  
-Déplacez le script vers **/usr/sbin/** :+<WRAP center round important 50%> 
 +**Important** - Notez l'utilisation des touches **^C** après la ligne **gpgGo ahead and type your message ...**. 
 +</WRAP>
  
-<code> +Pour générer les clefs, saisissez la commande suivante :
-[root@centos7 ~]# mv greenbone-nvt-sync /usr/sbin +
-mvoverwrite ‘/usr/sbin/greenbone-nvt-sync’?+
-</code>+
  
-Devenez l'utilisateur trainee et mettez à jour les modules d'extensions de OpenVAS :+<WRAP center round important 50%> 
 +**Important** - Lorsque le système vous demande une Passphrase, saisissez une valeur que n'allez **PAS** oublié. 
 +</WRAP>
  
 <code> <code>
 +root@debian12:~# gpg --full-generate-key
 +gpg (GnuPG) 2.2.40; Copyright (C) 2022 g10 Code GmbH
 +This is free software: you are free to change and redistribute it.
 +There is NO WARRANTY, to the extent permitted by law.
  
-[root@centos7 ~]# su - trainee +Please select what kind of key you want: 
-Last loginMon Dec  15:30:45 CET 2025 on pts/0+   (1) RSA and RSA (default) 
 +   (2) DSA and Elgamal 
 +   (3) DSA (sign only) 
 +   (4) RSA (sign only) 
 +  (14) Existing key from card 
 +Your selection? 1 
 +RSA keys may be between 1024 and 4096 bits long. 
 +What keysize do you want? (3072)  
 +Requested keysize is 3072 bits 
 +Please specify how long the key should be valid. 
 +         = key does not expire 
 +      <n>  = key expires in n days 
 +      <n>w = key expires in n weeks 
 +      <n>m = key expires in n months 
 +      <n>y = key expires in n years 
 +Key is valid for? (0)  
 +Key does not expire at all 
 +Is this correct? (y/N) y
  
-[trainee@centos7 ~]$ greenbone-nvt-sync +GnuPG needs to construct a user ID to identify your key.
-... +
-Greenbone community feed server - http://feed.community.greenbone.net/ +
-This service is hosted by Greenbone Networks - http://www.greenbone.net/ +
- +
-All transactions are logged. +
- +
-If you have any questions, please use the Greenbone community portal.  +
-See https://community.greenbone.net for details. +
- +
-By using this service you agree to our terms and conditions. +
- +
-Only one sync per time, otherwise the source ip will be temporarily blocked.+
  
 +Real name: ITTRAINING
 +Email address: infos@ittraining.team
 +Comment: Test key
 +You selected this USER-ID:
 +    "ITTRAINING (Test key) <infos@ittraining.team>"
  
-receiving incremental file list +Change (N)ame, (C)omment, (E)mail or (O)kay/(Q)uit? O 
-plugin_feed_info.inc +We need to generate a lot of random bytesIt is a good idea to perform 
-            330 100%  322.27kB/   0:00:00 (xfr#1, to-chk=0/1)+some other action (type on the keyboard, move the mouse, utilize the 
 +disks) during the prime generation; this gives the random number 
 +generator a better chance to gain enough entropy. 
 +We need to generate a lot of random bytes. It is a good idea to perform 
 +some other action (type on the keyboardmove the mouse, utilize the 
 +disks) during the prime generation; this gives the random number 
 +generator a better chance to gain enough entropy. 
 +gpg: /root/.gnupg/trustdb.gpg: trustdb created 
 +gpg: directory '/root/.gnupg/openpgp-revocs.d' created 
 +gpg: revocation certificate stored as '/root/.gnupg/openpgp-revocs.d/B6022CC107539B4036A90FAEABAD13CD27F9E686.rev' 
 +public and secret key created and signed.
  
-sent 57 bytes  received 436 bytes  328.67 bytes/sec +pub   rsa3072 2025-11-28 [SC] 
-total size is 330  speedup is 0.67 +      B6022CC107539B4036A90FAEABAD13CD27F9E686 
-[trainee@centos7 ~]$ exit +uid                      ITTRAINING (Test key) <infos@ittraining.team> 
-[root@centos7 ~]#+sub   rsa3072 2025-11-28 [E]
 </code> </code>
  
-<WRAP center round important 50%> +La liste de clefs peut être visualisée avec la commande suivante :
-**Important** - En cas d'erreur, relancez simplement la commande+
-</WRAP> +
- +
-Déplacez les plugins vers le répertoire **/var/lib/openvas/plugins** :+
  
 <code> <code>
-[root@centos7 ~]mv /home/trainee/@OPENVAS_NVT_DIR@/* /var/lib/openvas/plugins+root@debian12:~# gpg --list-keys 
 +gpg: checking the trustdb 
 +gpg: marginals needed: 3  completes needed: 1  trust model: pgp 
 +gpg: depth: 0  valid:    signed:    trust: 0-, 0q, 0n, 0m, 0f, 1u 
 +/root/.gnupg/pubring.kbx 
 +------------------------ 
 +pub   rsa3072 2025-11-28 [SC] 
 +      B6022CC107539B4036A90FAEABAD13CD27F9E686 
 +uid           [ultimate] ITTRAINING (Test key) <infos@ittraining.team> 
 +sub   rsa3072 2025-11-28 [E]
 </code> </code>
  
-Vérifiez ensuite la réussite de la commande précédente : +Pour importer la clef d'un correspondant dans sa trousse de clefs il convient d'utiliser la commande suivante :
- +
-<code> +
-[root@centos7 ~]# ls -l /var/lib/openvas/plugins/ | more +
-total 41280 +
-drwxr-xr-x.   6 trainee trainee    24576 Dec  1 11:30 2008 +
-drwxr-xr-x.  14 trainee trainee    65536 Dec  1 11:30 2009 +
-drwxr-xr-x.  12 trainee trainee    65536 Dec  1 11:30 2010 +
-drwxr-xr-x.  13 trainee trainee   118784 Dec  1 11:30 2011 +
-drwxr-xr-x.  14 trainee trainee   102400 Dec  1 11:30 2012 +
-drwxr-xr-x.  11 trainee trainee    86016 Dec  1 11:30 2013 +
-drwxr-xr-x.  13 trainee trainee    81920 Dec  1 11:30 2014 +
-drwxr-xr-x.  15 trainee trainee   118784 Dec  1 11:30 2015 +
-drwxr-xr-x.  17 trainee trainee   159744 Dec  1 11:30 2016 +
-drwxr-xr-x.  70 trainee trainee   126976 Dec  1 11:30 2017 +
-drwxr-xr-x. 288 trainee trainee     8192 Dec  1 11:30 2018 +
-drwxr-xr-x. 215 trainee trainee     8192 Dec  1 11:30 2019 +
-drwxr-xr-x. 181 trainee trainee     8192 Dec  1 11:30 2020 +
-drwxr-xr-x. 154 trainee trainee     8192 Dec  1 11:30 2021 +
-drwxr-xr-x. 149 trainee trainee     4096 Dec  1 11:30 2022 +
-drwx------. 136 trainee trainee     4096 Dec  1 11:30 2023 +
-drwx------. 127 trainee trainee     4096 Dec  1 11:30 2024 +
-drwx------. 132 trainee trainee     4096 Dec  1 11:30 2025 +
--rw-r--r--.   1 trainee trainee     2311 Dec  1 11:08 adaptbb_detect.nasl +
--rw-r--r--.   1 trainee trainee     1786 Dec  1 11:08 afs_version.nasl +
--rw-r--r--.   1 trainee trainee     2448 Dec  1 11:08 amanda_detect.nasl +
--rw-r--r--.   1 trainee trainee     2432 Dec  1 11:08 amanda_version.nasl +
--rw-r--r--.   1 trainee trainee     1492 Dec  1 11:08 aol_installed.nasl +
--rw-r--r--.   1 trainee trainee     2746 Dec  1 11:08 apachehttp_config_defaults.nasl +
--rw-r--r--.   1 trainee trainee     8186 Dec  1 11:08 apache_ofbiz_http_detect.nasl +
--rw-r--r--.   1 trainee trainee     5553 Dec  1 11:08 apache_prds.inc +
--rw-r--r--.   1 trainee trainee     4210 Dec  1 11:08 apache_server_info.nasl +
--rw-r--r--.   1 trainee trainee     4624 Dec  1 11:08 apache_server_status.nasl +
--rw-r--r--.   1 trainee trainee     6726 Dec  1 11:08 apache_SSL_complain.nasl +
--rw-r--r--.   1 trainee trainee     2117 Dec  1 11:08 apache_tomcat_config.nasl +
--rw-r--r--.   1 trainee trainee     2569 Dec  1 11:08 AproxEngine_detect.nasl +
--rw-r--r--.   1 trainee trainee     2496 Dec  1 11:08 arcserve_backup_detect.nasl +
--rw-r--r--.   1 trainee trainee     1937 Dec  1 11:08 arkoon.nasl +
--rw-r--r--.   1 trainee trainee     6878 Dec  1 11:08 asip-status.nasl +
--rw-r--r--.   1 trainee trainee     3797 Dec  1 11:08 atmail_detect.nasl +
-drwx------.   9 trainee trainee    20480 Dec  1 11:30 attic +
--rw-r--r--.   1 trainee trainee     1914 Dec  1 11:08 auth_enabled.nasl +
--rw-r--r--.   1 trainee trainee     2016 Dec  1 11:08 aventail_asap_http_detect.nasl +
--rw-r--r--.   1 trainee trainee  1638960 Dec  1 11:08 bad_dsa_ssh_host_keys.txt +
--rw-r--r--.   1 trainee trainee  1638960 Dec  1 11:08 bad_rsa_ssh_host_keys.txt +
--rw-r--r--.   1 trainee trainee    54323 Dec  1 11:08 bad_ssh_host_keys.inc +
--rw-r--r--.   1 trainee trainee    15064 Dec  1 11:08 bad_ssh_keys.inc +
--rw-r--r--.   1 trainee trainee     2507 Dec  1 11:08 barracuda_im_firewall_detect.nasl +
--rw-r--r--.   1 trainee trainee     2827 Dec  1 11:08 base_detect.nasl +
--rw-r--r--.   1 trainee trainee     4464 Dec  1 11:08 basilix_detect.nasl +
--rw-r--r--.   1 trainee trainee     3144 Dec  1 11:08 bgp_detect.nasl +
--rw-r--r--.   1 trainee trainee    23162 Dec  1 11:08 bin.inc +
--rw-r--r--.   1 trainee trainee     2745 Dec  1 11:08 bloofoxCMS_detect.nasl +
--rw-r--r--.   1 trainee trainee     1531 Dec  1 11:08 bluecoat_mgnt_console.nasl +
--rw-r--r--.   1 trainee trainee     2576 Dec  1 11:08 boastMachine_detect.nasl +
--rw-r--r--.   1 trainee trainee     1359 Dec  1 11:08 brother_printers.inc +
--rw-r--r--.   1 trainee trainee     3450 Dec  1 11:08 bugbear.nasl +
--rw-r--r--.   1 trainee trainee     3639 Dec  1 11:08 bugzilla_detect.nasl +
--rw-r--r--.   1 trainee trainee     5301 Dec  1 11:08 byte_func.inc +
---More-- +
-</code> +
- +
-Exécutez de nouveau la commande **openvas-check-setup** : +
- +
-<code> +
-[root@centos7 ~]# openvas-check-setup +
-... +
-Step 2: Checking OpenVAS Manager ...  +
-        OK: OpenVAS Manager is present in version 6.0.9. +
-        ERROR: No client certificate file of OpenVAS Manager found. +
-        FIX: Run 'openvas-mkcert-client -n -i' +
- +
- ERRORYour OpenVAS-8 installation is not yet complete! +
-... +
-</code>+
  
 <WRAP center round important 50%> <WRAP center round important 50%>
-**Important** - Notez l'erreur **ERROR: No client certificate file of OpenVAS Manager found.**+**Important** - La commande suivante est un exemple. Ne la saisissez **PAS**.
 </WRAP> </WRAP>
  
-Consultez la signification des options suggérées pour la commande **openvas-mkcert-client** :+  # gpg --import la-clef.asc
  
-<code> +Pour exporter sa clef publiqueil convient d'utiliser la commande suivante :
-[root@centos7 ~]# openvas-mkcert-client --help +
-/bin/openvas-mkcert-client: illegal option -- - +
-Usage: +
-  openvas-mkcert-client [OPTION...] - Create SSL client certificates for OpenVAS. +
- +
-Options: +
-  -h           Display help +
-  -n           Run non-interactivelycreate certificates +
-               and register with the OpenVAS scanner +
-  -i           Install client certificates for use with OpenVAS manager +
-</code> +
- +
-Exécutez donc la commande **openvas-mkcert-client -i** :+
  
 <code> <code>
-[root@centos7 ~]openvas-mkcert-client -+root@debian12:~# gpg --export --armor ITTRAINING > ~/mykey.asc
-This script will now ask you the relevant information to create the SSL client certificates for OpenVAS.+
  
-Client certificates life time in days [365]3650 +root@debian12:~# cat mykey.asc 
-Your country (two letter code) [DE]: UK +-----BEGIN PGP PUBLIC KEY BLOCK-----
-Your state or province name [none]: SURREY +
-Your location (e.g. town) [Berlin]: ADDLESTONE +
-Your organization [none]: I2TCH LIMITED +
-Your organizational unit [none]: TRAINING +
-********** +
-We are going to ask you some question for each client certificate. +
  
-If some question has a default answer, you can force an empty answer by entering a single dot '.'+mQGNBGkpk+gBDACq6M7rUNQFu/R6J+1p3RAB1+gwnszs/jZuBAo6y9i1buBsySP9 
 +oV9JmFfRe4P2QG/mgmSaGgeO0sE5m+r2Jhif2fShjHYLd6VTSVZRyfO+NW3MDbkm 
 +MtIf4LlXRrTALGE5TclLWFz5a2iqRjtT8IjSPAu1M9TLUaMXtWXN6jQY1YOnjxPN 
 +3HL8bwdaY0k8icKr8JRbmEijCWo2F4t2qTtdOXuRFAImxBpX49eJR0oC5bzXZPYx 
 +LbirNsEwSULIyQ71gdF5OUb0aOSiQLXLuTLAs2BnxAJ82tB/dM8qP0ez0lXLJvvF 
 ++t0eHdWzUHH4qlXuNtBXK7pEbvjqftO69PJLDp/PwjEfUsELcxDyUFpphhZDJ8zN 
 +qvRgll3fojjr91WWWqr8YTd4EiTvq9KfUyAiTOfKm8k4iRQRTJir267Fq8Mno8/
 +My1tNeHWzCXMs3k/GKyi36Uu15wY50hRTPDYexa+aou0QEs4iY3EXjzaOD3BVvRQ 
 +XTBUX/CS3ZmLC3MAEQEAAbQtSVRUUkFJTklORyAoVGVzdCBrZXkpIDxpbmZvc0Bp 
 +dHRyYWluaW5nLnRlYW0+iQHOBBMBCgA4FiEEtgIswQdTm0A2qQ+uq60TzSf55oYF 
 +Amkpk+gCGwMFCwkIBwIGFQoJCAsCBBYCAwECHgECF4AACgkQq60TzSf55oZEsAv+ 
 +Ky14vHWjMzU1ieE+XStqGYfjfAHhaNrpkWCz6miozuh+ESifNWpJd96bzwgNLGob 
 +E5mA9oja5jyAEQUGT+gEwgvkbYVe4sf4UcXPRrvDqKiEOkN5rra3kYYdhHhpiFes 
 +BmwQvW2dyElNO1ee/zzQOZ0Hd3vM/vdbmZRg8zKoV5eQz/MA2jpxF9IkXEDtUMzZ 
 +C5kqTMRXdoWR2ZP2HLZjUstRX7d9BP/8oeg+2lMq9UlULWrYyVaD85dEAmCt9mQz 
 +TqtAMmtp5IXalT+vKwhMu0MwUfyXyvl7ery4kxfmFtEeJQyxrdK2gihDxr0ndxBH 
 +mowlIoBiGYMhUr/aF0lM00blpRAUoGv1rO2DUWh8TXzRJq6FJ4pzo9XRwR0dP7A6 
 +VBlBdhX2SlE9XJOjLq9ppV5Vr9u6ZauwEI6kBLoagjWOF3t34Gnvel8zO+H5fhhq 
 +UKMOAbC0SYmLVIPNUauHYoKiJlWb+Dlr96NsPm0sYBbB047hr0evBUmkJNrulI3N 
 +uQGNBGkpk+gBDADZu1B0itmBIGzxjGmUjK9UagW3HNLNVX3jn2Jwe7yl3vL/d3Fk 
 +qBRydky32P4whbUSiJN71Tze9l+WOxeXGa0orKPPha/oQtlnmqyM6WBfOmvjSQkn 
 +xCrS131SYjFb5dcQXoqTtUk8Wu4qoMHu/Mi9jtx8GrrENWzR7DFG2MDWwcM4TmUk 
 +zs6azU/jaQX/YrGmYU3vB/zpKEZSo89pJ/S2FQ/6Fr+nnh7El3thNJxLRH40UlZs 
 +FIpfm95Q+wtC224wckro/Xf/+t7oBssSqCZEkCItN+AlDpm13h161dypVRpC1M5Y 
 +IITHq92gQSAKFhwSauaPtJ++oQNRgz5vJhCg78XfyBGpwDS6P0NM5RVEz6LMhQzI 
 +4LziGmYH/iWj0pv45Uze7hOZaWhBPlPWFixJ97nl3soxA7hV1MLt/Ohy5jxGC8U3 
 +CrtEjyAIQxCmEUF0vPa7X1KB+FxCpJ8mYXBZ5w1DwBN7qsOnnHZKFcaPGW8r1am6 
 +Ab25ee028mua9RkAEQEAAYkBtgQYAQoAIBYhBLYCLMEHU5tANqkPrqutE80n+eaG 
 +BQJpKZPoAhsMAAoJEKutE80n+eaGCRgMAJiG7Q8oF6oMkn6Xh7kXVH2yF4CKN9/
 +/qtImK/ikn14+/QNYpUbF4kIGadeCVgpKZZ+R9QLXTW7WQV4hgoOW3yiET3FTEBc 
 +YoxDxegwlk9+gPiOMJ0+9R43IUs+jFrra1jcUpSg+1Nv2IijdPwape3HyPhYgDmZ 
 +VxORrNtqBCkhtLpJO5VTiThAny+rNBHk1t1vQg4tEkCLGcOD8bsdxhACZnM0DVYY 
 +rA6afeDnm7CTfVtc3QFAi2+ltYcDIrMxMF0b1VASlbU14TE6ep2Ic30ScpDJL8De 
 +skhWi2/0v2WwhbmdGzfv5K5V3Z6NtoB3OUaHzKqzgEQeqjudgRaL440UsDtEFRHE 
 +vh6kVR0MPTFjg+8khUjjrSYUzqiiK6iJDxn+m0XJvHzQTeCHQlgRrPj9HGp7isyK 
 +o9Wf8fVvnksR8xc/2NcJwp0fo7ULwdADjgMtPUR155ukI8Xt9Aws+5OsYrIxBMMc 
 +DTh6aJal6iGcG4aXbTzwIFXHW9WipS5B4A== 
 +=rrxA 
 +-----END PGP PUBLIC KEY BLOCK----- 
 +</code>
  
-********* +Cette clef peut ensuite être jointe à des messages électroniques ou bien déposée sur un serveur de clefs tel http://www.keyserver.net.
-Client certificates life time in days [3650] +
-Country (two letter code) [UK]:  +
-State or province name [SURREY]:  +
-Location (e.g. town) [ADDLESTONE]:  +
-Organization [I2TCH LIMITED]:  +
-Organization unit [TRAINING]:  +
-e-Mail []: infos@i2tch.eu +
-Generating RSA private key, 4096 bit long modulus +
-....++ +
-.......++ +
-e is 65537 (0x10001) +
-You are about to be asked to enter information that will be incorporated +
-into your certificate request. +
-What you are about to enter is what is called a Distinguished Name or a DN. +
-There are quite a few fields but you can leave some blank +
-For some fields there will be a default value, +
-If you enter '.', the field will be left blank. +
------ +
-Country Name (2 letter code) [DE]:State or Province Name (full name) [Some-State]:Locality Name (eg, city) []:Organization Name (eg, company) [Internet Widgits Pty Ltd]:Organizational Unit Name (eg, section) []:Common Name (eg, your name or your server's hostname) []:Email Address []:Using configuration from /tmp/openvas-mkcert-client.13962/stdC.cnf +
-Check that the request matches the signature +
-Signature ok +
-The Subject's Distinguished Name is as follows +
-countryName           :PRINTABLE:'UK' +
-stateOrProvinceName   :ASN.1 12:'SURREY' +
-localityName          :ASN.1 12:'ADDLESTONE' +
-organizationName      :ASN.1 12:'I2TCH LIMITED' +
-organizationalUnitName:ASN.1 12:'TRAINING' +
-commonName            :ASN.1 12:'om' +
-emailAddress          :IA5STRING:'infos@i2tch.eu' +
-Certificate is to be certified until Jun 17 02:03:34 2028 GMT (3650 days)+
  
-Write out database with 1 new entries +===Signer un message===
-Data Base Updated +
-/bin/openvas-mkcert-client: line 370: [: argument expected +
-</code>+
  
-Exécutez encore une fois la commande **openvas-check-setup** :+Créez maintenant un message à signer :
  
 <code> <code>
-[root@centos7 ~]openvas-check-setup +root@debian12:~# vi message.txt
-... +
-Step 2: Checking OpenVAS Manager ...  +
-        OK: OpenVAS Manager is present in version 6.0.9. +
-        OK: OpenVAS Manager client certificate is present as /etc/pki/openvas/CA/clientcert.pem. +
-        ERROR: No OpenVAS Manager database found. (Tried: /var/lib/openvas/mgr/tasks.db) +
-        FIX: Run 'openvasmd --rebuild' while OpenVAS Scanner is running. +
-        WARNING: OpenVAS Scanner is NOT running! +
-        SUGGEST: Start OpenVAS Scanner (openvassd).+
  
- ERRORYour OpenVAS-8 installation is not yet complete! +root@debian12:~# cat message.txt 
-...+# ~/message.txt 
 +Ceci est un message de test pour GnuPG
 </code> </code>
 +
 +Pour signer ce message en format binaire, il convient d'utiliser la commande suivante :
  
 <WRAP center round important 50%> <WRAP center round important 50%>
-**Important** - Notez l'erreur **ERROR: No OpenVAS Manager database found(Tried: /var/lib/openvas/mgr/tasks.db).**+**Important** - Entrez votre Passphrase quand gpg vous la demande.
 </WRAP> </WRAP>
- 
-Afin de générer la base de données, OpenVAS Scanner doit être en cours d'exécution. Activez et démarrez donc le service : 
  
 <code> <code>
-[root@centos7 ~]systemctl enable openvas-scanner +root@debian12:~# gpg --default-key ITTRAINING --detach-sign message.txt 
-Created symlink from /etc/systemd/system/multi-user.target.wants/openvas-scanner.service to /usr/lib/systemd/system/openvas-scanner.service. +gpgusing "ITTRAINING" as default secret key for signing
-[root@centos7 ~]# systemctl start openvas-scanner +
-[root@centos7 ~]# systemctl status openvas-scanner +
-● openvas-scanner.service - OpenVAS Scanner +
-   Loadedloaded (/usr/lib/systemd/system/openvas-scanner.service; enabled; vendor preset: disabled) +
-   Active: active (running) since Mon 2025-12-01 16:45:47 CET; 12s ago +
-  Process: 8889 ExecStart=/usr/sbin/openvassd $SCANNER_PORT $SCANNER_LISTEN $SCANNER_SRCIP (code=exited, status=0/SUCCESS) +
- Main PID: 8890 (openvassd) +
-   CGroup: /system.slice/openvas-scanner.service +
-           ├─8890 openvassd: Reloaded 1200 of 138097 NVTs (0% / ETA: 22:48) +
-           └─8891 openvassd (Loading Handler)+
  
-Dec 01 16:45:47 centos7.fenestros.loc systemd[1]Starting OpenVAS Scanner..+root@debian12:~# ls -l | grep message 
-Dec 01 16:45:47 centos7.fenestros.loc systemd[1]: Started OpenVAS Scanner. +-rw-r--r-- root    root         55 Nov 28 13:28 message.txt 
-</code>+-rw-r--r-- 1 root    root        461 Nov 28 13:28 message.txt.sig
  
-Construisez maintenant la base de données :+root@debian12:~# cat message.txt.sig
  
-<code> +4!,S@6'i)infos@ittraining.team 
-[root@centos7 ~]# openvasmd --rebuild --progress +        '| 
-Rebuilding NVT cache... done.+                M<~,#5@^0F6ܝӎl`6fA(897>"Bj\     N!M.=F[3tC"%Fk@{6ƒbbEcc2'Smhlwmޚ)<AICA$U^*DPI0ʘ)'p-4d{EiU\P`9}%L0RНGڕ(-y$i'fǬCBH^c      ;pQbٜbJeqKh7I/6FLc7kUi}/%3xeOv;i13Ĭ
 </code> </code>
  
-Exécutez de nouveau la commande **openvas-check-setup** :+Pour signer ce message en format ascii, il convient d'utiliser la commande suivante :
  
 <code> <code>
-[root@centos7 ~]openvas-check-setup +root@debian12:~#  gpg --default-key ITTRAINING --armor --detach-sign message.txt
-... +
-Step 2: Checking OpenVAS Manager ...  +
-        OK: OpenVAS Manager is present in version 6.0.9. +
-        OK: OpenVAS Manager client certificate is present as /etc/pki/openvas/CA/clientcert.pem. +
-        OK: OpenVAS Manager database found in /var/lib/openvas/mgr/tasks.db. +
-        OK: Access rights for the OpenVAS Manager database are correct. +
-        OK: sqlite3 found, extended checks of the OpenVAS Manager installation enabled. +
-        OK: OpenVAS Manager database is at revision 146. +
-        OK: OpenVAS Manager expects database at revision 146. +
-        OK: Database schema is up to date. +
-        OK: OpenVAS Manager database contains information about 45654 NVTs. +
-        ERROR: No users found. You need to create at least one user to log in. +
-        It is recommended to have at least one user with role Admin. +
-        FIX: create a user by running 'openvasmd --create-user=<name> --role=Admin && openvasmd --user=<name> --new-password=<password>' +
-... +
-</code>+
  
-<WRAP center round important 50%> +gpgusing "ITTRAINING" as default secret key for signing
-**Important** - Notez l'erreur **ERRORNo users found. You need to create at least one user to log in.** +
-</WRAP>+
  
-Créez donc un utilisateur :+root@debian12:~# ls -l | grep message 
 +-rw-r--r-- 1 root    root         55 Nov 28 13:28 message.txt 
 +-rw-r--r-- 1 root    root        691 Nov 28 13:31 message.txt.asc 
 +-rw-r--r-- 1 root    root        461 Nov 28 13:28 message.txt.sig
  
-<code> +root@debian12:~# cat message.txt.asc 
-[root@centos7 ~]openvasmd --create-user=fenestros --role=Admin +-----BEGIN PGP SIGNATURE-----
-User created with password 'a5b5eaa9-3600-4604-bf20-bc10d7e5455b'.+
  
-[root@centos7 ~]# openvasmd --user=fenestros --new-password=fenestros+iQHKBAABCgA0FiEEtgIswQdTm0A2qQ+uq60TzSf55oYFAmkplgkWHGluZm9zQGl0 
 +dHJhaW5pbmcudGVhbQAKCRCrrRPNJ/nmhiteC/kBXVFzjOQYIzdt4ALI37gCmd7x 
 +Ml72F9permfoLc83fj+zZfigUxZe4DHx0TslVtFhntkg+7wF1H3MmUyKOhwCXFO4 
 +ccyE9/DDJR384muuAP1q05bnXz0SHkTQaXVteCvAfHB8kzqQg04ePCBcIWK6YQVv 
 +MBVm2O4pFDXWu1+0S69YnAelElZrzoqCaqprkQCcJvekBSV2NUNPLcwcBGq966+q 
 +T9bGxPtW/5oTaPfFRzWwT/47ajpB66v3kEyGlc+gMpD4PFKZhLoEpgpByBWRWvhm 
 +ZQsz2eby3oyv5KduA2emMnstQGCBq6zukYUpTgtzXB6jF1S71okiow11NsPra0m+ 
 +9CAcg3tiylnkUJEgsvfZ45uctN+2UqBNAXMgVsHGUhJtugfPzfwWpfC/BMMdLS46 
 +g2nTttJexAGjjtw4Y0uFIYbNI0xXeH8ooh0AgQcXS5IOVH2zYs0GIdMxzRYFhRmc 
 +nVRd/mHfQ21Mi1C5AnxDkqx6RpeH1maaLsPOFlo= 
 +=2N1N 
 +-----END PGP SIGNATURE----- 
 </code> </code>
  
-Exécutez encore une fois la commande **openvas-check-setup** :+Pour signer ce message **dans le message lui-même** en format ascii, il convient d'utiliser la commande suivante :
  
 <code> <code>
-[root@centos7 ~]openvas-check-setup +root@debian12:~# gpg --default-key ITTRAINING --clearsign message.txt 
-..+gpgusing "ITTRAINING" as default secret key for signing 
-Step 2Checking OpenVAS Manager ...  +File 'message.txt.asc' exists. Overwrite? (y/Ny
-        OK: OpenVAS Manager is present in version 6.0.9. +
-        OK: OpenVAS Manager client certificate is present as /etc/pki/openvas/CA/clientcert.pem. +
-        OK: OpenVAS Manager database found in /var/lib/openvas/mgr/tasks.db. +
-        OK: Access rights for the OpenVAS Manager database are correct. +
-        OK: sqlite3 found, extended checks of the OpenVAS Manager installation enabled. +
-        OK: OpenVAS Manager database is at revision 146. +
-        OK: OpenVAS Manager expects database at revision 146. +
-        OK: Database schema is up to date. +
-        OK: OpenVAS Manager database contains information about 45654 NVTs. +
-        OK: At least one user exists. +
-        ERROR: No OpenVAS SCAP database found. (Tried: /var/lib/openvas/scap-data/scap.db) +
-        FIX: Run a SCAP synchronization script like openvas-scapdata-sync or greenbone-scapdata-sync.+
  
- ERRORYour OpenVAS-8 installation is not yet complete! +root@debian12:~# ls -l | grep message 
-... +-rw-r--r-- 1 root    root         55 Nov 28 13:28 message.txt 
-</code>+-rw-r--r-- 1 root    root        795 Nov 28 13:33 message.txt.asc 
 +-rw-r--r-- 1 root    root        461 Nov 28 13:28 message.txt.sig
  
-<WRAP center round important 50%> +root@debian12:~# cat message.txt.asc 
-**Important** - Notez l'erreur **ERRORNo OpenVAS SCAP database found(Tried: /var/lib/openvas/scap-data/scap.db).** +-----BEGIN PGP SIGNED MESSAGE----- 
-</WRAP>+Hash: SHA512
  
-La prochaine étape donc consiste à récupérer la base SCAP (Security Content Automation Protocol).+# ~/message.txt 
 +Ceci est un message de test pour GnuPG 
 +-----BEGIN PGP SIGNATURE-----
  
-Créez le fichier **greenbone-feed-sync** :+iQHKBAEBCgA0FiEEtgIswQdTm0A2qQ+uq60TzSf55oYFAmkplpsWHGluZm9zQGl0 
 +dHJhaW5pbmcudGVhbQAKCRCrrRPNJ/nmhopQC/wJYnC83AnA54x9O9FzHIQ0YVqO 
 +QzcoDIIDMF71lizXIQ4DL2GCKhO3pelEWfyofUxd1sddT2qIHIsRTULaqHPRRjOU 
 +9e/Wm9i65aUnQ/o5oDLSuHooi/r3HYPr8tHDhNSXT81a/QQ0BYVpMHVW/LREtw+L 
 +qNPNlSZ4kzim3LyASyg8SYTGfft35S1S+7bjoY7LHfJUlGuSFRtlDMlhTbrrDqhI 
 +S3TL6EeNFCdEVoxCPamsAKvuk4BV8Fe2rCjQqm/D6f0l+bgdnGFnd5y+nCiz0xXF 
 +i7lQkZz+IjoTqwrjboL1mPWt6DMgiBX0IWas4kxKiBeZzyDZm6HGNeeMsqnReTcR 
 +TPNM9FdDmpcxYzrRbYAoWTmdhiPdD/aXPEp+McyNIwwHgduUWuRGcifP2PVw6j0N 
 +i3yOFw/rJEZMQnjwuL0GUSO3o8j1WMcSsTOHqsgu5FSKSjiIelNK2gzHTkuFiJ/
 +scYMCHrlrUfErpkLD1H6eFhSA4StmdZPmAA5DBA= 
 +=07RM 
 +-----END PGP SIGNATURE----- 
 +</code> 
 + 
 +Pour vérifier la signature d'un message signé en mode ascii, il convient d'utiliser la commande :
  
 <code> <code>
-[root@centos7 ~]vi greenbone-feed-sync +root@debian12:~# gpg --verify message.txt.asc 
-[root@centos7 ~]# cat greenbone-feed-sync +gpg: Signature made Fri 28 Nov 2025 01:33:31 PM CET 
-#!/bin/sh +gpg:                using RSA key B6022CC107539B4036A90FAEABAD13CD27F9E686 
-# Copyright (C) 2011-2020 Greenbone Networks GmbH +gpg               issuer "infos@ittraining.team" 
-+gpgGood signature from "ITTRAINING (Test key<infos@ittraining.team>" [ultimate] 
-# SPDX-License-IdentifierAGPL-3.0-or-later +gpg: WARNING: not a detached signaturefile 'message.txt' was NOT verified! 
-+</code>
-# This program is free softwareyou can redistribute it and/or modify +
-# it under the terms of the GNU Affero General Public License as +
-# published by the Free Software Foundation, either version 3 of the +
-# License, or (at your optionany later version+
-+
-# This program is distributed in the hope that it will be useful, +
-# but WITHOUT ANY WARRANTYwithout even the implied warranty of +
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE See the +
-# GNU Affero General Public License for more details. +
-+
-# You should have received a copy of the GNU Affero General Public License +
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.+
  
-# This script synchronizes a GVM installation with the +<WRAP center round important 50%> 
-# feed data from either the Greenbone Security Feed (in +**Important** - Pour vérifier la signature d'un message signé en mode ascii et produit en dehors du message lui-même, il convient d'utiliser la commande :
-# case a GSF access key is present) or else from the Greenbone +
-# Community Feed.+
  
-log_notice () { +  # gpg --verify message.txt.asc message.txt 
-  $LOG_CMD -p daemon.notice "$1" +</WRAP>
-}+
  
 +===Chiffrer un message===
  
-########## SETTINGS +Pour chiffrer un message, il faut disposer de la clef publique du destinataire du message. Ce dernier utilisera ensuite sa clef privée pour déchiffrer le message. Il convient de préciser le destinataire du message, ou plus précisément la clef publique à utiliser, lors d'un chiffrement :
-########## ========+
  
-# PRIVATE_SUBDIR defines a subdirectory of the feed data directory +    gpg --recipient <destinataire> --encrypt <message>
-# where files not part of the feed or database will not be deleted by rsync. +
-if [ -z "$PRIVATE_SUBDIR"+
-then +
-  PRIVATE_SUBDIR="private" +
-fi+
  
-# RSYNC_DELETE controls whether files which are not part of the repository will +  * //<destinataire>// représente toute information permettant de distinguer sans ambigüité une clef publique dans votre trousseauCette information peut-être le nom ou l'adresse email associé à la clef publique que vous voulez utiliser,  
-# be removed from the local directory after synchronizationThe default value +  * //<message>// représente le message à chiffrer.
-# for this setting is +
-# "--delete --exclude feed.xml --exclude $PRIVATE_SUBDIR/"+
-# which means that files which are not part of the feed, feed info or private +
-# directory will be deleted. +
-RSYNC_DELETE="--delete --exclude feed.xml --exclude \"$PRIVATE_SUBDIR/\""+
  
-# RSYNC_SSH_OPTS contains options which should be passed to ssh for the rsync +Par exemple pour chiffrer un message en mode binaire, il convient de saisir la commande suivante :
-# connection to the repository. +
-RSYNC_SSH_OPTS="-o \"UserKnownHostsFile=/dev/null\" -o \"StrictHostKeyChecking=no\""+
  
-# RSYNC_COMPRESS specifies the compression level to use for the rsync connection. +<code> 
-RSYNC_COMPRESS="--compress-level=9"+root@debian12:~# gpg --recipient ITTRAINING --encrypt message.txt
  
-PORT controls the outgoing TCP port for updates. If PAT/Port-Translation is +root@debian12:~ls -l | grep message 
-# not used, this should be "24"For some application layer firewalls or gates +-rw-r--r-- 1 root    root         55 Nov 28 13:28 message.txt 
-# the value 22 (Standard SSH) is usefulOnly change if you know what you are +-rw-r--r-- 1 root    root        795 Nov 28 13:33 message.txt.asc 
-# doing+-rw-r--r-- 1 root    root        510 Nov 28 13:35 message.txt.gpg 
-PORT=24+-rw-r--r-- 1 root    root        461 Nov 28 13:28 message.txt.sig
  
-SCRIPT_NAME is the name the scripts will use to identify itself and to mark +root@debian12:~cat message.txt.gpg 
-# log messages+ӛS4 
-SCRIPT_NAME="greenbone-feed-sync"+   t>25H@H:x+H  n֩ˁ+B.^2Zھ~~~´4sd27J    ~:W^}ĀzmI]/e=kS׈n9tȘQ=Cj5{Q 
 +                                                                   #0 @qw,\[B$(:BU舏9^8_Qa  
 +                                                                                             e^4,鹫     k/Pj#y:j~PU(}K#tTT-AZu  1z!%]t{ 
 +                                                                                                                                        5?"a5Vdnn$\V#(ctWhce6/-qThy^Ъmk-$$Dn 
 +                                                                                                                                                                            ^&Mw.*ԬYrɺޕr}o/Q[X_)Wr?U0gMV,">9Croot@debian12:~# 
 +</code>
  
-# LOG_CMD defines the command to use for logging. To have logger log to stderr +Et pour chiffrer un message en mode asciiil convient de saisir la commande suivante :
-# as well as syslogadd "-s" here. +
-LOG_CMD="logger -t $SCRIPT_NAME"+
  
-LOCK_FILE is the name of the file used to lock the feed during sync or update+<code> 
-if [ -z "$LOCK_FILE"+root@debian12:~gpg --recipient ITTRAINING --armor --encrypt message.txt 
-then +File 'message.txt.asc' exists. Overwrite? (y/N) y
-  LOCK_FILE="@GVM_FEED_LOCK_PATH@" +
-fi+
  
 +root@debian12:~# ls -l | grep message
 +-rw-r--r-- 1 root    root         55 Nov 28 13:28 message.txt
 +-rw-r--r-- 1 root    root        752 Nov 28 13:38 message.txt.asc
 +-rw-r--r-- 1 root    root        510 Nov 28 13:36 message.txt.gpg
 +-rw-r--r-- 1 root    root        461 Nov 28 13:28 message.txt.sig
  
-########## GLOBAL VARIABLES +root@debian12:~cat message.txt.asc 
-########## ================+-----BEGIN PGP MESSAGE-----
  
-VERSION=@GVMD_VERSION@+hQGMA9ObUzTZ86GvAQwAxAGoxKHBMh53+bPqHs338vhWjxAZs19aItMm+CM2pKu5 
 +i4euJ36o+oVfbVTcqVNh4Q8I72QTOYTRTeXRWaUtVjp055A07BtlxGPbps9GXkVv 
 +1faIs8viwHF1FHDC3Iz/SSf7u7tSF6sxbU6B4c/fHPneKjUxesH0XmKjduEdpDPj 
 +ylZxPngzTOR4RDbMbkZ5OvJKXNrOOiHUSDOMmI9o9nu7sxnMiPP3NUqilN/0NtFz 
 +xveV/mqDOEHT7Q1IHR+kN0e7WHqCl4NOvh0BXhL5u+9m18pgRe6ZvC6E94e+yPxZ 
 +21umlYbcIPtw87+h9twBj7vK5FUi7j8C5QWoDoM4XERf/v21A1fTlx2cDn8E1lOC 
 +dTaZlgTtxM3CY7/iWlG7TXWfUQfdZWhf/Mz1bHguljeOqVMGTI/zCElDnS3Ezzhg 
 +bIlrpLbs6yqtjant1bkZ5PuNhB1bRNxrSKZUZKdEMeY5M+C0GjKskjN84+OqgjRV 
 +39GkfPDwqw/eBj0ldvc60m0B5H2ZIIRApWl4j9RGhe2ZbvS+ZmI2vSf75RPDcNyH 
 +PKDwHyTKCGN3NQKOIrw9LbIXehYEdrdFwGizGUXba1EWwVs+qMsmFueoQfcvA19N 
 +CJ2HPuO3qAVIDpYyX+vwdKQASbb8AMQIIksoQv7i 
 +=481C 
 +-----END PGP MESSAGE----- 
 +</code>
  
-[ -r "@GVM_SYSCONF_DIR@/greenbone-feed-sync.conf" ] && . "@GVM_SYSCONF_DIR@/greenbone-feed-sync.conf"+Pour décrypter un message il convient d'utiliser la commande suivante :
  
-if [ -z "$DROP_USER" ]; then +<code> 
-  DROP_USER="@GVM_DEFAULT_DROP_USER@+root@debian12:~# gpg --decrypt message.txt.asc 
-fi+gpg: encrypted with 3072-bit RSA key, ID D39B5334D9F3A1AF, created 2025-11-28 
 +      "ITTRAINING (Test key) <infos@ittraining.team>
 +# ~/message.txt 
 +Ceci est un message de test pour GnuPG 
 +</code>
  
-ACCESSKEY="@GVM_ACCESS_KEY_DIR@/gsf-access-key"+=====LAB #3 Mise en place de SSH et SCP=====
  
-# Note when running as root or restart as $DROP_USER if defined +====3.1 Introduction====
-if [ $(id -u) -eq 0 ] +
-then +
-  if [ -z "$DROP_USER"+
-  then +
-    log_notice "Running as root" +
-  else +
-    log_notice "Started as root, restarting as $DROP_USER" +
-    su --shell /bin/sh --command "$0 $*" "$DROP_USER" +
-    exit $? +
-  fi +
-fi+
  
-# Determine whether a GSF access key is present. If yes, +La commande **[[wpfr>Ssh|ssh]]** est le successeur et la remplaçante de la commande **[[wpfr>Rlogin|rlogin]]**. Il permet d'établir des connexions sécurisées avec une machine distante. SSH comporte cinq acteurs :
-# then use the Greenbone Security Feed. Else use the +
-# Greenbone Community Feed. +
-if -e $ACCESSKEY ] +
-then +
-  RESTRICTED=1+
  
-  if [ -z "$FEED_VENDOR" ]; then +  * Le **serveur SSH** 
-    FEED_VENDOR="Greenbone Networks GmbH" +    * le démon sshd, qui s'occupe des authentifications et autorisations des clients,  
-  fi+  * Le **client SSH** 
 +    * ssh ou scp, qui assure la connexion et le dialogue avec le serveur, 
 +  * La **session** qui représente la connexion courante et qui commence juste après l'authentification réussie, 
 +  * Les **clefs** 
 +    * **Couple de clef utilisateur asymétriques** et persistantes qui assurent l'identité d'un utilisateur et qui sont stockés sur disque dur, 
 +    * **Clef hôte asymétrique et persistante** garantissant l'identité du serveur er qui est conservé sur disque dur 
 +    * **Clef serveur asymétrique et temporaire** utilisée par le protocole SSH1 qui sert au chiffrement de la clé de session, 
 +    * **Clef de session symétrique qui est générée aléatoirement** et qui permet le chiiffrement de la communication entre le client et le serveur. Elle est détruite en fin de session. SSH-1 utilise une seule clef tandis que SSH-2 utilise une clef par direction de la communication, 
 +  * La **base de données des hôtes connus** qui stocke les clés des connexions précédentes.
  
-  if [ -z "$FEED_HOME" ]; then +SSH fonctionne de la manière suivante pour la la mise en place d'un canal sécurisé:
-    FEED_HOME="https://www.greenbone.net/en/security-feed/" +
-  fi+
  
-else +  * Le client contacte le serveur sur son port 22, 
-  RESTRICTED=0+  * Les client et le serveur échangent leur version de SSH. En cas de non-compatibilité de versions, l'un des deux met fin au processus, 
 +  * Le serveur SSH s'identifie auprès du client en lui fournissant : 
 +    * Sa clé hôte, 
 +    * Sa clé serveur, 
 +    * Une séquence aléatoire de huit octets à inclure dans les futures réponses du client, 
 +    * Une liste de méthodes de chiffrage, compression et authentification, 
 +  * Le client et le serveur produisent un identifiant identique, un haché MD5 long de 128 bits contenant la clé hôte, la clé serveur et la séquence aléatoire, 
 +  * Le client génère sa clé de session symétrique et la chiffre deux fois de suite, une fois avec la clé hôte du serveur et la deuxième fois avec la clé serveur. Le client envoie cette clé au serveur accompagnée de la séquence aléatoire et un choix d'algorithmes supportés, 
 +  * Le serveur déchiffre la clé de session, 
 +  * Le client et le serveur mettent en place le canal sécurisé.
  
-  if [ -z "$FEED_VENDOR" ]; then +===SSH-1===
-    FEED_VENDOR="Greenbone Networks GmbH" +
-  fi+
  
-  if -z "$FEED_HOME" ]; then +SSH-1 utilise une paire de clefs de type RSA1. Il assure l'intégrité des données par une **[[wpfr>Contrôle_de_redondance_cyclique|Contrôle de Redondance Cyclique]]** (CRC) et est un bloc dit **monolithique**.
-    FEED_HOME="https://community.greenbone.net/t/about-greenbone-community-feed-gcf/1224" +
-  fi+
  
-fi+Afin de s'identifier, le client essaie chacune des six méthodes suivantes :
  
-RSYNC=`command -v rsync`+  * **Kerberos**, 
 +  * **Rhosts**, 
 +  * **%%RhostsRSA%%**, 
 +  * Par **clef asymétrique**, 
 +  * **TIS**, 
 +  * Par **mot de passe**.
  
-# Current supported feed types (for --type parameter) +===SSH-2===
-FEED_TYPES_SUPPORTED="CERT, SCAP or GVMD_DATA"+
  
-########## FUNCTIONS +SSH-2 utilise **DSA**,  **RSA**, **ecdsa** ou **ed25519**. Il assure l'intégrité des données par l'algorithme **HMAC**. SSH-2 est organisé en trois **couches** :
-########## =========+
  
-log_debug () { +  * **SSH-TRANS** – Transport Layer Protocol, 
-  $LOG_CMD -p daemon.debug "$1" +  * **SSH-AUTH** – Authentification Protocol, 
-}+  * **SSH-CONN** – Connection Protocol.
  
-log_info () { +SSH-2 diffère de SSH-1 essentiellement dans la phase authentification. 
-  $LOG_CMD -p daemon.info "$1+
-}+
  
-log_warning () { +Trois méthodes d'authentification :
-  $LOG_CMD -p daemon.warning "$1" +
-}+
  
-log_err () { +  * Par **clef asymétrique**, 
-  $LOG_CMD -p daemon.err "$1" +    * Identique à SSH-1 sauf avec l'algorithme **DSA**, **ecdsa** ou **ed25519**, 
-}+  * **%%RhostsRSA%%**, 
 +  * Par **mot de passe**.
  
-init_feed_type () { +===L'authentification par mot de passe===
-  if [ -z "$FEED_TYPE"+
-  then +
-    echo "No feed type given to --type parameter" +
-    log_err "No feed type given to --type parameter" +
-    exit 1 +
-  elif [ "CERT" "$FEED_TYPE"+
-  then +
-    [ -r "@GVM_SYSCONF_DIR@/greenbone-certdata-sync.conf" ] && . "@GVM_SYSCONF_DIR@/greenbone-certdata-sync.conf"+
  
-    FEED_TYPE_LONG="CERT data" +L'utilisateur fournit un mot de passe au client ssh. Le client ssh le transmet de façon sécurisée au serveur ssh puis  le serveur vérifie le mot de passe et l'accepte ou non.
-    FEED_DIR="@GVM_CERT_DATA_DIR@" +
-    TIMESTAMP="$FEED_DIR/timestamp" +
-    SCRIPT_ID="CERTSYNC"+
  
-    if [ -z "$COMMUNITY_CERT_RSYNC_FEED" ]; then +Avantage
-      COMMUNITY_RSYNC_FEED="rsync://feed.community.greenbone.net:/cert-data" +  * Aucune configuration de clef asymétrique n'est nécessaire.
-      # An alternative syntax which might work if the above doesn't: +
-      # COMMUNITY_RSYNC_FEED="rsync@feed.community.greenbone.net::cert-data" +
-    else +
-      COMMUNITY_RSYNC_FEED="$COMMUNITY_CERT_RSYNC_FEED" +
-    fi+
  
-    GSF_RSYNC_PATH="/cert-data"+Inconvénients: 
 +  * L'utilisateur doit fournir à chaque connexion un identifiant et un mot de passe, 
 +  * Moins sécurisé qu'un système par clef asymétrique.
  
-    if [ -e $ACCESSKEY ]; then +===L'authentification par clef asymétrique===
-      if [ -z "$FEED_NAME" ]; then +
-        FEED_NAME="Greenbone CERT Feed" +
-      fi +
-    else +
-      if [ -z "$FEED_NAME" ]; then +
-        FEED_NAME="Greenbone Community CERT Feed" +
-      fi +
-    fi +
-  elif [ "SCAP" "$FEED_TYPE"+
-  then +
-    [ -r "@GVM_SYSCONF_DIR@/greenbone-scapdata-sync.conf" ] && . "@GVM_SYSCONF_DIR@/greenbone-scapdata-sync.conf"+
  
-    FEED_TYPE_LONG="SCAP data" +  * Le **client** envoie au serveur une requête d'authentification par clé asymétrique qui contient le module de la clé à utiliser, 
-    FEED_DIR="@GVM_SCAP_DATA_DIR@" +  * Le **serveur** recherche une correspondance pour ce module dans le fichier des clés autorisés **~/.ssh/authorized_keys**, 
-    TIMESTAMP="$FEED_DIR/timestamp" +    * Dans le cas où une correspondance n'est pas trouvée, le serveur met fin à la communication, 
-    SCRIPT_ID="SCAPSYNC"+    * Dans le cas contraire le serveur génère une chaîne aléatoire de 256 bits appelée un **challenge** et la chiffre avec la **clé publique du client**, 
 +  * Le **client** reçoit le challenge et le décrypte avec la partie privée de sa clé. Il combine le challenge avec l'identifiant de session et chiffre le résultat. Ensuite il envoie le résultat chiffré au serveur. 
 +  * Le **serveur** génère le même haché et le compare avec celui reçu du client. Si les deux hachés sont identiques, l'authentification est réussie.
  
-    if [ -z "$COMMUNITY_SCAP_RSYNC_FEED" ]; then +====3.Configuration du Serveur====
-      COMMUNITY_RSYNC_FEED="rsync://feed.community.greenbone.net:/scap-data" +
-      # An alternative syntax which might work if the above doesn't: +
-      # COMMUNITY_RSYNC_FEED="rsync@feed.community.greenbone.net::scap-data" +
-    else +
-      COMMUNITY_RSYNC_FEED="$COMMUNITY_SCAP_RSYNC_FEED" +
-    fi+
  
-    GSF_RSYNC_PATH="/scap-data"+La configuration du serveur s'effectue dans le fichier **/etc/ssh/sshd_config** :
  
-    if [ -e $ACCESSKEY ]; then +<code> 
-      if [ -z "$FEED_NAME" ]; then +root@debian12:~# cat /etc/ssh/sshd_config
-        FEED_NAME="Greenbone SCAP Feed" +
-      fi +
-    else +
-      if [ -z "$FEED_NAME" ]; then +
-        FEED_NAME="Greenbone Community SCAP Feed" +
-      fi +
-    fi +
-  elif [ "GVMD_DATA" = "$FEED_TYPE"+
-  then +
-    [ -r "@GVM_SYSCONF_DIR@/greenbone-data-objects-sync.conf" ] && . "@GVM_SYSCONF_DIR@/greenbone-data-objects-sync.conf"+
  
-    FEED_TYPE_LONG="gvmd Data" +# This is the sshd server system-wide configuration file.  See 
-    FEED_DIR="@GVMD_FEED_DIR@" +# sshd_config(5) for more information.
-    TIMESTAMP="$FEED_DIR/timestamp" +
-    SCRIPT_ID="GVMD_DATA_SYNC"+
  
-    if [ -z "$COMMUNITY_GVMD_DATA_RSYNC_FEED" ]; then +# This sshd was compiled with PATH=/usr/local/bin:/usr/bin:/bin:/usr/games
-      COMMUNITY_RSYNC_FEED="rsync://feed.community.greenbone.net:/data-objects/gvmd/+
-      # An alternative syntax which might work if the above doesn't: +
-      # COMMUNITY_RSYNC_FEED="rsync@feed.community.greenbone.net::data-objects/gvmd/+
-    else +
-      COMMUNITY_RSYNC_FEED="$COMMUNITY_GVMD_DATA_RSYNC_FEED" +
-    fi+
  
-    GSF_RSYNC_PATH="/data-objects/gvmd/"+# The strategy used for options in the default sshd_config shipped with 
 +# OpenSSH is to specify options with their default value where 
 +# possible, but leave them commented.  Uncommented options override the 
 +# default value.
  
-    if [ -e $ACCESSKEY ]; then +Include /etc/ssh/sshd_config.d/*.conf
-      if [ -z "$FEED_NAME" ]; then +
-        FEED_NAME="Greenbone gvmd Data Feed" +
-      fi +
-    else +
-      if [ -z "$FEED_NAME" ]; then +
-        FEED_NAME="Greenbone Community gvmd Data Feed" +
-      fi +
-    fi +
-  else +
-    echo "Invalid feed type $FEED_TYPE given to --type parameterCurrently supported: $FEED_TYPES_SUPPORTED" +
-    log_err "Invalid feed type $FEED_TYPE given to --type parameterCurrently supported: $FEED_TYPES_SUPPORTED" +
-    exit 1 +
-  fi +
-}+
  
-write_feed_xml () { +#Port 22 
-  if [ -r $TIMESTAMP ] +#AddressFamily any 
-  then +#ListenAddress 0.0.0.
-    FEED_VERSION=`cat $TIMESTAMP` +#ListenAddress ::
-  else +
-    FEED_VERSION=+
-  fi+
  
-  mkdir -p $FEED_DIR +#HostKey /etc/ssh/ssh_host_rsa_key 
-  echo '<feed id="6315d194-4b6a-11e7-a570-28d24461215b">' > $FEED_DIR/feed.xml +#HostKey /etc/ssh/ssh_host_ecdsa_key 
-  echo "<type>$FEED_TYPE</type>" >> $FEED_DIR/feed.xml +#HostKey /etc/ssh/ssh_host_ed25519_key
-  echo "<name>$FEED_NAME</name>" >> $FEED_DIR/feed.xml +
-  echo "<version>$FEED_VERSION</version>" >> $FEED_DIR/feed.xml +
-  echo "<vendor>$FEED_VENDOR</vendor>" >> $FEED_DIR/feed.xml +
-  echo "<home>$FEED_HOME</home>" >> $FEED_DIR/feed.xml +
-  echo "<description>" >> $FEED_DIR/feed.xml +
-  echo "This script synchronizes a $FEED_TYPE collection with the '$FEED_NAME'." >> $FEED_DIR/feed.xml +
-  echo "The '$FEED_NAME' is provided by '$FEED_VENDOR'." >> $FEED_DIR/feed.xml +
-  echo "Online information about this feed: '$FEED_HOME'." >> $FEED_DIR/feed.xml +
-  echo "</description>" >> $FEED_DIR/feed.xml +
-  echo "</feed>" >> $FEED_DIR/feed.xml +
-}+
  
-create_tmp_key () { +# Ciphers and keying 
-  KEYTEMPDIR=`mktemp -d` +#RekeyLimit default none
-  cp "$ACCESSKEY" "$KEYTEMPDIR" +
-  TMPACCESSKEY="$KEYTEMPDIR/gsf-access-key" +
-  chmod 400 "$TMPACCESSKEY" +
-}+
  
-remove_tmp_key () { +# Logging 
-  rm -rf "$KEYTEMPDIR" +#SyslogFacility AUTH 
-}+#LogLevel INFO
  
-set_interrupt_trap () { +# Authentication:
-  trap "handle_interrupt $1" 2 +
-}+
  
-handle_interrupt () { +#LoginGraceTime 2m 
-  echo "$1:X" >&3 +#PermitRootLogin prohibit-password 
-}+#StrictModes yes 
 +#MaxAuthTries 6 
 +#MaxSessions 10
  
-do_describe () { +#PubkeyAuthentication yes
-  echo "This script synchronizes a $FEED_TYPE collection with the '$FEED_NAME'." +
-  echo "The '$FEED_NAME' is provided by '$FEED_VENDOR'." +
-  echo "Online information about this feed: '$FEED_HOME'." +
-}+
  
-do_feedversion () { +# Expect .ssh/authorized_keys2 to be disregarded by default in future. 
-  if [ -r $TIMESTAMP ]; then +#AuthorizedKeysFile     .ssh/authorized_keys .ssh/authorized_keys2
-      cat $TIMESTAMP +
-  fi +
-}+
  
-This function uses gos-state-manager to get information about the settings. +#AuthorizedPrincipalsFile none
-# gos-state-manager is only available on a Greenbone OS. +
-# If gos-state-manager is missing the settings values can not be retrieved. +
-+
-# Input: option +
-# Output: value as string or empty String if gos-state-manager is not installed +
-#         or option not set +
-get_value () +
-+
-  value="" +
-  key=$1 +
-  if which gos-state-manager 1>/dev/null 2>&+
-  then +
-    if gos-state-manager get "$key.value" 1>/dev/null 2>&+
-    then +
-      value="$(gos-state-manager get "$key.value")" +
-    fi +
-  fi +
-  echo "$value" +
-}+
  
-is_feed_current () { +#AuthorizedKeysCommand none 
-  if [ -r $TIMESTAMP ] +#AuthorizedKeysCommandUser nobody
-  then +
-    FEED_VERSION=`cat $TIMESTAMP` +
-  fi+
  
-  if [ -z "$FEED_VERSION" ] +# For this to work you will also need host keys in /etc/ssh/ssh_known_hosts 
-  then +#HostbasedAuthentication no 
-    log_warning "Could not determine feed version." +# Change to yes if you don't trust ~/.ssh/known_hosts for 
-    FEED_CURRENT=0 +# HostbasedAuthentication 
-    return $FEED_CURRENT +#IgnoreUserKnownHosts no 
-  fi+# Don't read the user's ~/.rhosts and ~/.shosts files 
 +#IgnoreRhosts yes
  
-  FEED_INFO_TEMP_DIR=`mktemp -d`+# To disable tunneled clear text passwords, change to no here! 
 +#PasswordAuthentication yes 
 +#PermitEmptyPasswords no
  
-  if [ -e $ACCESSKEY ] +# Change to yes to enable challenge-response passwords (beware issues with 
-  then +# some PAM modules and threads) 
-    read feeduser < $ACCESSKEY +KbdInteractiveAuthentication no
-    custid_at_host=`head -1 $ACCESSKEY | cut -d : -f 1`+
  
-    if [ -z "$feeduser" ] || [ -z "$custid_at_host" ] +# Kerberos options 
-    then +#KerberosAuthentication no 
-      log_err "Could not determine credentials, aborting synchronization." +#KerberosOrLocalPasswd yes 
-      rm -rf "$FEED_INFO_TEMP_DIR" +#KerberosTicketCleanup yes 
-      exit 1 +#KerberosGetAFSToken no
-    fi+
  
-    gsmproxy=$(get_value proxy_feed | sed -r -e 's/^.*\/\///' -e 's/:([0-9]+)$/ \1/') +# GSSAPI options 
-    syncport=$(get_value syncport) +#GSSAPIAuthentication no 
-    if [ "$syncport" ] +#GSSAPICleanupCredentials yes 
-    then +#GSSAPIStrictAcceptorCheck yes 
-      PORT="$syncport" +#GSSAPIKeyExchange no
-    fi+
  
-    if [ -z "$gsmproxy" ] || [ "$gsmproxy" = "proxy_feed" ] +# Set this to 'yes' to enable PAM authentication, account processing, 
-    then +# and session processing. If this is enabled, PAM authentication will 
-      RSYNC_SSH_PROXY_CMD="" +# be allowed through the KbdInteractiveAuthentication and 
-    else +# PasswordAuthentication.  Depending on your PAM configuration, 
-      if [ -e $GVM_SYSCONF_DIR/proxyauth ] && [ -r $GVM_SYSCONF_DIR/proxyauth ]; then +# PAM authentication via KbdInteractiveAuthentication may bypass 
-        RSYNC_SSH_PROXY_CMD="-o \"ProxyCommand corkscrew $gsmproxy %h %p $GVM_SYSCONF_DIR/proxyauth\"" +# the setting of "PermitRootLogin prohibit-password". 
-      else +If you just want the PAM account and session checks to run without 
-        RSYNC_SSH_PROXY_CMD="-o \"ProxyCommand corkscrew $gsmproxy %h %p\"" +PAM authentication, then enable this but set PasswordAuthentication 
-      fi +# and KbdInteractiveAuthentication to 'no'
-    fi +UsePAM yes
-    create_tmp_key +
-    rsync -e "ssh $RSYNC_SSH_OPTS $RSYNC_SSH_PROXY_CMD -p $PORT -i $TMPACCESSKEY" -ltvrP --chmod=D+x $RSYNC_DELETE $RSYNC_COMPRESS $custid_at_host:$GSF_RSYNC_PATH/timestamp "$FEED_INFO_TEMP_DIR" +
-    if [ $? -ne 0 ] +
-    then +
-      log_err "rsync failed, aborting synchronization." +
-      rm -rf "$FEED_INFO_TEMP_DIR" +
-      remove_tmp_key +
-      exit 1 +
-    fi +
-    remove_tmp_key +
-  else +
-    Sleep for five seconds (a previous feed might have been synced a few seconds before) to prevent +
-    IP blocking due to network equipment in between keeping the previous connection too long open. +
-    sleep 5 +
-    log_notice "No Greenbone Security Feed access key foundfalling back to Greenbone Community Feed" +
-    eval "$RSYNC -ltvrP \"$COMMUNITY_RSYNC_FEED/timestamp\" \"$FEED_INFO_TEMP_DIR\"" +
-    if [ $? -ne 0 ] +
-    then +
-      log_err "rsync failed, aborting synchronization." +
-      rm -rf "$FEED_INFO_TEMP_DIR" +
-      exit 1 +
-    fi +
-  fi+
  
-  FEED_VERSION_SERVER=`cat "$FEED_INFO_TEMP_DIR/timestamp"`+#AllowAgentForwarding yes 
 +#AllowTcpForwarding yes 
 +#GatewayPorts no 
 +X11Forwarding yes 
 +#X11DisplayOffset 10 
 +#X11UseLocalhost yes 
 +#PermitTTY yes 
 +PrintMotd no 
 +#PrintLastLog yes 
 +#TCPKeepAlive yes 
 +#PermitUserEnvironment no 
 +#Compression delayed 
 +#ClientAliveInterval 0 
 +#ClientAliveCountMax 3 
 +#UseDNS no 
 +#PidFile /run/sshd.pid 
 +#MaxStartups 10:30:100 
 +#PermitTunnel no 
 +#ChrootDirectory none 
 +#VersionAddendum none
  
-  if [ -z "$FEED_VERSION_SERVER" ] +# no default banner path 
-  then +#Banner none
-    log_err "Could not determine server feed version." +
-    rm -rf "$FEED_INFO_TEMP_DIR" +
-    exit 1 +
-  fi+
  
-  Check against FEED_VERSION +Allow client to pass locale environment variables 
-  if [ $FEED_VERSION -lt $FEED_VERSION_SERVER ]; then +AcceptEnv LANG LC_*
-    FEED_CURRENT=0 +
-  else +
-    FEED_CURRENT=1 +
-  fi+
  
-  Cleanup +override default of no subsystems 
-  rm -rf "$FEED_INFO_TEMP_DIR"+Subsystem       sftp    /usr/lib/openssh/sftp-server
  
-  return $FEED_CURRENT +# Example of overriding settings on a per-user basis 
-}+#Match User anoncvs 
 +#       X11Forwarding no 
 +#       AllowTcpForwarding no 
 +#       PermitTTY no 
 +#       ForceCommand cvs server 
 +</code>
  
-do_help () { +Pour ôter les lignes de commentaires dans ce fichier, utilisez la commande suivante :
-  echo "$0Sync feed data"+
  
-  if [ -$ACCESSKEY ] +<code> 
-  then +root@debian12:~# cd /tmp ; grep -E -v '^(#|$)'  /etc/ssh/sshd_config > sshd_config
-    echo "GSF access key found: Using Greenbone Security Feed" +
-  else +
-    echo "No GSF access key found: Using Community Feed" +
-  fi+
  
-  echo " --describe      display current feed info" +root@debian12:/tmp# cat sshd_config 
-  echo " --feedversion   display version of this feed" +Include /etc/ssh/sshd_config.d/*.conf 
-  echo " --help          display this help" +KbdInteractiveAuthentication no 
-  echo " --identify      display information" +UsePAM yes 
-  echo " --selftest      perform self-test" +X11Forwarding yes 
-  echo " --type <TYPE  choose type of data to sync ($FEED_TYPES_SUPPORTED)" +PrintMotd no 
-  echo " --version       display version" +AcceptEnv LANG LC_* 
-  echo "" +Subsystem       sftp    /usr/lib/openssh/sftp-server 
-  exit 0 +</code>
-}+
  
-do_rsync_community_feed () { +Pour sécuriser le serveur ssh, ajoutez ou modifiez les directives suivantes :
-  if [ -z "$RSYNC" ]; then +
-    log_err "rsync not found!" +
-  else +
-    # Sleep for five seconds (after is_feed_current) to prevent IP blocking due to +
-    # network equipment in between keeping the previous connection too long open. +
-    sleep 5 +
-    log_notice "Using rsync$RSYNC" +
-    log_notice "Configured $FEED_TYPE_LONG rsync feed: $COMMUNITY_RSYNC_FEED" +
-    mkdir -p "$FEED_DIR" +
-    eval "$RSYNC -ltvrP $RSYNC_DELETE \"$COMMUNITY_RSYNC_FEED\" \"$FEED_DIR\"" +
-    if [ $? -ne 0 ]; then +
-      log_err "rsync failed. Your $FEED_TYPE_LONG might be broken now." +
-      exit 1 +
-    fi +
-  fi +
-}+
  
-do_sync_community_feed () { +<file> 
-  if [ -z "$RSYNC" ]; then +AllowGroups adm 
-    log_err "rsync not found!" +Banner /etc/issue.net 
-    log_err "No utility available in PATH environment variable to download Feed data" +HostbasedAuthentication no 
-    exit 1 +IgnoreRhosts yes 
-  else +LoginGraceTime 60 
-    log_notice "Will use rsync" +LogLevel INFO 
-    do_rsync_community_feed +PermitEmptyPasswords no 
-  fi +PermitRootLogin no 
-}+PrintLastLog yes 
 +Protocol 2 
 +StrictModes yes 
 +X11Forwarding no 
 +</file>
  
-sync_feed_data(){ +Votre fichier ressemblera à celui-ci :
-  if [ -e $ACCESSKEY ] +
-  then +
-    log_notice "Found Greenbone Security Feed subscription file, trying to synchronize with Greenbone $FEED_TYPE_LONG Repository ..." +
-    notsynced=1+
  
-    mkdir -p "$FEED_DIR" +<code> 
-    read feeduser $ACCESSKEY +root@debian12:/tmp# cat sshd_config 
-    custid_at_host=`head -1 $ACCESSKEY | cut -d : -f 1`+Include /etc/ssh/sshd_config.d/*.conf 
 +KbdInteractiveAuthentication no 
 +UsePAM yes 
 +PrintMotd no 
 +AcceptEnv LANG LC_* 
 +AllowGroups adm 
 +HostbasedAuthentication no 
 +IgnoreRhosts yes 
 +LoginGraceTime 60 
 +LogLevel INFO 
 +PermitEmptyPasswords no 
 +PermitRootLogin no 
 +PrintLastLog yes 
 +Protocol 2 
 +StrictModes yes 
 +X11Forwarding no 
 +Subsystem       sftp    /usr/lib/openssh/sftp-server 
 +</code>
  
-    if [ -z "$feeduser" ] || [ -z "$custid_at_host"+Mettez l'utilisateur **trainee** dans le groupe **adm**
-    then +
-      log_err "Could not determine credentials, aborting synchronization." +
-      exit 1 +
-    fi+
  
-    while [ 0 -ne "$notsynced" ] +<code> 
-    do+root@debian12:/tmp# groups trainee 
 +trainee : trainee cdrom floppy audio dip video plugdev netdev lpadmin scanner vboxusers
  
-      gsmproxy=$(get_value proxy_feed | sed -r -e 's/^.*\/\///' -e 's/:([0-9]+)$/ \1/'+root@debian12:/tmp# usermod --G adm trainee
-      syncport=$(get_value syncport) +
-      if [ "$syncport"+
-      then +
-        PORT="$syncport" +
-      fi+
  
-      if [ -z "$gsmproxy" ] || [ "$gsmproxy" = "proxy_feed"+root@debian12:/tmp# groups trainee 
-      then +trainee : trainee adm cdrom floppy audio dip video plugdev netdev lpadmin scanner vboxusers 
-        RSYNC_SSH_PROXY_CMD="" +</code>
-      else +
-        if [ -e $GVM_SYSCONF_DIR/proxyauth ] && [ -r $GVM_SYSCONF_DIR/proxyauth ]; then +
-          RSYNC_SSH_PROXY_CMD="-o \"ProxyCommand corkscrew $gsmproxy %h %p $GVM_SYSCONF_DIR/proxyauth\"" +
-        else +
-          RSYNC_SSH_PROXY_CMD="-o \"ProxyCommand corkscrew $gsmproxy %h %p\"" +
-        fi +
-      fi +
-      create_tmp_key +
-      rsync -e "ssh $RSYNC_SSH_OPTS $RSYNC_SSH_PROXY_CMD -p $PORT -i $ACCESSKEY" -ltvrP --chmod=D+x $RSYNC_DELETE $RSYNC_COMPRESS $custid_at_host:$GSF_RSYNC_PATH$FEED_DIR +
-      if [ 0 -ne "$?" ]; then +
-        log_err "rsync failed, aborting synchronization." +
-        remove_tmp_key +
-        exit 1 +
-      fi +
-      remove_tmp_key +
-      notsynced=0 +
-    done +
-    log_notice "Synchronization with the Greenbone $FEED_TYPE_LONG Repository successful." +
-  else +
-    log_notice "No Greenbone Security Feed access key found, falling back to Greenbone Community Feed" +
-    do_sync_community_feed +
-  fi+
  
-  write_feed_xml +Renommez le fichier **/etc/ssh/sshd_config** en **/etc/ssh/sshd_config.old** puis copiez le fichier **/tmp/sshd_config** vers **/etc/ssh/** :
-}+
  
-do_self_test () { +<code> 
-  if [ -z "$SELFTEST_STDERR"+root@debian12:/tmp# mv /etc/ssh/sshd_config /etc/ssh/sshd_config.old
-  then +
-    SELFTEST_STDERR=0 +
-  fi+
  
-  if [ -z "$RSYNC" ] +root@debian12:/tmp# cp sshd_config /etc/ssh 
-  then +</code>
-    if [ 0 -ne $SELFTEST_STDERR ] +
-    then +
-      echo "rsync not found (required)." 1>&2 +
-    fi +
-    log_err "rsync not found (required)." +
-    SELFTEST_FAIL=1 +
-  fi +
-}+
  
 +Redémarrez ensuite le serveur ssh :
  
-########## START +<code> 
-########## =====+root@debian12:/tmpsystemctl restart ssh
  
-while test $# -gt 0do +root@debian12:/tmpsystemctl status ssh 
-  case "$1" in +● ssh.service OpenBSD Secure Shell server 
-    "--version"|"--identify"|"--describe"|"--feedversion"|"--selftest"|"--feedcurrent"+     Loaded: loaded (/lib/systemd/system/ssh.service; enabledpreset: enabled) 
-      if [ -z "$ACTION" ]then +     Active: active (running) since Fri 2025-11-28 15:18:55 CET7s ago 
-        ACTION="$1" +       Docs: man:sshd(8) 
-      fi +             man:sshd_config(5) 
-      ;; +    Process: 10882 ExecStartPre=/usr/sbin/sshd -t (code=exited, status=0/SUCCESS
-    "--help"+   Main PID: 10883 (sshd) 
-      do_help +      Tasks: 1 (limit: 19123) 
-      exit 0 +     Memory: 1.4M 
-      ;; +        CPU: 28ms 
-    "--type") +     CGroup: /system.slice/ssh.service 
-      FEED_TYPE=$(echo "$2" | tr '[:lower:]-' '[:upper:]_') +             └─10883 "sshd/usr/sbin/sshd -[listener0 of 10-100 startups"
-      shift +
-      ;; +
-  esac +
-  shift +
-done+
  
-init_feed_type+Nov 28 15:18:55 debian12 systemd[1]: Starting ssh.service - OpenBSD Secure Shell server... 
 +Nov 28 15:18:55 debian12 sshd[10883]: Server listening on 0.0.0.0 port 22. 
 +Nov 28 15:18:55 debian12 sshd[10883]: Server listening on :: port 22. 
 +Nov 28 15:18:55 debian12 systemd[1]: Started ssh.service - OpenBSD Secure Shell server. 
 +</code>
  
-write_feed_xml+Pour générer les clefs sur le serveur saisissez la commande suivante en tant que **root**:
  
-case "$ACTION" in +<WRAP center round important 50%> 
-  --version) +**Important** Lors de la génération de la clef, la passphrase doit être **vide**. 
-    echo $VERSION +</WRAP>
-    exit 0 +
-    ;; +
-  --identify) +
-    echo "$SCRIPT_ID|$SCRIPT_NAME|$VERSION|$FEED_NAME|$RESTRICTED|$SCRIPT_ID" +
-    exit 0 +
-    ;; +
-  --describe) +
-    do_describe +
-    exit 0 +
-    ;; +
-  --feedversion) +
-    do_feedversion +
-    exit 0 +
-    ;; +
-  --selftest) +
-    SELFTEST_FAIL=0 +
-    SELFTEST_STDERR=1 +
-    do_self_test +
-    exit $SELFTEST_FAIL +
-    ;; +
-  --feedcurrent) +
-    is_feed_current +
-    exit $? +
-    ;; +
-esac+
  
-SELFTEST_FAIL=0 +<code> 
-do_self_test +root@debian12:/tmp# ssh-keygen -t dsa 
-if [ $SELFTEST_FAIL -ne 0 ] +Generating public/private dsa key pair. 
-then +Enter file in which to save the key (/root/.ssh/id_dsa): /etc/ssh/ssh_host_dsa_key 
-  exit 1 +Enter passphrase (empty for no passphrase):  
-fi +Enter same passphrase again:  
- +Your identification has been saved in /etc/ssh/ssh_host_dsa_key 
-is_feed_current +Your public key has been saved in /etc/ssh/ssh_host_dsa_key.pub 
-if [ $FEED_CURRENT -eq 1 ] +The key fingerprint is: 
-then +SHA256:mP/fGCXEcyZQ+afGDrQK4S1TYVIw3pnBre25MPU2b3g root@debian12 
-  log_notice "Feed is already current, skipping synchronization." +The key's randomart image is: 
-  exit 0 ++---[DSA 1024]----+ 
-fi +|        o++o..   | 
-+|       ..o+*o    | 
-  chmod +660 $LOCK_FILE +|        .o++=.o  | 
-  flock -n 9 +|       o. o.+=. .| 
-  if [ $? -eq 1 ]; then +|      o.S+ +.=.o | 
-    log_notice "Sync in progress, exiting." +|       .= + =oB  | 
-    exit 1 +|        .+ +.* + | 
-  fi +|         .. .+o E| 
-  date > $LOCK_FILE +|          ..o .o | 
-  sync_feed_data ++----[SHA256]-----+
-  echo -n > $LOCK_FILE +
-) 9>>$LOCK_FILE +
- +
-exit 0+
 </code> </code>
  
-Rendez le script exécutable :+<WRAP center round important 50%> 
 +**Important** - Le chemin à indiquer pour le fichier est **/etc/ssh/ssh_host_dsa_key**. De la même façon, il est possible de générer les clefs au format **[[https://fr.wikipedia.org/wiki/Chiffrement_RSA|RSA]]**, **[[https://fr.wikipedia.org/wiki/Elliptic_curve_digital_signature_algorithm|ECDSA]]** et **[[https://fr.wikipedia.org/wiki/EdDSA|ED25519]]**.  
 +</WRAP> 
 + 
 +Les clefs publiques générées possèdent l'extension **.pub**. Les clefs privées n'ont pas d'extension :
  
 <code> <code>
-[root@centos7 ~]chmod +x greenbone-feed-sync+root@debian12:/tmpls /etc/ssh 
 +moduli      ssh_config.d  sshd_config.d    ssh_host_dsa_key      ssh_host_ecdsa_key      ssh_host_ed25519_key      ssh_host_rsa_key 
 +ssh_config  sshd_config   sshd_config.old  ssh_host_dsa_key.pub  ssh_host_ecdsa_key.pub  ssh_host_ed25519_key.pub  ssh_host_rsa_key.pub
 </code> </code>
  
-Déplacez le script vers **/usr/sbin/** :+Re-démarrez ensuite le service sshd :
  
 <code> <code>
-[root@centos7 ~]mv greenbone-feed-sync /usr/sbin/+root@debian12:/tmpsystemctl restart ssh
 </code> </code>
  
-Créez le répertoire **/var/lib/openvas/scap-data/** :+Saisissez maintenant les commandes suivantes en tant que **trainee** :
  
-<code+<WRAP center round important 50%
-[root@centos7 ~]# mkdir /var/lib/openvas/scap-data/ +**Important** Lors de la génération des clefs, la passphrase doit être **vide**. 
-</code> +</WRAP>
- +
-Devenez l'utilisateur trainee et mettez à jour les modules d'extensions de OpenVAS :+
  
 <code> <code>
-[root@centos7 ~]su - trainee +root@debian12:/tmpexit 
-Last login: Mon Dec  1 17:30:45 CET 2025 on pts/0+logout
  
-[trainee@centos7 ~]touch /var/lib/openvas/scap-data/scap.db+trainee@debian12:~$ ssh-keygen -t dsa 
 +Generating public/private dsa key pair. 
 +Enter file in which to save the key (/home/trainee/.ssh/id_dsa):  
 +Created directory '/home/trainee/.ssh'
 +Enter passphrase (empty for no passphrase):  
 +Enter same passphrase again:  
 +Your identification has been saved in /home/trainee/.ssh/id_dsa 
 +Your public key has been saved in /home/trainee/.ssh/id_dsa.pub 
 +The key fingerprint is: 
 +SHA256:97XNFS0p/j8IaR7sByO1jVTE3sP23l/qDRUwU9TFRpw trainee@debian12 
 +The key's randomart image is: 
 ++---[DSA 1024]----+ 
 +|            o=o**| 
 +|             o+E*| 
 +|            + =+.| 
 +|           + o *o| 
 +|        S = * o =| 
 +|         o % + =o| 
 +|          = * =.=| 
 +|           o o *+| 
 +|            ..o *| 
 ++----[SHA256]-----+
  
-[trainee@centos7 ~]greenbone-feed-sync --type SCAP +trainee@debian12:~$ ssh-keygen -t rsa 
-Greenbone community feed server - http://feed.community.greenbone.net+Generating public/private rsa key pair. 
-This service is hosted by Greenbone Networks - http://www.greenbone.net/+Enter file in which to save the key (/home/trainee/.ssh/id_rsa) 
 +Enter passphrase (empty for no passphrase):  
 +Enter same passphrase again:  
 +Your identification has been saved in /home/trainee/.ssh/id_rsa 
 +Your public key has been saved in /home/trainee/.ssh/id_rsa.pub 
 +The key fingerprint is: 
 +SHA256:p2xPZdoPCICy/D5x0g+nHilsV6Ar4UMwmHeRnHDnBQw trainee@debian12 
 +The key's randomart image is: 
 ++---[RSA 3072]----+ 
 +|  .oE=o..        | 
 +|.. .+=..         | 
 +|= o o +          | 
 +| = + . o         | 
 +|  = ..  S . o    | 
 +| o +o.++.+ *     | 
 +|  + *++=+ + o    | 
 +|   =.o.o.o     | 
 +|    .o.     
 ++----[SHA256]-----+
  
-All transactions are logged.+trainee@debian12:~$ ssh-keygen -t ecdsa 
 +Generating public/private ecdsa key pair. 
 +Enter file in which to save the key (/home/trainee/.ssh/id_ecdsa):  
 +Enter passphrase (empty for no passphrase):  
 +Enter same passphrase again:  
 +Your identification has been saved in /home/trainee/.ssh/id_ecdsa 
 +Your public key has been saved in /home/trainee/.ssh/id_ecdsa.pub 
 +The key fingerprint is: 
 +SHA256:zA3muePCJZ7SCIvuKe+X5veMqWpP0UTr6HAVv+LPBCo trainee@debian12 
 +The key's randomart image is: 
 ++---[ECDSA 256]---+ 
 +|      o          | 
 +|     . +         | 
 +|      + +        | 
 +|     * = =       | 
 +|  . + = S .      | 
 +|  .+ +.o..       | 
 +| .Eo+*.++        | 
 +|o +o* BO .       | 
 +|+B+*++oo*        | 
 ++----[SHA256]-----+
  
-If you have any questions, please use the Greenbone community portal.  +trainee@debian12:~$ ssh-keygen -t ed25519 
-See https://community.greenbone.net for details.+Generating public/private ed25519 key pair. 
 +Enter file in which to save the key (/home/trainee/.ssh/id_ed25519):  
 +Enter passphrase (empty for no passphrase) 
 +Enter same passphrase again:  
 +Your identification has been saved in /home/trainee/.ssh/id_ed25519 
 +Your public key has been saved in /home/trainee/.ssh/id_ed25519.pub 
 +The key fingerprint is: 
 +SHA256:f5GzguZoS5SN2EQDyj7zAqES+7PDOBSJRg+lD+vpn3Q trainee@debian12 
 +The key's randomart image is: 
 ++--[ED25519 256]--+ 
 +|  ....o          | 
 +| +.. . .         | 
 +|=o*            | 
 +|oO+. + +       | 
 +|*.=.. = S      | 
 +|o+.+ .       | 
 +|.=+..E. o o o    | 
 +|+ ++o..+       | 
 +| oo+ .o..        | 
 ++----[SHA256]-----+ 
 +</code>
  
-By using this service you agree to our terms and conditions.+<WRAP center round important 50%> 
 +**Important** - Les clés générées seront placées dans le répertoire **~/.ssh/**. 
 +</WRAP>
  
-Only one sync per time, otherwise the source ip will be temporarily blocked.+====3.3 - Utilisation====
  
 +La commande ssh prend la forme suivante:
  
-receiving incremental file list +  ssh -l nom_de_compte numero_ip (nom_de_machine)
-timestamp +
-             13 100%   12.70kB/   0:00:00 (xfr#1, to-chk=0/1)+
  
-sent 43 bytes  received 108 bytes  100.67 bytes/sec +En saisissant cette commande sur votre propre machine, vous obtiendrez un résultat similaire à celle-ci :
-total size is 13  speedup is 0.09 +
-Greenbone community feed server http://feed.community.greenbone.net/ +
-This service is hosted by Greenbone Networks - http://www.greenbone.net/+
  
-All transactions are logged.+<code> 
 +trainee@debian12:~$ su - 
 +Password: fenestros 
 +root@debian12:~#
  
-If you have any questions, please use the Greenbone community portal.  +root@debian12:~# ssh -l trainee localhost 
-See https://community.greenbone.net for details.+The authenticity of host 'localhost (::1)' can't be established
 +ED25519 key fingerprint is SHA256:SS9CpX7JFHIB54TWQWTtyswnwaXZ/Y8Kvr6dxPtisgE. 
 +This key is not known by any other names. 
 +Are you sure you want to continue connecting (yes/no/[fingerprint])? yes 
 +Warning: Permanently added 'localhost' (ED25519) to the list of known hosts. 
 +trainee@localhost's password:  
 +Linux debian12 6.1.0-41-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.158-1 (2025-11-09) x86_64
  
-By using this service you agree to our terms and conditions.+The programs included with the Debian GNU/Linux system are free software; 
 +the exact distribution terms for each program are described in the 
 +individual files in /usr/share/doc/*/copyright.
  
-Only one sync per timeotherwise the source ip will be temporarily blocked.+Debian GNU/Linux comes with ABSOLUTELY NO WARRANTYto the extent 
 +permitted by applicable law. 
 +Last login: Thu Nov 27 17:21:12 2025 from 10.0.2.1 
 +</code>
  
 +====3.4 - Mise en place des clefs====
  
-receiving incremental file list +Il convient maintenant de se connecter sur le <<serveur>> en utilisant ssh et vérifiez la présence du répertoire ~/.ssh :
-./ +
-COPYING +
-          1,187 100%    1.13MB/   0:00:00 (xfr#1, to-chk=26/28) +
-nvdcve-2.0-2002.xml +
-     19,533,351 100%   62.30MB/   0:00:00 (xfr#2, to-chk=25/28) +
-nvdcve-2.0-2003.xml +
-      4,744,330 100%   13.55MB/   0:00:00 (xfr#3, to-chk=24/28) +
-nvdcve-2.0-2004.xml +
-      9,416,639 100%   24.47MB/   0:00:00 (xfr#4, to-chk=23/28) +
-nvdcve-2.0-2005.xml +
-     15,701,047 100%   23.22MB/   0:00:00 (xfr#5, to-chk=22/28) +
-nvdcve-2.0-2006.xml +
-     26,320,892 100%   28.82MB/   0:00:00 (xfr#6, to-chk=21/28) +
-nvdcve-2.0-2007.xml +
-     30,567,434 100%   22.08MB/   0:00:01 (xfr#7, to-chk=20/28) +
-nvdcve-2.0-2008.xml +
-     29,775,037 100%   37.41MB/   0:00:00 (xfr#8, to-chk=19/28) +
-nvdcve-2.0-2009.xml +
-     27,996,918 100%   17.06MB/   0:00:01 (xfr#9, to-chk=18/28) +
-nvdcve-2.0-2010.xml +
-     42,684,286 100%   65.87MB/   0:00:00 (xfr#10, to-chk=17/28) +
-nvdcve-2.0-2011.xml +
-     83,905,485 100%   51.13MB/   0:00:01 (xfr#11, to-chk=16/28) +
-nvdcve-2.0-2012.xml +
-     66,859,075 100%  152.18MB/   0:00:00 (xfr#12, to-chk=15/28) +
-nvdcve-2.0-2013.xml +
-     96,064,147 100%   48.94MB/   0:00:01 (xfr#13, to-chk=14/28) +
-nvdcve-2.0-2014.xml +
-     98,694,839 100%   48.34MB/   0:00:01 (xfr#14, to-chk=13/28) +
-nvdcve-2.0-2015.xml +
-    124,671,234 100%  227.33MB/   0:00:00 (xfr#15, to-chk=12/28) +
-nvdcve-2.0-2016.xml +
-    161,692,009 100%  172.29MB/   0:00:00 (xfr#16, to-chk=11/28) +
-nvdcve-2.0-2017.xml +
-    189,948,654 100%  141.52MB/   0:00:01 (xfr#17, to-chk=10/28) +
-nvdcve-2.0-2018.xml +
-    210,761,959 100%  156.30MB/   0:00:01 (xfr#18, to-chk=9/28) +
-nvdcve-2.0-2019.xml +
-    265,685,784 100%  172.95MB/   0:00:01 (xfr#19, to-chk=8/28) +
-nvdcve-2.0-2020.xml +
-    294,835,369 100%  134.53MB/   0:00:02 (xfr#20, to-chk=7/28) +
-nvdcve-2.0-2021.xml +
-    442,673,740 100%  155.72MB/   0:00:02 (xfr#21, to-chk=6/28) +
-nvdcve-2.0-2022.xml +
-    743,192,055 100%  111.53MB/   0:00:06 (xfr#22, to-chk=5/28) +
-nvdcve-2.0-2023.xml +
-    599,785,077 100%   67.83MB/   0:00:08 (xfr#23, to-chk=4/28) +
-nvdcve-2.0-2024.xml +
-    922,757,332 100%   73.89MB/   0:00:11 (xfr#24, to-chk=3/28) +
-nvdcve-2.0-2025.xml +
-    480,360,705 100%  127.96MB/   0:00:03 (xfr#25, to-chk=2/28) +
-official-cpe-dictionary_v2.2.xml +
-    784,852,577 100%  251.59MB/   0:00:02 (xfr#26, to-chk=1/28) +
-timestamp +
-             13 100%   12.70kB/   0:00:00 (xfr#27, to-chk=0/28)+
  
-sent 2,186,887 bytes  received 11,127,079 bytes  117,303.67 bytes/sec +En saisissant cette commandevous obtiendrez une fenêtre similaire à celle-ci :
-total size is 5,773,481,175  speedup is 433.64+
  
-[trainee@centos7 ~]$ greenbone-scapdata-sync+<code> 
 +root@debian12:~# exit 
 +logout
  
-[trainee@centos7 ~]exit +trainee@debian12:~$ ssh -l trainee 127.0.0.1 
-</code>+trainee@127.0.0.1's password: trainee 
 +Linux debian12 6.1.0-41-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.158-1 (2025-11-09) x86_64
  
-<WRAP center round important 50%> +The programs included with the Debian GNU/Linux system are free software; 
-**Important** - En cas d'erreur, relancez simplement la commande. +the exact distribution terms for each program are described in the 
-</WRAP>+individual files in /usr/share/doc/*/copyright.
  
-Exécutez de nouveau la commande **openvas-check-setup** :+Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent 
 +permitted by applicable law. 
 +Last loginFri Nov 28 15:31:58 2025 from 10.0.2.46
  
-<code> +trainee@debian12:~$ ls -la | grep .ssh 
-[root@centos7 ~]# openvas-check-setup +drwx------   2 trainee trainee 4096 Nov 28 15:29 .ssh
-..+
-Step 2: Checking OpenVAS Manager ...  +
-        OK: OpenVAS Manager is present in version 6.0.9. +
-        OK: OpenVAS Manager client certificate is present as /etc/pki/openvas/CA/clientcert.pem. +
-        OK: OpenVAS Manager database found in /var/lib/openvas/mgr/tasks.db. +
-        OK: Access rights for the OpenVAS Manager database are correct. +
-        OK: sqlite3 found, extended checks of the OpenVAS Manager installation enabled. +
-        OK: OpenVAS Manager database is at revision 146. +
-        OK: OpenVAS Manager expects database at revision 146. +
-        OK: Database schema is up to date. +
-        OK: OpenVAS Manager database contains information about 45654 NVTs. +
-        OK: At least one user exists. +
-        OK: OpenVAS SCAP database found in /var/lib/openvas/scap-data/scap.db. +
-        ERROR: No OpenVAS CERT database found. (Tried: /var/lib/openvas/cert-data/cert.db) +
-        FIX: Run a CERT synchronization script like openvas-certdata-sync or greenbone-certdata-sync.+
  
- ERRORYour OpenVAS-8 installation is not yet complete! +trainee@debian12:~$ exit 
-...+logout 
 +Connection to 127.0.0.1 closed.
 </code> </code>
  
 <WRAP center round important 50%> <WRAP center round important 50%>
-**Important** - Notez l'erreur **ERROR: No OpenVAS CERT database found. (Tried: /var/lib/openvas/cert-data/cert.db).**+**Important** - Si le dossier distant .ssh n'existe pas dans le répertoire personnel de l'utilisateur connecté, il faut le créer avec des permissions de 700. Dans votre cas, puisque votre machine joue le rôle de serveur **et** du client, le dossier /home/trainee/.ssh existe **déjà**.
 </WRAP> </WRAP>
  
-Créez le fichier **/var/lib/openvas/cert-data/cert.db** :+Ensuite, il convient de transférer le fichier local **.ssh/id_ecdsa.pub** du <<client>> vers le <<serveur>> en le renommant en **authorized_keys** :
  
 <code> <code>
-[root@centos7 ~]# touch /var/lib/openvas/cert-data/cert.db+trainee@debian12:~$ scp .ssh/id_ecdsa.pub trainee@127.0.0.1:/home/trainee/.ssh/authorized_keys 
 +trainee@127.0.0.1's password:  
 +id_ecdsa.pub                                                                                                                                                                    100%  178   399.6KB/  00:00 
 </code> </code>
  
-Exécutez la commande **openvas-certdata-sync** :+Connectez-vous via ssh et insérer les clefs publiques restantes dans le fichier .ssh/authorized_keys :
  
 <code> <code>
-[root@centos7 ~]openvas-certdata-sync +trainee@debian12:~$ ssh -l trainee localhost 
-</code>+Linux debian12 6.1.0-41-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.158-1 (2025-11-09) x86_64
  
-Exécutez encore une fois la commande **openvas-check-setup** :+The programs included with the Debian GNU/Linux system are free software; 
 +the exact distribution terms for each program are described in the 
 +individual files in /usr/share/doc/*/copyright.
  
-<code> +Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent 
-[root@centos7 ~]# openvas-check-setup +permitted by applicable law. 
-openvas-check-setup 2.3.+Last login: Fri Nov 28 15:57:32 2025 from 127.0.0.1
-  Test completeness and readiness of OpenVAS-8 +
-  (add '--v6' or '--v7' or '--v9' +
-   if you want to check for another OpenVAS version)+
  
-  Please report us any non-detected problems and +trainee@debian12:~$ cat .ssh/id_rsa.pub >> .ssh/authorized_keys
-  help us to improve this check routine: +
-  http://lists.wald.intevation.org/mailman/listinfo/openvas-discuss+
  
-  Send us the log-file (/tmp/openvas-check-setup.log) to help analyze the problem.+trainee@debian12:~$ cat .ssh/id_dsa.pub >> .ssh/authorized_keys
  
-  Use the parameter --server to skip checks for client tools +trainee@debian12:~$ cat .ssh/id_ed25519.pub >> .ssh/authorized_keys
-  like GSD and OpenVAS-CLI.+
  
-Step 1Checking OpenVAS Scanner ...  +trainee@debian12:~$ cat .ssh/authorized_keys 
-        OK: OpenVAS Scanner is present in version 5.0.6. +ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBBwIXLMYJtWVgqSTqJfsFjS2ubtP+mHkC7XRU1rBWTBLYoJp8VOwtpKK1NTFSaeJhnjCvFuhYm8egqHI0gp3oBAtrainee@debian12 
-        OK: OpenVAS Scanner CA Certificate is present as /etc/pki/openvas/CA/cacert.pem. +ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDcV1OmeHZlWhLumCozdg7snul5MrkzhZjiUKWNJmGBBOauOq2CgMGYWYIhjyeVeaeiezq+wSe0jO09p8a1EbvYUibJsY9FOi8JcXTpxvlcqpuawudErjSsOf6JaIlbGpwDIMzmjeubfQx9jMZzfQIW9zfTDUi2tGquR/1TQPocGmmI9JFtoMqylk4+KsIHpriMBEVD/aKiGr1wjLHR1v3er8P1o8YOd+9tZXouJxWLHIA1swrnpXt8doVWYGx0E9jWsScqI4JPTy8kb2hfWeZWqONIqgJty0kOeTt6IynOauf9fSjxOG9Y4jyTV/OvTrBrmOCabjTIVMaIOWjLIPjNKJ8+eLnv+FuKUCc9mrAjbkXaP8T3JF43ofaBgSk09S3yo6wI3XI8ZlgROLDt7xxbFKosK/tYe8uOkpladNQHq3+EhAmzsfZJIstY0tNeK7aQ2KlsH6hZkLpqHsoKdzsLhRpMuPnV7wNlrikrbcvousDdQBpnzhNaXcm2BW+jmOs= trainee@debian12 
-        OK: redis-server is present in version v=3.2.12. +ssh-dss AAAAB3NzaC1kc3MAAACBAMbFW6WkZFJ/ueao6xjxBb+wbbIhIyiH/GM6W/7ayiNmCfFlYCxw9nNAVghYJYNcP2hB+l0qZ0JYrOMUX82sXAvtYbbO1xSZWNTTrbYEyR+o2ZWlgYBDz0DYj++dLCl0zCGHOfRq2VHtCx93mCxCiw5NXNflxOuy2WoY7hawxV/RAAAAFQDURMf0f29i5or5GrE4JWlFVZbiIwAAAIBqGpwpz+uQTKpJmgiisVA1t/0MRP2YstUVnU29Nr/C7EJ3bom3wx4At/bbQEfc7iVf0pwRUSJhdTy4t2vnFWghoeoj2ALUA4QVarVr7m0TY7m8bYgAlPVBx674DDmHfUh99PTwYcrcJUJMpVd+mwVccnXGigpHhs84QvD6csmxCwAAAIAEtC/YVdYAxFUd+ScG0zrBSsPHA/cigCF5cywNeu+OZqrK2y6yiJwp9T9bCL2nvzTWeTg/2Ev7v7Zh2oNKE5/mUoTDDn22omefi9Ecxl9W6Pyi8R6PxV+8mXtjHKPVNEQyqA8tAG1VN33MMgWz5HUEdwdUrOcmrkpyXNsRzvgD6w== trainee@debian12 
-        OK: scanner (kb_location setting) is configured properly using the redis-server socket: /tmp/redis.sock +ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILP736HSOOTZBe6+CHy8PINQ4gb9kKB4xj0JWWZy1Wgl trainee@debian12
-        OK: redis-server is running and listening on socket: /tmp/redis.sock. +
-        OK: redis-server configuration is OK and redis-server is running. +
-        OK: NVT collection in /var/lib/openvas/plugins contains 138097 NVTs. +
-        WARNING: Signature checking of NVTs is not enabled in OpenVAS Scanner. +
-        SUGGEST: Enable signature checking (see http://www.openvas.org/trusted-nvts.html). +
-        OK: The NVT cache in /var/cache/openvas contains 138097 files for 138097 NVTs. +
-Step 2: Checking OpenVAS Manager ...  +
-        OK: OpenVAS Manager is present in version 6.0.9. +
-        OK: OpenVAS Manager client certificate is present as /etc/pki/openvas/CA/clientcert.pem. +
-        OK: OpenVAS Manager database found in /var/lib/openvas/mgr/tasks.db. +
-        OK: Access rights for the OpenVAS Manager database are correct. +
-        OK: sqlite3 found, extended checks of the OpenVAS Manager installation enabled. +
-        OK: OpenVAS Manager database is at revision 146. +
-        OK: OpenVAS Manager expects database at revision 146. +
-        OK: Database schema is up to date. +
-        OK: OpenVAS Manager database contains information about 138097 NVTs. +
-        OK: At least one user exists. +
-        OK: OpenVAS SCAP database found in /var/lib/openvas/scap-data/scap.db. +
-        OK: OpenVAS CERT database found in /var/lib/openvas/cert-data/cert.db. +
-        OK: xsltproc found. +
-Step 3: Checking user configuration ...  +
-        WARNING: Your password policy is empty. +
-        SUGGEST: Edit the /etc/openvas/pwpolicy.conf file to set a password policy. +
-Step 4: Checking Greenbone Security Assistant (GSA) ...  +
-        OK: Greenbone Security Assistant is present in version 6.0.11. +
-Step 5: Checking OpenVAS CLI ...  +
-        OK: OpenVAS CLI version 1.4.4. +
-Step 6: Checking Greenbone Security Desktop (GSD) ...  +
-        SKIP: Skipping check for Greenbone Security Desktop. +
-Step 7: Checking if OpenVAS services are up and running ...  +
-        OK: netstat found, extended checks of the OpenVAS services enabled. +
-        OK: OpenVAS Scanner is running and listening on all interfaces. +
-        OK: OpenVAS Scanner is listening on port 9391, which is the default port. +
-        ERROR: OpenVAS Manager is NOT running! +
-        FIX: Start OpenVAS Manager (openvasmd). +
-        ERROR: Greenbone Security Assistant is NOT running! +
-        FIX: Start Greenbone Security Assistant (gsad). +
- +
- ERROR: Your OpenVAS-8 installation is not yet complete! +
- +
-Please follow the instructions marked with FIX above and run this +
-script again. +
- +
-If you think this result is wrong, please report your observation +
-and help us to improve this check routine: +
-http://lists.wald.intevation.org/mailman/listinfo/openvas-discuss +
-Please attach the log-file (/tmp/openvas-check-setup.log) to help us analyze the problem.+
 </code> </code>
  
 <WRAP center round important 50%> <WRAP center round important 50%>
-**Important** - Notez l'erreur **ERROR: Greenbone Security Assistant is NOT running!.**+**Important** - Notez que lors de la connexion au serveur, l'authentification utilise le couple de clefs asymétrique et aucun mot de passe n'est requis.
 </WRAP> </WRAP>
  
-Activer et démarrer OpenVAS Manager :+===Options de la commande=== 
 + 
 +Les options de cette commande sont :
  
 <code> <code>
-[root@centos7 ~]# systemctl enable openvas-manager +trainee@debian12:~$ ssh --help 
-Created symlink from /etc/systemd/system/multi-user.target.wants/openvas-manager.service to /usr/lib/systemd/system/openvas-manager.service.+unknown option -- - 
 +usage: ssh [-46AaCfGgKkMNnqsTtVvXxYy[-B bind_interface] 
 +           [-b bind_address] [-c cipher_spec] [-D [bind_address:]port] 
 +           [-E log_file] [-e escape_char] [-F configfile] [-I pkcs11] 
 +           [-i identity_file] [-J [user@]host[:port]] [-L address] 
 +           [-l login_name] [-m mac_spec] [-O ctl_cmd] [-o option] [-p port] 
 +           [-Q query_option] [-R address] [-S ctl_path] [-W host:port] 
 +           [-w local_tun[:remote_tun]] destination [command [argument ...]] 
 +</code>
  
-[root@centos7 ~]# systemctl start openvas-manager+====3.5 Tunnels SSH====
  
-[root@centos7 ~]# systemctl status openvas-manager +Le protocole SSH peut être utilisé pour sécuriser les protocoles tels telnet, pop3 etc.. En effet, on peut créer un //tunnel// SSH dans lequel passe les communications du protocole non-sécurisé.
-● openvas-manager.service - OpenVAS Manager +
-   Loaded: loaded (/usr/lib/systemd/system/openvas-manager.service; enabled; vendor preset: disabled) +
-   Active: active (running) since Tue 2025-12-02 11:51:41 CET; 10s ago +
-  Process: 12237 ExecStart=/usr/sbin/openvasmd $MANAGER_LISTEN $MANAGER_PORT $SCANNER_LISTEN $SCANNER_PORT $MANAGER_OTP (code=exited, status=0/SUCCESS) +
- Main PID: 12238 (openvasmd) +
-   CGroup: /system.slice/openvas-manager.service +
-           └─12238 openvasmd+
  
-Dec 02 11:51:41 centos7.fenestros.loc systemd[1]: Starting OpenVAS Manager... +La commande pour créer un tunnel ssh prend la forme suivante 
-Dec 02 11:51:41 centos7.fenestros.loc systemd[1]: Started OpenVAS Manager. + 
-</code>+  ssh -N -f compte@<hôte_local> -L<port-local>:<hôte_distant>:<port_distant>
  
-Activer et démarrer le Greenbone Security Assistant :+Dans votre cas, vous allez créer un tunnel entre Debian 12 et CentOS 8 entre le port 15023 et le port 23 :
  
 <code> <code>
-[root@centos7 ~]# systemctl enable openvas-gsa +trainee@debian12:~$ su 
-Created symlink from /etc/systemd/system/multi-user.target.wants/openvas-gsa.service to /usr/lib/systemd/system/openvas-gsa.service.+Password: fenestros
  
-[root@centos7 ~]systemctl start openvas-gsa +root@debian12:~# ssh -N -f trainee@localhost -L15023:10.0.2.45:23
- +
-[root@centos7 ~]# systemctl status openvas-gsa +
-● openvas-gsa.service - OpenVAS Greenbone Security Assistant +
-   Loadedloaded (/usr/lib/systemd/system/openvas-gsa.service; enabled; vendor preset: disabled) +
-   Active: active (running) since Tue 2025-12-02 11:53:08 CET; 1s ago +
-  Process: 12948 ExecStart=/usr/sbin/gsad $GSA_LISTEN $GSA_PORT $MANAGER_LISTEN $MANAGER_PORT $GNUTLSSTRING (code=exited, status=0/SUCCESS) +
- Main PID: 12949 (gsad) +
-   CGroup: /system.slice/openvas-gsa.service +
-           ├─12949 /usr/sbin/gsad --port=9443 --mlisten=127.0.0.1 --mport=9390 --gnutls-priorities=SECURE128:-AES-128-CBC:-CAMELLIA-128-CBC:-VERS-SSL3.0:-VERS-TLS1.0 +
-           └─12950 /usr/sbin/gsad --port=9443 --mlisten=127.0.0.1 --mport=9390 --gnutls-priorities=SECURE128:-AES-128-CBC:-CAMELLIA-128-CBC:-VERS-SSL3.0:-VERS-TLS1.0 +
- +
-Dec 02 11:53:08 centos7.fenestros.loc systemd[1]: Starting OpenVAS Greenbone Security Assistant... +
-Dec 02 11:53:08 centos7.fenestros.loc systemd[1]: Started OpenVAS Greenbone Security Assistant.+
 </code> </code>
  
-Exécutez encore une fois la commande **openvas-check-setup** :+Installez maintenant le client et le serveur telnet dans la VM CentOS 8:
  
 <code> <code>
-[root@centos7 ~]openvas-check-setup +root@debian12:~# ssh -l trainee 10.0.2.45 
-openvas-check-setup 2.3.3 +The authenticity of host '10.0.2.45 (10.0.2.45)can't be established. 
-  Test completeness and readiness of OpenVAS-8 +ED25519 key fingerprint is SHA256:YRt3r4qD/pZ8PoJ2irS3bH2miZj6/O3/kS4CBlcbz84. 
-  (add '--v6' or '--v7' or '--v9+This key is not known by any other names. 
-   if you want to check for another OpenVAS version)+Are you sure you want to continue connecting (yes/no/[fingerprint])? yes 
 +Warning: Permanently added '10.0.2.45' (ED25519) to the list of known hosts. 
 +trainee@10.0.2.45's password: trainee 
 +Activate the web console with: systemctl enable --now cockpit.socket
  
-  Please report us any non-detected problems and +Last loginThu Nov  6 04:13:03 2025 from 10.0.2.45
-  help us to improve this check routine: +
-  http://lists.wald.intevation.org/mailman/listinfo/openvas-discuss+
  
-  Send us the log-file (/tmp/openvas-check-setup.log) to help analyze the problem.+[trainee@centos8 ~]$ su - 
 +Password: fenestros
  
-  Use the parameter --server to skip checks for client tools +[root@centos8 ~]# dnf install telnet-server
-  like GSD and OpenVAS-CLI. +
- +
-Step 1: Checking OpenVAS Scanner ...  +
-        OK: OpenVAS Scanner is present in version 5.0.6. +
-        OK: OpenVAS Scanner CA Certificate is present as /etc/pki/openvas/CA/cacert.pem. +
-        OK: redis-server is present in version v=3.2.12. +
-        OK: scanner (kb_location setting) is configured properly using the redis-server socket: /tmp/redis.sock +
-        OK: redis-server is running and listening on socket: /tmp/redis.sock. +
-        OK: redis-server configuration is OK and redis-server is running. +
-        OK: NVT collection in /var/lib/openvas/plugins contains 138097 NVTs. +
-        WARNING: Signature checking of NVTs is not enabled in OpenVAS Scanner. +
-        SUGGEST: Enable signature checking (see http://www.openvas.org/trusted-nvts.html). +
-        OK: The NVT cache in /var/cache/openvas contains 138097 files for 138097 NVTs. +
-Step 2: Checking OpenVAS Manager ...  +
-        OK: OpenVAS Manager is present in version 6.0.9. +
-        OK: OpenVAS Manager client certificate is present as /etc/pki/openvas/CA/clientcert.pem. +
-        OK: OpenVAS Manager database found in /var/lib/openvas/mgr/tasks.db. +
-        OK: Access rights for the OpenVAS Manager database are correct. +
-        OK: sqlite3 found, extended checks of the OpenVAS Manager installation enabled. +
-        OK: OpenVAS Manager database is at revision 146. +
-        OK: OpenVAS Manager expects database at revision 146. +
-        OK: Database schema is up to date. +
-        OK: OpenVAS Manager database contains information about 138097 NVTs. +
-        OK: At least one user exists. +
-        OK: OpenVAS SCAP database found in /var/lib/openvas/scap-data/scap.db. +
-        OK: OpenVAS CERT database found in /var/lib/openvas/cert-data/cert.db. +
-        OK: xsltproc found. +
-Step 3: Checking user configuration ...  +
-        WARNING: Your password policy is empty. +
-        SUGGEST: Edit the /etc/openvas/pwpolicy.conf file to set a password policy. +
-Step 4: Checking Greenbone Security Assistant (GSA) ...  +
-        OK: Greenbone Security Assistant is present in version 6.0.11. +
-Step 5: Checking OpenVAS CLI ...  +
-        OK: OpenVAS CLI version 1.4.4. +
-Step 6: Checking Greenbone Security Desktop (GSD) ...  +
-        SKIP: Skipping check for Greenbone Security Desktop. +
-Step 7: Checking if OpenVAS services are up and running ...  +
-        OK: netstat found, extended checks of the OpenVAS services enabled. +
-        OK: OpenVAS Scanner is running and listening on all interfaces. +
-        OK: OpenVAS Scanner is listening on port 9391, which is the default port. +
-        OK: OpenVAS Manager is running and listening on all interfaces. +
-        OK: OpenVAS Manager is listening on port 9390, which is the default port. +
-        OK: Greenbone Security Assistant is listening on port 80, which is the default port. +
-Step 8: Checking nmap installation ... +
-        WARNING: No nmap installation found. +
-        SUGGEST: You should install nmap for comprehensive network scanning (see http://nmap.org) +
-Step 10: Checking presence of optional tools ... +
-        WARNING: Could not find pdflatex binary, the PDF report format will not work. +
-        SUGGEST: Install pdflatex. +
-        OK: ssh-keygen found, LSC credential generation for GNU/Linux targets is likely to work. +
-        OK: rpm found, LSC credential package generation for RPM based targets is likely to work. +
-        WARNING: Could not find alien binary, LSC credential package generation for DEB based targets will not work. +
-        SUGGEST: Install alien. +
-        WARNING: Could not find makensis binary, LSC credential package generation for Microsoft Windows targets will not work. +
-        SUGGEST: Install nsis. +
-        OK: SELinux is disabled. +
- +
-It seems like your OpenVAS-8 installation is OK. +
- +
-If you think it is not OK, please report your observation +
-and help us to improve this check routine: +
-http://lists.wald.intevation.org/mailman/listinfo/openvas-discuss +
-Please attach the log-file (/tmp/openvas-check-setup.log) to help us analyze the problem.+
 </code> </code>
  
-<WRAP center round important 50%> +Telnet n'est ni démarré ni activéIl convient donc de le démarrer et de l'activer :
-**Important** - Notez les WARNINGS. +
-</WRAP> +
- +
-Installez les paquets suggérés :+
  
 <code> <code>
-[root@centos7 ~]# yum install nmap texlive-latex-bin-bin alien -y +[root@centos8 ~]# systemctl status telnet.socket 
-</code>+● telnet.socket Telnet Server Activation Socket 
 +   Loaded: loaded (/usr/lib/systemd/system/telnet.socket; disabled; vendor preset: disabled) 
 +   Active: inactive (dead) 
 +     Docs: man:telnetd(8) 
 +   Listen: [::]:23 (Stream) 
 + Accepted: 0; Connected: 0;
  
-Exécutez de nouveau la commande **openvas-check-setup** :+[root@centos8 ~]# systemctl start telnet.socket
  
-<code> +[root@centos8 ~]# systemctl status telnet.socket 
-[root@centos7 ~]# openvas-check-setup +● telnet.socket - Telnet Server Activation Socket 
-..+   Loadedloaded (/usr/lib/systemd/system/telnet.socket; disabled; vendor presetdisabled) 
-Step 10: Checking presence of optional tools ..+   Activeactive (listening) since Fri 2025-11-28 09:42:52 EST; 2s ago 
-        OKpdflatex found. +     Docsman:telnetd(8) 
-        WARNINGPDF generation failed, most likely due to missing LaTeX packages. The PDF report format will not work. +   Listen: [::]:23 (Stream) 
-        SUGGESTInstall required LaTeX packages. + Accepted: 0; Connected0; 
-        OKssh-keygen found, LSC credential generation for GNU/Linux targets is likely to work. +   CGroup/system.slice/telnet.socket
-        OKrpm found, LSC credential package generation for RPM based targets is likely to work. +
-        OKalien found, LSC credential package generation for DEB based targets is likely to work. +
-        WARNINGCould not find makensis binary, LSC credential package generation for Microsoft Windows targets will not work. +
-        SUGGESTInstall nsis. +
-        OK: SELinux is disabled.+
  
-It seems like your OpenVAS-8 installation is OK. +Nov 28 09:42:52 centos8.ittraining.loc systemd[1]: Listening on Telnet Server Activation Socket.
-..+
-</code>+
  
-<WRAP center round important 50%> +[root@centos8 ~]# systemctl enable telnet.socket 
-**Important** - Notez la ligne **WARNING: PDF generation failed, most likely due to missing LaTeX packagesThe PDF report format will not work.** +Created symlink /etc/systemd/system/sockets.target.wants/telnet.socket → /usr/lib/systemd/system/telnet.socket.
-</WRAP>+
  
-Pour pouvoir utiliser les rapports au format PDF, installez les paquets suivants :+[root@centos8 ~]# systemctl status telnet.socket 
 +● telnet.socket - Telnet Server Activation Socket 
 +   Loadedloaded (/usr/lib/systemd/system/telnet.socket; enabled; vendor preset: disabled) 
 +   Active: active (listening) since Fri 2025-11-28 09:42:52 EST; 43s ago 
 +     Docs: man:telnetd(8) 
 +   Listen: [::]:23 (Stream) 
 + Accepted: 0; Connected: 0; 
 +   CGroup: /system.slice/telnet.socket
  
-<code> +Nov 28 09:42:52 centos8.ittraining.loc systemd[1]: Listening on Telnet Server Activation Socket.
-[root@centos7 ~]# yum -y install texlive-collection-fontsrecommended texlive-collection-latexrecommended texlive-changepage texlive-titlesec -y+
 </code> </code>
  
-Téléchargez ensuite le fichier **comment.sty** vers le répertoire **/usr/share/texlive/texmf-local/tex/latex/comment** et exécutez la commande **texhash** :+Arrêtez le service firewalld :
  
 <code> <code>
-[root@centos7 ~]# mkdir -p /usr/share/texlive/texmf-local/tex/latex/comment+[root@centos8 ~]# systemctl stop firewalld
  
-[root@centos7 ~]# cd /usr/share/texlive/texmf-local/tex/latex/comment+[root@centos8 ~]# iptables -
 +Chain INPUT (policy ACCEPT) 
 +target     prot opt source               destination         
  
-[root@centos7 comment]# wget http://mirrors.ctan.org/macros/latex/contrib/comment/comment.sty +Chain FORWARD (policy ACCEPT
---2025-12-02 13:35:43--  http://mirrors.ctan.org/macros/latex/contrib/comment/comment.sty +target     prot opt source               destination         
-Resolving mirrors.ctan.org (mirrors.ctan.org)... 89.58.7.101, 2a03:4000:5e:d33::+
-Connecting to mirrors.ctan.org (mirrors.ctan.org)|89.58.7.101|:80... connected. +
-HTTP request sent, awaiting response... 307 Temporary Redirect +
-Location: https://mirror.its.dal.ca/ctan/macros/latex/contrib/comment/comment.sty [following] +
---2025-12-02 13:35:43--  https://mirror.its.dal.ca/ctan/macros/latex/contrib/comment/comment.sty +
-Resolving mirror.its.dal.ca (mirror.its.dal.ca)... 192.75.96.254 +
-Connecting to mirror.its.dal.ca (mirror.its.dal.ca)|192.75.96.254|:443... connected. +
-HTTP request sent, awaiting response... 200 OK +
-Length: 10197 (10.0K[application/octet-stream] +
-Saving to: ‘comment.sty’+
  
-100%[========================================================================================================================================================================>] 10,197      --.-K/s   in 0s      +Chain OUTPUT (policy ACCEPT) 
 +target     prot opt source               destination 
 +</code>
  
-2025-12-02 13:35:43 (175 MB/s) - ‘comment.sty’ saved [10197/10197]+Connectez-vous ensuite via telnet sur CentOS 8 en utilisant le port 15023 de votre VM Debian 12 :
  
-[root@centos7 comment]chmod 644 comment.sty+<code> 
 +root@debian12:~telnet localhost 15023 
 +Trying ::1... 
 +Connected to localhost. 
 +Escape character is '^]'.
  
-[root@centos7 comment]# texhash +Kernel 4.18.0-348.7.1.el8_5.x86_64 on an x86_64 
-texhash: Updating /usr/share/texlive/texmf/ls-R...  +centos8 logintrainee 
-texhash: Updating /usr/share/texlive/texmf-config/ls-R...  +Password:  
-texhashUpdating /usr/share/texlive/texmf-dist/ls-R...  +Last loginFri Nov 28 09:45:22 from 10.0.2.46
-texhashUpdating /usr/share/texlive/texmf-local///ls-R...  +
-texhashUpdating /usr/share/texlive/texmf-var/ls-R...  +
-texhash: Done +
-</code>+
  
-Exécutez une dernière fois la commande **openvas-check-setup** :+[trainee@centos8 ~]$ pwd 
 +/home/trainee
  
-<code> +[trainee@centos8 ~]$ exit 
-[root@centos7 comment]# openvas-check-setup +logout 
-... +Connection closed by foreign host
-Step 10: Checking presence of optional tools ..+root@debian12:~# 
-        OKpdflatex found. +
-        OK: PDF generation successful. The PDF report format is likely to work. +
-        OK: ssh-keygen found, LSC credential generation for GNU/Linux targets is likely to work. +
-        OK: rpm found, LSC credential package generation for RPM based targets is likely to work. +
-        OK: alien found, LSC credential package generation for DEB based targets is likely to work. +
-        WARNING: Could not find makensis binary, LSC credential package generation for Microsoft Windows targets will not work. +
-        SUGGEST: Install nsis. +
-        OK: SELinux is disabled. +
- +
-It seems like your OpenVAS-8 installation is OK. +
-...+
 </code> </code>
  
 <WRAP center round important 50%> <WRAP center round important 50%>
-**Important** - Notez la ligne **WARNING: Could not find makensis binary, LSC credential package generation for Microsoft Windows targets will not work.**+**Important** - Notez bien que votre communication telnet passe par le tunnel SSH.
 </WRAP> </WRAP>
  
-Téléchargez et installez le fichier **mingw32-nsis-3.01-1.el7.x86_64.rpm** :+====3.SCP====
  
-<code> +===Introduction===
-[root@centos7 ~]# cd ~+
  
-[root@centos7 ~]# wget ftp://ftp.icm.edu.pl/vol/rzm1/linux-oracle-repo/OracleLinux/OL7/developer_EPEL/x86_64/mingw32-nsis-3.01-1.el7.x86_64.rpm +La commande **scp** est le successeur et la remplaçante de la commande **rcp** de la famille des commandes **remote**Il permet de faire des transferts sécurisés à partir d'une machine distante :
---2025-12-02 13:46:26--  ftp://ftp.icm.edu.pl/vol/rzm1/linux-oracle-repo/OracleLinux/OL7/developer_EPEL/x86_64/mingw32-nsis-3.01-1.el7.x86_64.rpm +
-           => ‘mingw32-nsis-3.01-1.el7.x86_64.rpm’ +
-Resolving ftp.icm.edu.pl (ftp.icm.edu.pl)... 193.219.28.2, 2001:6a0:0:31::+
-Connecting to ftp.icm.edu.pl (ftp.icm.edu.pl)|193.219.28.2|:21... connected. +
-Logging in as anonymous ... Logged in! +
-==> SYST ... done.    ==> PWD ... done. +
-==> TYPE I ... done.  ==> CWD (1) /vol/rzm1/linux-oracle-repo/OracleLinux/OL7/developer_EPEL/x86_64 ... done. +
-==> SIZE mingw32-nsis-3.01-1.el7.x86_64.rpm ... 1379180 +
-==> PASV ... done.    ==> RETR mingw32-nsis-3.01-1.el7.x86_64.rpm ... done. +
-Length: 1379180 (1.3M) (unauthoritative)+
  
-100%[========================================================================================================================================================================>] 1,379,180   2.05MB/s   in 0.6s   +  $ scp compte@numero_ip(nom_de_machine):/chemin_distant/fichier_distant /chemin_local/fichier_local
  
-2025-12-02 13:46:28 (2.05 MB/s) - ‘mingw32-nsis-3.01-1.el7.x86_64.rpm’ saved [1379180]+ou vers une machine distante :
  
-[root@centos7 ~]# yum localinstall mingw32-nsis-3.01-1.el7.x86_64.rpm --nogpgcheck -y +  $ scp /chemin_local/fichier_local compte@numero_ip(nom_de_machine):/chemin_distant/fichier_distant 
-</code>+ 
 +===Utilisation=== 
 + 
 +Nous allons maintenant utiliser **scp** pour chercher un fichier sur le <<serveur>:
  
-Exécutez une dernière fois la commande **openvas-check-setup** :+Créez le fichier **/home/trainee/scp_test** :
  
 <code> <code>
-[root@centos7 ~]# openvas-check-setup +trainee@debian12:~$ touch /home/trainee/scp_test
-... +
-Step 10: Checking presence of optional tools ... +
-        OK: pdflatex found. +
-        OK: PDF generation successful. The PDF report format is likely to work. +
-        OK: ssh-keygen found, LSC credential generation for GNU/Linux targets is likely to work. +
-        OK: rpm found, LSC credential package generation for RPM based targets is likely to work. +
-        OK: alien found, LSC credential package generation for DEB based targets is likely to work. +
-        OK: nsis found, LSC credential package generation for Microsoft Windows targets is likely to work. +
-        OK: SELinux is disabled. +
- +
-It seems like your OpenVAS-8 installation is OK. +
-...+
 </code> </code>
  
-===2.5 - Utilisation===+Récupérez le fichier **scp_test** en utilisant scp :
  
-Retournez à l'accueil de Guacamole. Connectez-vous à la VM **Gateway_10.0.2.40_VNC** avec le compte **trainee** et le mot de passe **a39dae707d**.+<code>
  
-Ouvrez un navigateur web dans la VM et saississez l'adresse %%https:>//10.0.2.51:9443%%. Vous obtiendrez une fenêtre similaire à celle-ci :+trainee@debian12:~$ scp trainee@127.0.0.1:/home/trainee/scp_test /tmp/scp_test
  
-{{ :elearning:workbooks:centos:6:avance:openvas01.png?600 |}} +trainee@debian12:~$ ls /tmp/scp_test 
 +/tmp/scp_test 
 +</code>
  
-Créez une exception pour le Self Signed Certificate. Vous obtiendrez une fenêtre similaire à celle-ci:  +=====LAB #4 Mise en place d'un VPN avec OpenVPN=====
  
-{{ :elearning:workbooks:centos:6:avance:openvas02.png?600 |}}+====4.1 - Présentation====
  
-Entrez le nom de votre utilisateur (fenestros) ainsi que son mot de passe (fenestros) et cliquez sur le bouton **Login**. Vous obtiendrez une fenêtre similaire à celle-ci :+**%%OpenVPN%%** :
  
-{{ :elearning:workbooks:centos:6:avance:openvas03.png?600 |}} +  * permet à des pairs de s'authentifier entre eux à l'aide : 
 +    * d'une **clé privée partagée** à l'avance,  
 +    * de **certificats** ou,  
 +    * à partir de la version 2.0 et à condition que le serveur possède un certificat, de **couples de noms d'utilisateur/mot de passe** sans besoin d'un certificat client 
 +  * utilise de manière intensive la bibliothèque d'authentification **%%OpenSSL%%** ainsi que le protocole **SSLv3/TLSv1**,  
 +  * n'est pas compatible avec IPsec ou d'autres logiciels VPN
  
-Dans la boîte **Quick start**, entrez l'adresse IP 10.0.2.51 et cliquez sur le bouton **Start Scan**. Vous obtiendrez une fenêtre similaire à celle-ci :+====Configuration commune au client et au serveur====
  
-{{ :elearning:workbooks:centos:6:avance:openvas04.png?600 |}}+Installez le paquet openvpn :
  
-<WRAP center round important 50%+<code
-**Important** - Vous pouvez indiquer un réseau entier de la forme 10.0.2.0/24 +root@debian12:~# apt install openvpn 
-</WRAP+</code>
  
-===Analyse des Résultats===+Naviguez au répertoire **/etc/openvpn** et créez la clef partagée :
  
-A l'issu de l'analyse, il est possible de consulter les résultats :+<code> 
 +[root@centos7 ~]# cd /etc/openvpn/
  
-{{ :elearning:workbooks:centos:6:avance:openvas05.png?600 |}} +root@debian12:/etc/openvpn# openvpn --genkey secret static.key
  
-ainsi que les détails de celui-ci :+root@debian12:/etc/openvpn# cat static.key 
 +
 +# 2048 bit OpenVPN static key 
 +
 +-----BEGIN OpenVPN Static key V1----- 
 +77b47829a9d17aacc71b05a2bfa9bcba 
 +e90370cc07238a5adb74ef479e87547d 
 +fc18a69c3c5307bdc1ca27c7aa6f3a35 
 +e09e815a27f50c28699be3af28decd3c 
 +b319923c2fe3826c2afb41d2e0239229 
 +fee9bc33566941e09e2f905f1bcbb59a 
 +55cf8d535334ac46eda3f35be0b7e22b 
 +c3261de182f7cde5cc7d756420907514 
 +0399672d104cebee31a44ca6d89663c7 
 +784b928e893c4d3a6e7d294e94266e1b 
 +5a98f80f797651199069902be01d2bbd 
 +94765d310f8d0466484a0e7cbf10bb98 
 +d247127aa53a6c18a6def6ed73a28b69 
 +b7d052209318057e2ccb9660fc42543b 
 +d79dab314ecbc19a6b8936255c17d673 
 +fb0bdc3856a034ffc3931a7d645d6d96 
 +-----END OpenVPN Static key V1----- 
 +</code>
  
-{{ :elearning:workbooks:centos:6:avance:openvas06.png?600 |}}  +<code> 
 +root@debian12:~# scp /etc/openvpn/static.key trainee@10.0.2.45:/tmp/static.key 
 +trainee@10.0.2.45's password 
 +static.key                                                                                                                                                                      100%  636     1.2MB/  00:00 
 +</code>
  
-Vous trouverez aussi une **solution** ainsi qu'une évaluation du niveau de risque, **Risk factor**.+====Configuration du client====
  
-{{ :elearning:workbooks:centos:6:avance:openvas07.png?600 |}}  +<code> 
-{{ :elearning:workbooks:centos:6:avance:openvas08.png?600 |}}+root@debian12:/etc/openvpn# ssh -l trainee 10.0.2.45 
 +trainee@10.0.2.45's passwordtrainee 
 +Activate the web console withsystemctl enable --now cockpit.socket
  
-=====Les Contres-Mesures=====+Last login: Fri Nov 28 09:47:05 2025 from ::ffff:10.0.2.46
  
-Les contre-mesures consistent en la mise en place de chroot pour certains serveurs ainsi que le durcissement de la configuration de serveurs d'application.+[trainee@centos8 ~]$ su - 
 +Password: fenestros 
 +</code>
  
-====LAB #La commande chroot==== +<code> 
- +[root@centos8 ~]dnf install epel-release 
-Le chrootage permet de séparer un utilisateur ou un utilisateur système ( et donc un serveur ) du système.  +</code>
- +
-Sous Debian 12 le binaire chroot est installé par défaut :+
  
 <code> <code>
-root@debian12:~# which chroot +[root@centos8 ~]dnf install openvpn
-/usr/sbin/chroot+
 </code> </code>
- 
-Commencez par créer un répertoire pour l'utilisateur qui sera emprisonné : 
  
 <code> <code>
-root@debian12:~# mkdir /home/prison+[root@centos8 ~]mv /tmp/static.key /etc/openvpn 
 +[root@centos8 ~]# ls /etc/openvpn 
 +client  server  static.key
 </code> </code>
  
-Le binaire **/usr/sbin/chroot** doit prendre le SUID bit :+Créez le fichier **/etc/openvpn/client/client.conf** :
  
 <code> <code>
-root@debian12:~# mkdir /home/prison+[root@centos8 ~]vi /etc/openvpn/client/client.conf 
 +[root@centos8 ~]# cat /etc/openvpn/client/client.conf 
 +remote 10.0.2.46 
 +dev tun 
 +port 1194 
 +proto udp 
 +comp-lzo 
 +ifconfig 10.0.0.2 10.0.0.1 
 +secret /etc/openvpn/static.key 
 +</code>
  
-root@debian12:~# ls -l /usr/sbin/chroot +Lancez openvpn en ligne de commande et en arrière plan en spécifiant une journalisation :
--rwxr-xr-x. 1 root root 48112 Sep 20  2022 /usr/sbin/chroot+
  
-root@debian12:~# chmod +s /usr/sbin/chroot +<code> 
- +[root@centos8 ~]openvpn --config /etc/openvpn/client/client.conf > /var/log/vpn 2>&1 & 
-root@debian12:~# ls -/usr/sbin/chroot +[1] 14598
--rwsr-sr-x1 root root 48112 Sep 20  2022 /usr/sbin/chroot+
 </code> </code>
  
-Créez maintenant un script de connexion générique pour que l'utilisateur **prison** puisse se connecter :+Vérifiez ensuite que le **socket** d'openvpn soit ouvert :
  
 <code> <code>
-root@debian12:~# vi /bin/chroot +[root@centos8 ~]netstat -an | grep 1194 
- +udp        0      0 0.0.0.0:1194            0.0.0.0:   
-root@debian12:~# cat /bin/chroot +
-#!/bin/bash +
-exec -c /usr/sbin/chroot /home/$USER /bin/bash+
 </code> </code>
  
-Rendez ce script exécutable :+Constatez ensuite la table de routage :
  
-<code> +<code>                             
-root@debian12:~# chmod +x /bin/chroot +[root@centos8 ~]netstat -ar 
 +Kernel IP routing table 
 +Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface 
 +default         _gateway        0.0.0.0         UG        0 0          0 ens18 
 +10.0.0.1        0.0.0.0         255.255.255.255 UH        0 0          0 tun0 
 +10.0.2.0        0.0.0.0         255.255.255.0           0 0          0 ens18 
 +192.168.122.0   0.0.0.0         255.255.255.0           0 0          0 virbr0
 </code> </code>
  
-Il est maintenant nécessaire de copier toutes les commandes dont l'utilisateur **prison** aura besoinDans cet exemple, nous allons nous contenter de copier **/bin/bash** et **/bin/ls** ainsi que les bibliothèques associées :+Notez la présence de la route via **tun0**. 
 + 
 +Constatez ensuite le montage du tunnel en regardant le contenu du fichier de journalisation **/var/log/vpn** :
  
 <code> <code>
-root@debian12:~# mkdir /home/prison/bin+[root@centos7 ~]tail /var/log/vpn 
 +</code>
  
-root@debian12:~# cp /bin/bash /home/prison/bin/+L'architecture réseau sera donc la suivante :
  
-root@debian12:~# ldd /bin/bash +<file> 
-        linux-vdso.so.1 (0x00007ffd39fcf000) +                                   serveur <------------Votre réseau-------------> client 
-        libtinfo.so.6 => /lib/x86_64-linux-gnu/libtinfo.so.6 (0x00007fef082e8000) +                                                                                    | 
-        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fef08106000) +                                                                                    | 
-        /lib64/ld-linux-x86-64.so.2 (0x00007fef08471000) +                                  eth0@ifxxx                                      eth0@ifxxx 
-    +                                  172.yy.0.3                                      172.yy.0.4  
-root@debian12:~# mkdir /home/prison/lib64+</file>
  
-root@debian12:~# mkdir -p /home/prison/lib/x86_64-linux-gnu/+====Configuration du serveur====
  
-root@debian12:~# cp /lib/x86_64-linux-gnu/libtinfo.so.6 /home/prison/lib/x86_64-linux-gnu/+Créez le fichier **/etc/openvpn/server/server.conf** :
  
-root@debian12:~# cp /lib/x86_64-linux-gnu/libc.so.6 /home/prison/lib/x86_64-linux-gnu/+<code> 
 +root@debian12:~# vi /etc/openvpn/server/server.conf
  
-root@debian12:~# cp /lib64/ld-linux-x86-64.so.2 /home/prison/lib64+root@debian12:~# cat /etc/openvpn/server/server.conf 
 +dev tun 
 +ifconfig 10.0.0.1 10.0.0.2 
 +secret /etc/openvpn/static.key 
 +port 1194 
 +proto udp 
 +user nobody 
 +group nobody 
 +daemon 
 +comp-lzo 
 +keepalive 10 60 
 +ping-timer-rem 
 +persist-tun 
 +persist-key 
 +log /var/log/vpn 
 +verb 1 
 +</code>
  
-root@debian12:~# cp /bin/ls /home/prison/bin/+Arrêtez le service **firewalld** :
  
-root@debian12:~# ldd /bin/ls +<code> 
-        linux-vdso.so.1 (0x00007fff3db26000) +root@debian12:~# systemctl stop firewalld
-        libselinux.so.1 => /lib/x86_64-linux-gnu/libselinux.so.1 (0x00007f8afb9a0000) +
-        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f8afb7be000) +
-        libpcre2-8.so.0 => /lib/x86_64-linux-gnu/libpcre2-8.so.0 (0x00007f8afb724000) +
-        /lib64/ld-linux-x86-64.so.2 (0x00007f8afba0a000)+
  
-root@debian12:~# cp /lib/x86_64-linux-gnu/libselinux.so.1 /home/prison/lib/x86_64-linux-gnu/+root@debian12:~# iptables -
 +Chain INPUT (policy ACCEPT) 
 +target     prot opt source               destination         
  
-root@debian12:~# cp /lib/x86_64-linux-gnu/libpcre2-8.so.0 /home/prison/lib/x86_64-linux-gnu/+Chain FORWARD (policy ACCEPT) 
 +target     prot opt source               destination          
 + 
 +Chain OUTPUT (policy ACCEPT) 
 +target     prot opt source               destination
 </code> </code>
  
-Créez maintenant le groupe chroot :+Lancez openvpn en ligne de commande et en arrière plan en spécifiant une journalisation :
  
 <code> <code>
-root@debian12:~# groupadd chroot +root@debian12:~# openvpn --config /etc/openvpn/server/server.conf > /var/log/vpn 2>&1 & 
- +[1] 11644
-root@debian12:~# cat /etc/group | grep chroot +
-chroot:x:1001:+
 </code> </code>
  
-Créez maintenant l'utilisateur **prison** :+Vérifiez ensuite que le **socket** d'openvpn soit ouvert :
  
 <code> <code>
-root@debian12:~# useradd prison -c chroot_user -d /home/prison -g chroot -s /bin/chroot+[root@centos7 ~]netstat -an | grep 1194 
 +udp        0      0 0.0.0.0:1194                0.0.0.0:   
 </code> </code>
  
-Dernièrement, modifiez le propriétaire et le groupe du répertoire **/home/prison** :+Constatez ensuite la table de routage :
  
-<code> +<code>                             
-root@debian12:~# chown -R prison:chroot /home/prison+[root@centos7 ~]netstat -ar  
 +Kernel IP routing table 
 +Destination     Gateway         Genmask         Flags   MSS Fenêtre irtt Iface 
 +0.0.0.0         10.0.2.2        0.0.0.0         UG        0 0          0 enp0s3 
 +10.0.0.1        0.0.0.0         255.255.255.255 UH        0 0          0 tun0 
 +10.0.2.0        0.0.0.0         255.255.255.0           0 0          0 enp0s3
 </code> </code>
  
-Essayez maintenant de vous connecter en tant que l'utilisateur prison :+Constatez ensuite le montage du tunnel en regardant le contenu du fichier de journalisation **/var/log/vpn** :
  
 <code> <code>
-root@debian12:~# su - prison+[root@centos7 ~]tail /var/log/vpn 
 +</code>
  
-bash-5.2$ pwd +====Tests====
-/+
  
-bash-5.2$ ls +===Du client vers le serveur===
-bin  lib  lib64+
  
-bash-5.2$ ls -la +Sur le client, utilisez la commande ping pour envoyer des paquets dans le tunnel :
-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 +<code> 
-exit+[root@centos6 ~]# ping -c3 10.0.0.1 
 +PING 10.0.0.1 (10.0.0.1) 56(84) bytes of data. 
 +64 bytes from 10.0.0.1: icmp_seq=1 ttl=64 time=7.62 ms 
 +64 bytes from 10.0.0.1: icmp_seq=ttl=64 time=1.35 ms 
 +64 bytes from 10.0.0.1: icmp_seq=3 ttl=64 time=0.000 ms
  
-root@debian12:~# +--- 10.0.0.1 ping statistics --- 
 +3 packets transmitted, 3 received, 0% packet loss, time 2047ms 
 +rtt min/avg/max/mdev = 0.000/2.994/7.629/3.323 ms
 </code> </code>
  
-Notez que l'utilisateur **prison** est //chrooté//.+===Du serveur vers le client=== 
 + 
 +Sur le serveur, utilisez la commande ping pour envoyer des paquets dans le tunnel : 
 + 
 +<code> 
 +[root@centos7 ~]# ping -c5 10.0.0.2 
 +PING 10.0.0.2 (10.0.0.2) 56(84) bytes of data. 
 +64 bytes from 10.0.0.2: icmp_seq=1 ttl=64 time=2.59 ms 
 +64 bytes from 10.0.0.2: icmp_seq=2 ttl=64 time=9.08 ms 
 +64 bytes from 10.0.0.2: icmp_seq=3 ttl=64 time=7.24 ms 
 +64 bytes from 10.0.0.2: icmp_seq=4 ttl=64 time=7.03 ms 
 +64 bytes from 10.0.0.2: icmp_seq=5 ttl=64 time=4.08 ms 
 + 
 +--- 10.0.0.2 ping statistics --- 
 +5 packets transmitted, 5 received, 0% packet loss, time 4034ms 
 +rtt min/avg/max/mdev = 2.597/6.008/9.084/2.340 ms 
 +</code>
  
 ----- -----
 Copyright © 2025 Hugh Norris. Copyright © 2025 Hugh Norris.
- 
Menu