<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>sshaudit &amp;mdash; Cyberdyne Systems</title>
    <link>https://noblogo.org/aytin/tag:sshaudit</link>
    <description>&#34;Fare o non fare. Non c&#39;è provare!&#34;</description>
    <pubDate>Mon, 03 Aug 2026 09:18:46 +0000</pubDate>
    <item>
      <title>sshaudit.com di nuovo online!!!</title>
      <link>https://noblogo.org/aytin/sshaudit-com-di-nuovo-online</link>
      <description>&lt;![CDATA[tux-sshaudit&#xA;&#xA;Oh, gaudio!&#xA;&#xA;Oh, giubilo!&#xA;&#xA;ssh–audit è di nuovo fra noi.&#xA;!--more--&#xA;Il 4 luglio 2026 Joe Testa porta la sua creatura dalla versione 3.3.0, risalente ormai a due anni fa, alla versione 3.9.0, un aggiornamento corposo che riguarda:&#xA;&#xA;aggiornamento supporto python 3.14, eliminazione python 3.8 e python 3.9&#xA;preparazione alla crittografia post-quantistica (warning se gli algoritmi di exchange non lo sono)&#xA;rimozione supporto sshv1&#xA;Modifica della policy built-in per Debian 12&#xA;Aggiunta delle policy built-in per OpenSSH 10.0, 10.1, 10.2, 10.3, and 10.4.&#xA;Aggiunta delle guide all’hardenizzazione di Debian 13, Rocky Linux 10, Ubuntu 26.04.&#xA;**Avendo sempre come riferimento la resistenza post quantistica, sono stati aggiunti due nuovi algoritmi di key exchange e 11 nuove hostkeys&#xA;ecc.&#xA;&#xA;Anche sshaudit.com è di nuovo online anche se le guide non hanno ancora recepito gli aggiornamenti presenti nella cli.&#xA;&#xA;Ma la notizia più rincuorante è che pare che Joe Testa stia bene e che abbia trovato uno sponsor che sta finanziando il suo sviluppo.&#xA;&#xA;Mi riservo di approfondire a breve.&#xA;&#xA;Intanto ben ritornato, Joe Testa ❤️. &#xA;&#xA;#ssh #sshaudit]]&gt;</description>
      <content:encoded><![CDATA[<p><img src="https://pixelfed.uno/storage/m/_v2/489827599091373610/4c90d8e69-c5a1c2/BWleV9bHP3yP/QpgAO24mgYLinoTiMlgEqitAqICyn6z59JBhydu0.jpg" alt="tux-sshaudit"></p>

<p>Oh, gaudio!</p>

<p>Oh, giubilo!</p>

<p><a href="https://github.com/jtesta/ssh-audit" rel="nofollow">ssh–audit</a> è di nuovo fra noi.

Il 4 luglio 2026 Joe Testa porta la sua creatura dalla versione 3.3.0, risalente ormai a due anni fa, alla <a href="https://github.com/jtesta/ssh-audit/releases/tag/v3.9.0" rel="nofollow">versione 3.9.0</a>, un aggiornamento corposo che riguarda:</p>
<ul><li>aggiornamento supporto python 3.14, eliminazione python 3.8 e python 3.9</li>
<li>preparazione alla crittografia post-quantistica (warning se gli algoritmi di exchange non lo sono)
rimozione supporto sshv1</li>
<li><strong>Modifica della policy built-in per Debian 12</strong></li>
<li><strong>Aggiunta delle policy built-in per OpenSSH 10.0, 10.1, 10.2, 10.3, and 10.4.</strong></li>
<li><strong>Aggiunta delle guide all’hardenizzazione di Debian 13, Rocky Linux 10, Ubuntu 26.04.</strong></li>
<li>**Avendo sempre come riferimento la resistenza post quantistica, sono stati aggiunti due nuovi algoritmi di key exchange e 11 nuove host_keys</li>
<li>ecc.</li></ul>

<p>Anche <a href="https://www.sshaudit.com" rel="nofollow">sshaudit.com</a> è di nuovo online anche se le guide non hanno ancora recepito gli aggiornamenti presenti nella cli.</p>

<p>Ma la notizia più rincuorante è che pare che Joe Testa stia bene e che abbia trovato uno sponsor che sta finanziando il suo sviluppo.</p>

<p>Mi riservo di approfondire a breve.</p>

<p>Intanto ben ritornato, Joe Testa ❤️.</p>

<p><a href="/aytin/tag:ssh" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">ssh</span></a> <a href="/aytin/tag:sshaudit" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">sshaudit</span></a></p>
]]></content:encoded>
      <guid>https://noblogo.org/aytin/sshaudit-com-di-nuovo-online</guid>
      <pubDate>Mon, 13 Jul 2026 03:57:06 +0000</pubDate>
    </item>
    <item>
      <title>Audit per client e server ssh</title>
      <link>https://noblogo.org/aytin/audit-per-client-e-server-ssh</link>
      <description>&lt;![CDATA[ssh-audit&#xA;&#xA;ssh-audit è un un comodo tool per l&#39;audit di sicurezza del server e del client SSH (banner, scambio di chiavi, crittografia, mac, compressione, compatibilità, sicurezza, ecc.)&#xA;&#xA;Il sito di riferimento: https://www.ssh-audit.com/ da cui si può effettuare una scansione sia del proprio client che di un server.&#xA;!--more--&#xA;Questa sezione https://www.ssh-audit.com/hardeningguides.html invece fornisce una serie di configurazioni rapide e sicure per la pletora di client e server più noti. &#xA;&#xA;ssh-audit permette di eseguire delle scansioni generiche client e/o server o di controllare una specifica compliance (ne parlerò più avanti) in base al sistema in uso&#xA;&#xA;Installare ssh-audit&#xA;&#xA;Trattandosi di una utility via CLI, la installerò con pipx che mi garantisce il necessario isolamento e un link all&#39;eseguibile che sia &#34;globale&#34; per l&#39;utente.&#xA;&#xA;pipx install ssh-audit&#xA;o pipx install ssh-audit --python pythonversione&#xA;se si vuole una versione di python specifica&#xA;&#xA;Se non dovesse essere presente pipx, nella nostra home:&#xA;aggiornamento e installazione pip, pipx&#xA;pip install --user -U pip pipx&#xA;&#xA;ssh-audit può essere usato per il check e la configurazione di un server ssh o del client.&#xA;&#xA;Scansione server&#xA;Semplice.&#xA;&#xA;ssh-audit -p porta ssh ip / server ssh&#xA;&#xA;effettua la scansione di un server ssh. Il risultato consisterà in una serie di informazioni sulle direttive riguardanti cipher, klex, mac ecc. che saranno:&#xA;&#xA;[info] di colore verde o bianco corrispondenti a configurazioni corrette&#xA;[warning] di colore giallo, corrispondenti a configurazioni da attenzionare&#xA;[fail] di colore rosso, corrispondenti a configurazioni palesemente critiche e da correggere urgentemente.&#xA;&#xA;Ecco un es. di scansione sul default ssh server di una debian 13 (RaspBI 2):&#xA;&#xA;general&#xA;(gen) banner: SSH-2.0-OpenSSH10.0p2 Raspbian-7&#xA;(gen) software: OpenSSH 10.0p2&#xA;(gen) compatibility: OpenSSH 9.9+, Dropbear SSH 2020.79+&#xA;(gen) compression: enabled (zlib@openssh.com)&#xA;&#xA;key exchange algorithms&#xA;(kex) mlkem768x25519-sha256               -- [info] available since OpenSSH 9.9&#xA;                                          `- [info] hybrid key exchange based on post-quantum resistant algorithm and proven conventional X25519 algorithm&#xA;(kex) sntrup761x25519-sha512              -- [info] available since OpenSSH 9.9&#xA;                                          `- [info] default key exchange since OpenSSH 9.9&#xA;                                          `- [info] hybrid key exchange based on post-quantum resistant algorithm and proven conventional X25519 algorithm&#xA;(kex) sntrup761x25519-sha512@openssh.com  -- [info] available since OpenSSH 8.5&#xA;                                          `- [info] default key exchange from OpenSSH 9.0 to 9.8&#xA;                                          `- [info] hybrid key exchange based on post-quantum resistant algorithm and proven conventional X25519 algorithm&#xA;(kex) curve25519-sha256                   -- [info] available since OpenSSH 7.4, Dropbear SSH 2018.76&#xA;                                          `- [info] default key exchange from OpenSSH 7.4 to 8.9&#xA;(kex) curve25519-sha256@libssh.org        -- [info] available since OpenSSH 6.4, Dropbear SSH 2013.62&#xA;                                          `- [info] default key exchange from OpenSSH 6.5 to 7.3&#xA;(kex) ecdh-sha2-nistp256                  -- [fail] using elliptic curves that are suspected as being backdoored by the U.S. National Security Agency&#xA;                                          `- [info] available since OpenSSH 5.7, Dropbear SSH 2013.62&#xA;(kex) ecdh-sha2-nistp384                  -- [fail] using elliptic curves that are suspected as being backdoored by the U.S. National Security Agency&#xA;                                          `- [info] available since OpenSSH 5.7, Dropbear SSH 2013.62&#xA;(kex) ecdh-sha2-nistp521                  -- [fail] using elliptic curves that are suspected as being backdoored by the U.S. National Security Agency&#xA;                                          `- [info] available since OpenSSH 5.7, Dropbear SSH 2013.62&#xA;(kex) ext-info-s                          -- [info] available since OpenSSH 9.6&#xA;                                          `- [info] pseudo-algorithm that denotes the peer supports RFC8308 extensions&#xA;(kex) kex-strict-s-v00@openssh.com        -- [info] pseudo-algorithm that denotes the peer supports a stricter key exchange method as a counter-measure to the Terrapin attack (CVE-2023-48795)&#xA;&#xA;host-key algorithms&#xA;(key) rsa-sha2-512 (3072-bit)             -- [info] available since OpenSSH 7.2&#xA;(key) rsa-sha2-256 (3072-bit)             -- [info] available since OpenSSH 7.2, Dropbear SSH 2020.79&#xA;(key) ecdsa-sha2-nistp256                 -- [fail] using elliptic curves that are suspected as being backdoored by the U.S. National Security Agency&#xA;                                          `- [warn] using weak random number generator could reveal the key&#xA;                                          `- [info] available since OpenSSH 5.7, Dropbear SSH 2013.62&#xA;(key) ssh-ed25519                         -- [info] available since OpenSSH 6.5, Dropbear SSH 2020.79&#xA;&#xA;encryption algorithms (ciphers)&#xA;(enc) chacha20-poly1305@openssh.com       -- [info] available since OpenSSH 6.5, Dropbear SSH 2020.79&#xA;                                          `- [info] default cipher since OpenSSH 6.9&#xA;(enc) aes128-gcm@openssh.com              -- [info] available since OpenSSH 6.2&#xA;(enc) aes256-gcm@openssh.com              -- [info] available since OpenSSH 6.2&#xA;(enc) aes128-ctr                          -- [info] available since OpenSSH 3.7, Dropbear SSH 0.52&#xA;(enc) aes192-ctr                          -- [info] available since OpenSSH 3.7&#xA;(enc) aes256-ctr                          -- [info] available since OpenSSH 3.7, Dropbear SSH 0.52&#xA;&#xA;message authentication code algorithms&#xA;(mac) umac-64-etm@openssh.com             -- [warn] using small 64-bit tag size&#xA;                                          `- [info] available since OpenSSH 6.2&#xA;(mac) umac-128-etm@openssh.com            -- [info] available since OpenSSH 6.2&#xA;(mac) hmac-sha2-256-etm@openssh.com       -- [info] available since OpenSSH 6.2&#xA;(mac) hmac-sha2-512-etm@openssh.com       -- [info] available since OpenSSH 6.2&#xA;(mac) hmac-sha1-etm@openssh.com           -- [fail] using broken SHA-1 hash algorithm&#xA;                                          `- [info] available since OpenSSH 6.2&#xA;(mac) umac-64@openssh.com                 -- [warn] using encrypt-and-MAC mode&#xA;                                          `- [warn] using small 64-bit tag size&#xA;                                          `- [info] available since OpenSSH 4.7&#xA;(mac) umac-128@openssh.com                -- [warn] using encrypt-and-MAC mode&#xA;                                          `- [info] available since OpenSSH 6.2&#xA;(mac) hmac-sha2-256                       -- [warn] using encrypt-and-MAC mode&#xA;                                          `- [info] available since OpenSSH 5.9, Dropbear SSH 2013.56&#xA;(mac) hmac-sha2-512                       -- [warn] using encrypt-and-MAC mode&#xA;                                          `- [info] available since OpenSSH 5.9, Dropbear SSH 2013.56&#xA;(mac) hmac-sha1                           -- [fail] using broken SHA-1 hash algorithm&#xA;                                          `- [warn] using encrypt-and-MAC mode&#xA;                                          `- [info] available since OpenSSH 2.1.0, Dropbear SSH 0.28&#xA;&#xA;fingerprints&#xA;(fin) ssh-ed25519: SHA256:MQLZsXQca6z39VMYmL3a+BkZCbBSQywXlwUQ7t/SJJc&#xA;(fin) ssh-rsa: SHA256:rSR43CCF4H6QSMPR+TudpYEMuH0xQ/61iE4ktcidw2c&#xA;&#xA;additional info&#xA;(nfo) Be aware that, while this target properly supports the strict key exchange method (via the kex-strict-?-v00@openssh.com marker) needed to protect against the Terrapin vulnerability (CVE-2023-48795), all peers must also support this feature as well, otherwise the vulnerability will still be present.  The following algorithms would allow an unpatched peer to create vulnerable SSH channels with this target: chacha20-poly1305@openssh.com.  If any CBC ciphers are in this list, you may remove them while leaving the -etm@openssh.com MACs in place; these MACs are fine while paired with non-CBC cipher types.&#xA;&#xA;Per la scansione del server ssh basta:&#xA;&#xA;ssh-audit serverssh &#xA;se la porta è di default, se no occorre specificarla.&#xA;&#xA;Altrimenti se si vuole verificare la compliance con un target specifico, si può usare il flag -P&#xA;Ad es. per verificare la configurazione ottimale rispetto ad una debian 12 di riferimento.&#xA;&#xA;ssh-audit -P &#34;Hardened Debian 12 (version 2)&#34; serverssh&#xA;&#xA;e l&#39;argomento di P è dato da una delle policies della seguente lista:&#xA;&#xA;ssh-audit -L &#xA;&#xA;La versione attuale di ssh-audit è la 3.3.0 che supporta al max. OpenSSH 9.9, Debian 12, Ubuntu 24 ecc.&#xA;&#xA;Con la 3.4.0, ci sarà il supporto a OpenSSH 10, Debian 13, si rimuoverà sshv1 ecc. (per maggiori info https://github.com/jtesta/ssh-audit)&#xA;&#xA;Se avessi più server da verificare?&#xA;&#xA;ssh-audit -t host.txt&#xA;&#xA;dove host.txt è un file contente una lista host, uno per linea, dal formato: HOST[:PORT]&#xA;&#xA;Scansione client&#xA;Prima si fa partire un server ssh-audit sulla porta 2222 (default, altrimenti si può cambiare con -p) &#xA;&#xA;ssh-audit -c&#xA;&#xA;e poi si prova la connessione ssh sulla porta 2222 (o su quella impostata su localhost)&#xA;&#xA;ssh -p2222 127.0.0.1&#xA;&#xA;Come per il server, il risultato con una configurazione di default, di solito, non è molto incoraggiante:&#xA;&#xA;Connection closed by 127.0.0.1 port 2222&#xA;general&#xA;(gen) client IP: 127.0.0.1&#xA;(gen) banner: SSH-2.0-OpenSSH10.0&#xA;(gen) software: OpenSSH 10.0&#xA;(gen) compression: enabled (zlib@openssh.com)&#xA;&#xA;key exchange algorithms&#xA;(kex) mlkem768x25519-sha256                        -- [info] available since OpenSSH 9.9&#xA;                                                   `- [info] hybrid key exchange based on post-quantum resistant algorithm and proven conventional X25519 algorithm&#xA;(kex) curve25519-sha256                            -- [info] available since OpenSSH 7.4, Dropbear SSH 2018.76&#xA;                                                   `- [info] default key exchange from OpenSSH 7.4 to 8.9&#xA;(kex) curve25519-sha256@libssh.org                 -- [info] available since OpenSSH 6.4, Dropbear SSH 2013.62&#xA;                                                   `- [info] default key exchange from OpenSSH 6.5 to 7.3&#xA;(kex) ecdh-sha2-nistp256                           -- [fail] using elliptic curves that are suspected as being backdoored by the U.S. National Security Agency&#xA;                                                   `- [info] available since OpenSSH 5.7, Dropbear SSH 2013.62&#xA;(kex) ecdh-sha2-nistp384                           -- [fail] using elliptic curves that are suspected as being backdoored by the U.S. National Security Agency&#xA;                                                   `- [info] available since OpenSSH 5.7, Dropbear SSH 2013.62&#xA;(kex) ecdh-sha2-nistp521                           -- [fail] using elliptic curves that are suspected as being backdoored by the U.S. National Security Agency&#xA;                                                   `- [info] available since OpenSSH 5.7, Dropbear SSH 2013.62&#xA;(kex) diffie-hellman-group-exchange-sha256         -- [info] available since OpenSSH 4.4&#xA;(kex) diffie-hellman-group14-sha256                -- [warn] 2048-bit modulus only provides 112-bits of symmetric strength&#xA;                                                   `- [info] available since OpenSSH 7.3, Dropbear SSH 2016.73&#xA;(kex) diffie-hellman-group16-sha512                -- [info] available since OpenSSH 7.3, Dropbear SSH 2016.73&#xA;(kex) diffie-hellman-group18-sha512                -- [info] available since OpenSSH 7.3&#xA;(kex) ext-info-c                                   -- [info] available since OpenSSH 7.2&#xA;                                                   `- [info] pseudo-algorithm that denotes the peer supports RFC8308 extensions&#xA;(kex) kex-strict-c-v00@openssh.com                 -- [info] pseudo-algorithm that denotes the peer supports a stricter key exchange method as a counter-measure to the Terrapin attack (CVE-2023-48795)&#xA;&#xA;host-key algorithms&#xA;(key) ssh-ed25519-cert-v01@openssh.com             -- [info] available since OpenSSH 6.5&#xA;(key) ecdsa-sha2-nistp256-cert-v01@openssh.com     -- [fail] using elliptic curves that are suspected as being backdoored by the U.S. National Security Agency&#xA;                                                   `- [warn] using weak random number generator could reveal the key&#xA;                                                   `- [info] available since OpenSSH 5.7&#xA;(key) ecdsa-sha2-nistp384-cert-v01@openssh.com     -- [fail] using elliptic curves that are suspected as being backdoored by the U.S. National Security Agency&#xA;                                                   `- [warn] using weak random number generator could reveal the key&#xA;                                                   `- [info] available since OpenSSH 5.7&#xA;(key) ecdsa-sha2-nistp521-cert-v01@openssh.com     -- [fail] using elliptic curves that are suspected as being backdoored by the U.S. National Security Agency&#xA;                                                   `- [warn] using weak random number generator could reveal the key&#xA;                                                   `- [info] available since OpenSSH 5.7&#xA;(key) sk-ssh-ed25519-cert-v01@openssh.com          -- [info] available since OpenSSH 8.2&#xA;(key) sk-ecdsa-sha2-nistp256-cert-v01@openssh.com  -- [fail] using elliptic curves that are suspected as being backdoored by the U.S. National Security Agency&#xA;                                                   `- [warn] using weak random number generator could reveal the key&#xA;                                                   `- [info] available since OpenSSH 8.2&#xA;(key) rsa-sha2-512-cert-v01@openssh.com            -- [info] available since OpenSSH 7.8&#xA;(key) rsa-sha2-256-cert-v01@openssh.com            -- [info] available since OpenSSH 7.8&#xA;(key) ssh-ed25519                                  -- [info] available since OpenSSH 6.5, Dropbear SSH 2020.79&#xA;(key) ecdsa-sha2-nistp256                          -- [fail] using elliptic curves that are suspected as being backdoored by the U.S. National Security Agency&#xA;                                                   `- [warn] using weak random number generator could reveal the key&#xA;                                                   `- [info] available since OpenSSH 5.7, Dropbear SSH 2013.62&#xA;(key) ecdsa-sha2-nistp384                          -- [fail] using elliptic curves that are suspected as being backdoored by the U.S. National Security Agency&#xA;                                                   `- [warn] using weak random number generator could reveal the key&#xA;                                                   `- [info] available since OpenSSH 5.7, Dropbear SSH 2013.62&#xA;(key) ecdsa-sha2-nistp521                          -- [fail] using elliptic curves that are suspected as being backdoored by the U.S. National Security Agency&#xA;                                                   `- [warn] using weak random number generator could reveal the key&#xA;                                                   `- [info] available since OpenSSH 5.7, Dropbear SSH 2013.62&#xA;(key) sk-ssh-ed25519@openssh.com                   -- [info] available since OpenSSH 8.2&#xA;(key) sk-ecdsa-sha2-nistp256@openssh.com           -- [fail] using elliptic curves that are suspected as being backdoored by the U.S. National Security Agency&#xA;                                                   `- [warn] using weak random number generator could reveal the key&#xA;                                                   `- [info] available since OpenSSH 8.2&#xA;(key) rsa-sha2-512                                 -- [info] available since OpenSSH 7.2&#xA;(key) rsa-sha2-256                                 -- [info] available since OpenSSH 7.2, Dropbear SSH 2020.79&#xA;&#xA;encryption algorithms (ciphers)&#xA;(enc) aes256-gcm@openssh.com                       -- [info] available since OpenSSH 6.2&#xA;(enc) chacha20-poly1305@openssh.com                -- [info] available since OpenSSH 6.5, Dropbear SSH 2020.79&#xA;                                                   `- [info] default cipher since OpenSSH 6.9&#xA;(enc) aes256-ctr                                   -- [info] available since OpenSSH 3.7, Dropbear SSH 0.52&#xA;(enc) aes128-gcm@openssh.com                       -- [info] available since OpenSSH 6.2&#xA;(enc) aes128-ctr                                   -- [info] available since OpenSSH 3.7, Dropbear SSH 0.52&#xA;&#xA;message authentication code algorithms&#xA;(mac) hmac-sha2-256-etm@openssh.com                -- [info] available since OpenSSH 6.2&#xA;(mac) hmac-sha1-etm@openssh.com                    -- [fail] using broken SHA-1 hash algorithm&#xA;                                                   `- [info] available since OpenSSH 6.2&#xA;(mac) umac-128-etm@openssh.com                     -- [info] available since OpenSSH 6.2&#xA;(mac) hmac-sha2-512-etm@openssh.com                -- [info] available since OpenSSH 6.2&#xA;(mac) hmac-sha2-256                                -- [warn] using encrypt-and-MAC mode&#xA;                                                   `- [info] available since OpenSSH 5.9, Dropbear SSH 2013.56&#xA;(mac) hmac-sha1                                    -- [fail] using broken SHA-1 hash algorithm&#xA;                                                   `- [warn] using encrypt-and-MAC mode&#xA;                                                   `- [info] available since OpenSSH 2.1.0, Dropbear SSH 0.28&#xA;(mac) umac-128@openssh.com                         -- [warn] using encrypt-and-MAC mode&#xA;                                                   `- [info] available since OpenSSH 6.2&#xA;(mac) hmac-sha2-512                                -- [warn] using encrypt-and-MAC mode&#xA;                                                   `- [info] available since OpenSSH 5.9, Dropbear SSH 2013.56&#xA;&#xA;additional info&#xA;(nfo) Be aware that, while this target properly supports the strict key exchange method (via the kex-strict-?-v00@openssh.com marker) needed to protect against the Terrapin vulnerability (CVE-2023-48795), all peers must also support this feature as well, otherwise the vulnerability will still be present.  The following algorithms would allow an unpatched peer to create vulnerable SSH channels with this target: chacha20-poly1305@openssh.com.  If any CBC ciphers are in this list, you may remove them while leaving the -etm@openssh.com MACs in place; these MACs are fine while paired with non-CBC cipher types.&#xA;&#xA;Hardening&#xA;&#xA;Le scansioni dei client e dei server contengono numerosi suggerimenti per il miglioramento delle configurazioni.&#xA;&#xA;La conoscenza a grandi linee degli algoritmi usati da openssh per contrattare una connessione (e su questo può venire in aiuto, benché datato, il sito a cui ssh-audit.com si ispira: https://blog.stribik.technology/2015/01/04/secure-secure-shell.html) aiuterebbe.&#xA;&#xA;Oppure si può ricorrere o alle configurazioni &#34;precotte&#34; che potete trovare qui e magari partendo da quelle, limarle in base alle nostre esigenze.&#xA;&#xA;Come regola generale, in sintesi, ricordarsi di evitare in prima battuta:&#xA;&#xA;chiavi rsa &lt; 3072 bit&#xA;dsa&#xA;le curve nist&#xA;qualunque algoritmo che usi sha1&#xA;&#xA;Per il resto, basterebbe eliminare tutti gli algoritmi che risultano fail e warning dalla scansione e includere, in ordine decrescente, gli algoritmi più robusti che scaturiscono dalle liste degli algoritmi supportati dalla versione ssh in uso disponibili con ssh -Q:&#xA;&#xA;key exchange&#xA;ssh -Q kex&#xA;&#xA;cifratura simmetrica e simmetrica-autenticata&#xA;ssh -Q [ cipher | cipher-auth ]&#xA;&#xA;key types, CA signatures, certificate key types, tutti&#xA;ssh -Q [ key | key-ca-sign | key-cert | key-sig ]&#xA;&#xA;algoritmi di firma&#xA;ssh-Q sig&#xA;&#xA;L&#39;hardenizzazione di un servizio come ssh passa anche da altro. Esigerebbe una stretta sui metodi di autenticazione (la sola public key), restrizioi a utenti o gruppi di utenti ecc. (accennavo qualcosa qui)&#xA;&#xA;Ad ogni modo, una volta effettuato l&#39;hardening del server, ecco come si può presentare la scansione:&#xA;&#xA;general&#xA;(gen) banner: SSH-2.0-OpenSSH10.0p2 Raspbian-7&#xA;(gen) software: OpenSSH 10.0p2&#xA;(gen) compatibility: OpenSSH 9.6+, Dropbear SSH 2020.79+&#xA;(gen) compression: enabled (zlib@openssh.com)&#xA;&#xA;key exchange algorithms&#xA;(kex) sntrup761x25519-sha512@openssh.com    -- [info] available since OpenSSH 8.5&#xA;                                            `- [info] default key exchange from OpenSSH 9.0 to 9.8&#xA;                                            `- [info] hybrid key exchange based on post-quantum resistant algorithm and proven conventional X25519 algorithm&#xA;(kex) curve25519-sha256                     -- [info] available since OpenSSH 7.4, Dropbear SSH 2018.76&#xA;                                            `- [info] default key exchange from OpenSSH 7.4 to 8.9&#xA;(kex) curve25519-sha256@libssh.org          -- [info] available since OpenSSH 6.4, Dropbear SSH 2013.62&#xA;                                            `- [info] default key exchange from OpenSSH 6.5 to 7.3&#xA;(kex) diffie-hellman-group16-sha512         -- [info] available since OpenSSH 7.3, Dropbear SSH 2016.73&#xA;(kex) diffie-hellman-group18-sha512         -- [info] available since OpenSSH 7.3&#xA;(kex) diffie-hellman-group-exchange-sha256 (3072-bit) -- [info] available since OpenSSH 4.4&#xA;                                                      `- [info] OpenSSH&#39;s GEX fallback mechanism was triggered during testing. Very old SSH clients will still be able to create connections using a 2048-bit modulus, though modern clients will use 3072. This can only be disabled by recompiling the code (see https://github.com/openssh/openssh-portable/blob/V94/dh.c#L477).&#xA;(kex) ext-info-s                            -- [info] available since OpenSSH 9.6&#xA;                                            `- [info] pseudo-algorithm that denotes the peer supports RFC8308 extensions&#xA;(kex) kex-strict-s-v00@openssh.com          -- [info] pseudo-algorithm that denotes the peer supports a stricter key exchange method as a counter-measure to the Terrapin attack (CVE-2023-48795)&#xA;&#xA;host-key algorithms&#xA;(key) ssh-ed25519                           -- [info] available since OpenSSH 6.5, Dropbear SSH 2020.79&#xA;&#xA;encryption algorithms (ciphers)&#xA;(enc) aes256-gcm@openssh.com                -- [info] available since OpenSSH 6.2&#xA;(enc) aes256-ctr                            -- [info] available since OpenSSH 3.7, Dropbear SSH 0.52&#xA;(enc) aes192-ctr                            -- [info] available since OpenSSH 3.7&#xA;(enc) aes128-gcm@openssh.com                -- [info] available since OpenSSH 6.2&#xA;(enc) aes128-ctr                            -- [info] available since OpenSSH 3.7, Dropbear SSH 0.52&#xA;&#xA;message authentication code algorithms&#xA;(mac) hmac-sha2-256-etm@openssh.com         -- [info] available since OpenSSH 6.2&#xA;(mac) hmac-sha2-512-etm@openssh.com         -- [info] available since OpenSSH 6.2&#xA;(mac) umac-128-etm@openssh.com              -- [info] available since OpenSSH 6.2&#xA;&#xA;fingerprints&#xA;(fin) ssh-ed25519: SHA256:MQLZsXQca6z39VMYmL3a+BkZCbBSQywXlwUQ7t/SJJc&#xA;&#xA;Tutto molto verde, molto più rassicurante&#xA;&#xA;Idem dicasi per il client:&#xA;&#xA;general&#xA;(gen) client IP: 127.0.0.1&#xA;(gen) banner: SSH-2.0-OpenSSH_10.0&#xA;(gen) software: OpenSSH 10.0&#xA;(gen) compression: enabled (zlib@openssh.com)&#xA;&#xA;key exchange algorithms&#xA;(kex) sntrup761x25519-sha512@openssh.com    -- [info] available since OpenSSH 8.5&#xA;                                            `- [info] default key exchange from OpenSSH 9.0 to 9.8&#xA;                                            `- [info] hybrid key exchange based on post-quantum resistant algorithm and proven conventional X25519 algorithm&#xA;(kex) curve25519-sha256                     -- [info] available since OpenSSH 7.4, Dropbear SSH 2018.76&#xA;                                            `- [info] default key exchange from OpenSSH 7.4 to 8.9&#xA;(kex) curve25519-sha256@libssh.org          -- [info] available since OpenSSH 6.4, Dropbear SSH 2013.62&#xA;                                            `- [info] default key exchange from OpenSSH 6.5 to 7.3&#xA;(kex) diffie-hellman-group16-sha512         -- [info] available since OpenSSH 7.3, Dropbear SSH 2016.73&#xA;(kex) diffie-hellman-group18-sha512         -- [info] available since OpenSSH 7.3&#xA;(kex) diffie-hellman-group-exchange-sha256  -- [info] available since OpenSSH 4.4&#xA;(kex) ext-info-c                            -- [info] available since OpenSSH 7.2&#xA;                                            `- [info] pseudo-algorithm that denotes the peer supports RFC8308 extensions&#xA;(kex) kex-strict-c-v00@openssh.com          -- [info] pseudo-algorithm that denotes the peer supports a stricter key exchange method as a counter-measure to the Terrapin attack (CVE-2023-48795)&#xA;&#xA;host-key algorithms&#xA;(key) sk-ssh-ed25519-cert-v01@openssh.com   -- [info] available since OpenSSH 8.2&#xA;(key) ssh-ed25519-cert-v01@openssh.com      -- [info] available since OpenSSH 6.5&#xA;(key) rsa-sha2-512-cert-v01@openssh.com     -- [info] available since OpenSSH 7.8&#xA;(key) rsa-sha2-256-cert-v01@openssh.com     -- [info] available since OpenSSH 7.8&#xA;(key) sk-ssh-ed25519@openssh.com            -- [info] available since OpenSSH 8.2&#xA;(key) ssh-ed25519                           -- [info] available since OpenSSH 6.5, Dropbear SSH 2020.79&#xA;(key) rsa-sha2-512                          -- [info] available since OpenSSH 7.2&#xA;(key) rsa-sha2-256                          -- [info] available since OpenSSH 7.2, Dropbear SSH 2020.79&#xA;&#xA;encryption algorithms (ciphers)&#xA;(enc) aes256-gcm@openssh.com                -- [info] available since OpenSSH 6.2&#xA;(enc) aes256-ctr                            -- [info] available since OpenSSH 3.7, Dropbear SSH 0.52&#xA;(enc) aes192-ctr                            -- [info] available since OpenSSH 3.7&#xA;(enc) aes128-gcm@openssh.com                -- [info] available since OpenSSH 6.2&#xA;(enc) aes128-ctr                            -- [info] available since OpenSSH 3.7, Dropbear SSH 0.52&#xA;&#xA;message authentication code algorithms&#xA;(mac) hmac-sha2-256-etm@openssh.com         -- [info] available since OpenSSH 6.2&#xA;(mac) hmac-sha2-512-etm@openssh.com         -- [info] available since OpenSSH 6.2&#xA;(mac) umac-128-etm@openssh.com              -- [info] available since OpenSSH 6.2&#xA;Connection closed by 127.0.0.1 port 2222&#xA;Giusto per completezza, anche se la scansione generica può essere positiva, non è detto che lo sia l&#39;aderenza ad una specifica compliance.&#xA;&#xA;Una scansione di questo tipo infatti tiene conto di tutti gli algoritmi che devono essere presenti. E nell&#39;ordine stabilito.&#xA;&#xA;#ssh #sshaudit]]&gt;</description>
      <content:encoded><![CDATA[<p><img src="https://pixelfed.uno/storage/m/_v2/489827599091373610/c19ce1b25-2f8843/r0tEnEU2zL4y/WhbF4H8D4mnRULqFV8Cz9IYKBYu36Ahl5OeonsxT.jpg" alt="ssh-audit"></p>

<p><code>ssh-audit</code> è un un comodo tool per l&#39;audit di sicurezza del server e del client SSH (banner, scambio di chiavi, crittografia, mac, compressione, compatibilità, sicurezza, ecc.)</p>

<p>Il sito di riferimento: <a href="https://www.ssh-audit.com/" rel="nofollow">https://www.ssh-audit.com/</a> da cui si può effettuare una scansione sia del proprio client che di un server.

Questa sezione <a href="https://www.ssh-audit.com/hardening_guides.html" rel="nofollow">https://www.ssh-audit.com/hardening_guides.html</a> invece fornisce una serie di configurazioni rapide e sicure per la pletora di client e server più noti.</p>

<p>ssh-audit permette di eseguire delle scansioni generiche client e/o server o di controllare una specifica compliance (ne parlerò più avanti) in base al sistema in uso</p>

<h2 id="installare-ssh-audit">Installare ssh-audit</h2>

<p>Trattandosi di una utility via CLI, la installerò con <code>pipx</code> che mi garantisce il necessario isolamento e un link all&#39;eseguibile che sia “globale” per l&#39;utente.</p>

<pre><code class="language-bash">pipx install ssh-audit
# o pipx install ssh-audit --python python&lt;versione&gt;
# se si vuole una versione di python specifica
</code></pre>

<p>Se non dovesse essere presente pipx, nella nostra home:</p>

<pre><code class="language-bash"># aggiornamento e installazione pip, pipx
pip install --user -U pip pipx
</code></pre>

<p><code>ssh-audit</code> può essere usato per il check e la configurazione di un server ssh o del client.</p>

<h2 id="scansione-server">Scansione server</h2>

<p>Semplice.</p>

<pre><code class="language-bash">ssh-audit -p &lt;porta ssh&gt; &lt;ip / server ssh&gt;
</code></pre>

<p>effettua la scansione di un server ssh. Il risultato consisterà in una serie di informazioni sulle direttive riguardanti cipher, klex, mac ecc. che saranno:</p>
<ul><li><strong>[info]</strong> di colore verde o bianco corrispondenti a configurazioni corrette</li>
<li><strong>[warning]</strong> di colore giallo, corrispondenti a configurazioni da attenzionare</li>
<li><strong>[fail]</strong> di colore rosso, corrispondenti a configurazioni palesemente critiche e da correggere urgentemente.</li></ul>

<p>Ecco un es. di scansione sul default ssh server di una debian 13 (RaspBI 2):</p>

<pre><code># general
(gen) banner: SSH-2.0-OpenSSH_10.0p2 Raspbian-7
(gen) software: OpenSSH 10.0p2
(gen) compatibility: OpenSSH 9.9+, Dropbear SSH 2020.79+
(gen) compression: enabled (zlib@openssh.com)

# key exchange algorithms
(kex) mlkem768x25519-sha256               -- [info] available since OpenSSH 9.9
                                          `- [info] hybrid key exchange based on post-quantum resistant algorithm and proven conventional X25519 algorithm
(kex) sntrup761x25519-sha512              -- [info] available since OpenSSH 9.9
                                          `- [info] default key exchange since OpenSSH 9.9
                                          `- [info] hybrid key exchange based on post-quantum resistant algorithm and proven conventional X25519 algorithm
(kex) sntrup761x25519-sha512@openssh.com  -- [info] available since OpenSSH 8.5
                                          `- [info] default key exchange from OpenSSH 9.0 to 9.8
                                          `- [info] hybrid key exchange based on post-quantum resistant algorithm and proven conventional X25519 algorithm
(kex) curve25519-sha256                   -- [info] available since OpenSSH 7.4, Dropbear SSH 2018.76
                                          `- [info] default key exchange from OpenSSH 7.4 to 8.9
(kex) curve25519-sha256@libssh.org        -- [info] available since OpenSSH 6.4, Dropbear SSH 2013.62
                                          `- [info] default key exchange from OpenSSH 6.5 to 7.3
(kex) ecdh-sha2-nistp256                  -- [fail] using elliptic curves that are suspected as being backdoored by the U.S. National Security Agency
                                          `- [info] available since OpenSSH 5.7, Dropbear SSH 2013.62
(kex) ecdh-sha2-nistp384                  -- [fail] using elliptic curves that are suspected as being backdoored by the U.S. National Security Agency
                                          `- [info] available since OpenSSH 5.7, Dropbear SSH 2013.62
(kex) ecdh-sha2-nistp521                  -- [fail] using elliptic curves that are suspected as being backdoored by the U.S. National Security Agency
                                          `- [info] available since OpenSSH 5.7, Dropbear SSH 2013.62
(kex) ext-info-s                          -- [info] available since OpenSSH 9.6
                                          `- [info] pseudo-algorithm that denotes the peer supports RFC8308 extensions
(kex) kex-strict-s-v00@openssh.com        -- [info] pseudo-algorithm that denotes the peer supports a stricter key exchange method as a counter-measure to the Terrapin attack (CVE-2023-48795)

# host-key algorithms
(key) rsa-sha2-512 (3072-bit)             -- [info] available since OpenSSH 7.2
(key) rsa-sha2-256 (3072-bit)             -- [info] available since OpenSSH 7.2, Dropbear SSH 2020.79
(key) ecdsa-sha2-nistp256                 -- [fail] using elliptic curves that are suspected as being backdoored by the U.S. National Security Agency
                                          `- [warn] using weak random number generator could reveal the key
                                          `- [info] available since OpenSSH 5.7, Dropbear SSH 2013.62
(key) ssh-ed25519                         -- [info] available since OpenSSH 6.5, Dropbear SSH 2020.79

# encryption algorithms (ciphers)
(enc) chacha20-poly1305@openssh.com       -- [info] available since OpenSSH 6.5, Dropbear SSH 2020.79
                                          `- [info] default cipher since OpenSSH 6.9
(enc) aes128-gcm@openssh.com              -- [info] available since OpenSSH 6.2
(enc) aes256-gcm@openssh.com              -- [info] available since OpenSSH 6.2
(enc) aes128-ctr                          -- [info] available since OpenSSH 3.7, Dropbear SSH 0.52
(enc) aes192-ctr                          -- [info] available since OpenSSH 3.7
(enc) aes256-ctr                          -- [info] available since OpenSSH 3.7, Dropbear SSH 0.52

# message authentication code algorithms
(mac) umac-64-etm@openssh.com             -- [warn] using small 64-bit tag size
                                          `- [info] available since OpenSSH 6.2
(mac) umac-128-etm@openssh.com            -- [info] available since OpenSSH 6.2
(mac) hmac-sha2-256-etm@openssh.com       -- [info] available since OpenSSH 6.2
(mac) hmac-sha2-512-etm@openssh.com       -- [info] available since OpenSSH 6.2
(mac) hmac-sha1-etm@openssh.com           -- [fail] using broken SHA-1 hash algorithm
                                          `- [info] available since OpenSSH 6.2
(mac) umac-64@openssh.com                 -- [warn] using encrypt-and-MAC mode
                                          `- [warn] using small 64-bit tag size
                                          `- [info] available since OpenSSH 4.7
(mac) umac-128@openssh.com                -- [warn] using encrypt-and-MAC mode
                                          `- [info] available since OpenSSH 6.2
(mac) hmac-sha2-256                       -- [warn] using encrypt-and-MAC mode
                                          `- [info] available since OpenSSH 5.9, Dropbear SSH 2013.56
(mac) hmac-sha2-512                       -- [warn] using encrypt-and-MAC mode
                                          `- [info] available since OpenSSH 5.9, Dropbear SSH 2013.56
(mac) hmac-sha1                           -- [fail] using broken SHA-1 hash algorithm
                                          `- [warn] using encrypt-and-MAC mode
                                          `- [info] available since OpenSSH 2.1.0, Dropbear SSH 0.28

# fingerprints
(fin) ssh-ed25519: SHA256:MQLZsXQca6z39VMYmL3a+BkZCbBSQywXlwUQ7t/SJJc
(fin) ssh-rsa: SHA256:rSR43CCF4H6QSMPR+TudpYEMuH0xQ/61iE4ktcidw2c

# additional info
(nfo) Be aware that, while this target properly supports the strict key exchange method (via the kex-strict-?-v00@openssh.com marker) needed to protect against the Terrapin vulnerability (CVE-2023-48795), all peers must also support this feature as well, otherwise the vulnerability will still be present.  The following algorithms would allow an unpatched peer to create vulnerable SSH channels with this target: chacha20-poly1305@openssh.com.  If any CBC ciphers are in this list, you may remove them while leaving the *-etm@openssh.com MACs in place; these MACs are fine while paired with non-CBC cipher types.
</code></pre>

<p>Per la scansione del server ssh basta:</p>

<pre><code class="language-bash">ssh-audit server_ssh 
# se la porta è di default, se no occorre specificarla.
</code></pre>

<p>Altrimenti se si vuole verificare la compliance con un target specifico, si può usare il flag <code>-P</code>
Ad es. per verificare la configurazione ottimale rispetto ad una debian 12 di riferimento.</p>

<pre><code class="language-bash">ssh-audit -P &#34;Hardened Debian 12 (version 2)&#34; &lt;server_ssh&gt;
</code></pre>

<p>e l&#39;argomento di <code>P</code> è dato da una delle policies della seguente lista:</p>

<pre><code class="language-bash">ssh-audit -L 
</code></pre>

<p>La versione attuale di ssh-audit è la <strong>3.3.0</strong> che supporta al max. <strong>OpenSSH 9.9</strong>, <strong>Debian 12</strong>, <strong>Ubuntu 24</strong> ecc.</p>

<p>Con la 3.4.0, ci sarà il supporto a <strong>OpenSSH 10</strong>, <strong>Debian 13</strong>, si rimuoverà sshv1 ecc. (per maggiori info <a href="https://github.com/jtesta/ssh-audit" rel="nofollow">https://github.com/jtesta/ssh-audit</a>)</p>

<p>Se avessi più server da verificare?</p>

<pre><code class="language-bash">ssh-audit -t host.txt
</code></pre>

<p>dove <code>host.txt</code> è un file contente una lista host, uno per linea, dal formato: <code>HOST[:PORT]</code></p>

<h2 id="scansione-client">Scansione client</h2>

<p>Prima si fa partire un server ssh-audit sulla porta 2222 (default, altrimenti si può cambiare con <code>-p</code>)</p>

<pre><code class="language-bash">ssh-audit -c
</code></pre>

<p>e poi si prova la connessione ssh sulla porta 2222 (o su quella impostata su localhost)</p>

<pre><code class="language-bash">ssh -p2222 127.0.0.1
</code></pre>

<p>Come per il server, il risultato con una configurazione di default, di solito, non è molto incoraggiante:</p>

<pre><code class="language-bash">Connection closed by 127.0.0.1 port 2222
# general
(gen) client IP: 127.0.0.1
(gen) banner: SSH-2.0-OpenSSH_10.0
(gen) software: OpenSSH 10.0
(gen) compression: enabled (zlib@openssh.com)

# key exchange algorithms
(kex) mlkem768x25519-sha256                        -- [info] available since OpenSSH 9.9
                                                   `- [info] hybrid key exchange based on post-quantum resistant algorithm and proven conventional X25519 algorithm
(kex) curve25519-sha256                            -- [info] available since OpenSSH 7.4, Dropbear SSH 2018.76
                                                   `- [info] default key exchange from OpenSSH 7.4 to 8.9
(kex) curve25519-sha256@libssh.org                 -- [info] available since OpenSSH 6.4, Dropbear SSH 2013.62
                                                   `- [info] default key exchange from OpenSSH 6.5 to 7.3
(kex) ecdh-sha2-nistp256                           -- [fail] using elliptic curves that are suspected as being backdoored by the U.S. National Security Agency
                                                   `- [info] available since OpenSSH 5.7, Dropbear SSH 2013.62
(kex) ecdh-sha2-nistp384                           -- [fail] using elliptic curves that are suspected as being backdoored by the U.S. National Security Agency
                                                   `- [info] available since OpenSSH 5.7, Dropbear SSH 2013.62
(kex) ecdh-sha2-nistp521                           -- [fail] using elliptic curves that are suspected as being backdoored by the U.S. National Security Agency
                                                   `- [info] available since OpenSSH 5.7, Dropbear SSH 2013.62
(kex) diffie-hellman-group-exchange-sha256         -- [info] available since OpenSSH 4.4
(kex) diffie-hellman-group14-sha256                -- [warn] 2048-bit modulus only provides 112-bits of symmetric strength
                                                   `- [info] available since OpenSSH 7.3, Dropbear SSH 2016.73
(kex) diffie-hellman-group16-sha512                -- [info] available since OpenSSH 7.3, Dropbear SSH 2016.73
(kex) diffie-hellman-group18-sha512                -- [info] available since OpenSSH 7.3
(kex) ext-info-c                                   -- [info] available since OpenSSH 7.2
                                                   `- [info] pseudo-algorithm that denotes the peer supports RFC8308 extensions
(kex) kex-strict-c-v00@openssh.com                 -- [info] pseudo-algorithm that denotes the peer supports a stricter key exchange method as a counter-measure to the Terrapin attack (CVE-2023-48795)

# host-key algorithms
(key) ssh-ed25519-cert-v01@openssh.com             -- [info] available since OpenSSH 6.5
(key) ecdsa-sha2-nistp256-cert-v01@openssh.com     -- [fail] using elliptic curves that are suspected as being backdoored by the U.S. National Security Agency
                                                   `- [warn] using weak random number generator could reveal the key
                                                   `- [info] available since OpenSSH 5.7
(key) ecdsa-sha2-nistp384-cert-v01@openssh.com     -- [fail] using elliptic curves that are suspected as being backdoored by the U.S. National Security Agency
                                                   `- [warn] using weak random number generator could reveal the key
                                                   `- [info] available since OpenSSH 5.7
(key) ecdsa-sha2-nistp521-cert-v01@openssh.com     -- [fail] using elliptic curves that are suspected as being backdoored by the U.S. National Security Agency
                                                   `- [warn] using weak random number generator could reveal the key
                                                   `- [info] available since OpenSSH 5.7
(key) sk-ssh-ed25519-cert-v01@openssh.com          -- [info] available since OpenSSH 8.2
(key) sk-ecdsa-sha2-nistp256-cert-v01@openssh.com  -- [fail] using elliptic curves that are suspected as being backdoored by the U.S. National Security Agency
                                                   `- [warn] using weak random number generator could reveal the key
                                                   `- [info] available since OpenSSH 8.2
(key) rsa-sha2-512-cert-v01@openssh.com            -- [info] available since OpenSSH 7.8
(key) rsa-sha2-256-cert-v01@openssh.com            -- [info] available since OpenSSH 7.8
(key) ssh-ed25519                                  -- [info] available since OpenSSH 6.5, Dropbear SSH 2020.79
(key) ecdsa-sha2-nistp256                          -- [fail] using elliptic curves that are suspected as being backdoored by the U.S. National Security Agency
                                                   `- [warn] using weak random number generator could reveal the key
                                                   `- [info] available since OpenSSH 5.7, Dropbear SSH 2013.62
(key) ecdsa-sha2-nistp384                          -- [fail] using elliptic curves that are suspected as being backdoored by the U.S. National Security Agency
                                                   `- [warn] using weak random number generator could reveal the key
                                                   `- [info] available since OpenSSH 5.7, Dropbear SSH 2013.62
(key) ecdsa-sha2-nistp521                          -- [fail] using elliptic curves that are suspected as being backdoored by the U.S. National Security Agency
                                                   `- [warn] using weak random number generator could reveal the key
                                                   `- [info] available since OpenSSH 5.7, Dropbear SSH 2013.62
(key) sk-ssh-ed25519@openssh.com                   -- [info] available since OpenSSH 8.2
(key) sk-ecdsa-sha2-nistp256@openssh.com           -- [fail] using elliptic curves that are suspected as being backdoored by the U.S. National Security Agency
                                                   `- [warn] using weak random number generator could reveal the key
                                                   `- [info] available since OpenSSH 8.2
(key) rsa-sha2-512                                 -- [info] available since OpenSSH 7.2
(key) rsa-sha2-256                                 -- [info] available since OpenSSH 7.2, Dropbear SSH 2020.79

# encryption algorithms (ciphers)
(enc) aes256-gcm@openssh.com                       -- [info] available since OpenSSH 6.2
(enc) chacha20-poly1305@openssh.com                -- [info] available since OpenSSH 6.5, Dropbear SSH 2020.79
                                                   `- [info] default cipher since OpenSSH 6.9
(enc) aes256-ctr                                   -- [info] available since OpenSSH 3.7, Dropbear SSH 0.52
(enc) aes128-gcm@openssh.com                       -- [info] available since OpenSSH 6.2
(enc) aes128-ctr                                   -- [info] available since OpenSSH 3.7, Dropbear SSH 0.52

# message authentication code algorithms
(mac) hmac-sha2-256-etm@openssh.com                -- [info] available since OpenSSH 6.2
(mac) hmac-sha1-etm@openssh.com                    -- [fail] using broken SHA-1 hash algorithm
                                                   `- [info] available since OpenSSH 6.2
(mac) umac-128-etm@openssh.com                     -- [info] available since OpenSSH 6.2
(mac) hmac-sha2-512-etm@openssh.com                -- [info] available since OpenSSH 6.2
(mac) hmac-sha2-256                                -- [warn] using encrypt-and-MAC mode
                                                   `- [info] available since OpenSSH 5.9, Dropbear SSH 2013.56
(mac) hmac-sha1                                    -- [fail] using broken SHA-1 hash algorithm
                                                   `- [warn] using encrypt-and-MAC mode
                                                   `- [info] available since OpenSSH 2.1.0, Dropbear SSH 0.28
(mac) umac-128@openssh.com                         -- [warn] using encrypt-and-MAC mode
                                                   `- [info] available since OpenSSH 6.2
(mac) hmac-sha2-512                                -- [warn] using encrypt-and-MAC mode
                                                   `- [info] available since OpenSSH 5.9, Dropbear SSH 2013.56

# additional info
(nfo) Be aware that, while this target properly supports the strict key exchange method (via the kex-strict-?-v00@openssh.com marker) needed to protect against the Terrapin vulnerability (CVE-2023-48795), all peers must also support this feature as well, otherwise the vulnerability will still be present.  The following algorithms would allow an unpatched peer to create vulnerable SSH channels with this target: chacha20-poly1305@openssh.com.  If any CBC ciphers are in this list, you may remove them while leaving the *-etm@openssh.com MACs in place; these MACs are fine while paired with non-CBC cipher types.
</code></pre>

<h2 id="hardening">Hardening</h2>

<p>Le scansioni dei client e dei server contengono numerosi suggerimenti per il miglioramento delle configurazioni.</p>

<p>La conoscenza a grandi linee degli algoritmi usati da openssh per contrattare una connessione (e su questo può venire in aiuto, benché datato, il sito a cui ssh-audit.com si ispira: <a href="https://blog.stribik.technology/2015/01/04/secure-secure-shell.html" rel="nofollow">https://blog.stribik.technology/2015/01/04/secure-secure-shell.html</a>) aiuterebbe.</p>

<p>Oppure si può ricorrere o alle configurazioni “precotte” che potete trovare <a href="https://www.ssh-audit.com/hardening_guides.html" rel="nofollow">qui</a> e magari partendo da quelle, limarle in base alle nostre esigenze.</p>

<p>Come regola generale, in sintesi, ricordarsi di evitare in prima battuta:</p>
<ul><li>chiavi rsa &lt; 3072 bit</li>
<li>dsa</li>
<li>le curve nist</li>
<li>qualunque algoritmo che usi sha1</li></ul>

<p>Per il resto, basterebbe eliminare tutti gli algoritmi che risultano fail e warning dalla scansione e includere, in ordine decrescente, gli algoritmi più robusti che scaturiscono dalle liste degli algoritmi supportati dalla versione ssh in uso disponibili con <code>ssh -Q</code>:</p>

<pre><code class="language-bash"># key exchange
ssh -Q kex

# cifratura simmetrica e simmetrica-autenticata
ssh -Q [ cipher | cipher-auth ]

# key types, CA signatures, certificate key types, tutti
ssh -Q [ key | key-ca-sign | key-cert | key-sig ]

# algoritmi di firma
ssh-Q sig
</code></pre>

<p>L&#39;hardenizzazione di un servizio come ssh passa anche da altro. Esigerebbe una stretta sui metodi di autenticazione (la sola public key), restrizioi a utenti o gruppi di utenti ecc. (accennavo qualcosa qui)</p>

<p>Ad ogni modo, una volta effettuato l&#39;hardening del server, ecco come si può presentare la scansione:</p>

<pre><code># general
(gen) banner: SSH-2.0-OpenSSH_10.0p2 Raspbian-7
(gen) software: OpenSSH 10.0p2
(gen) compatibility: OpenSSH 9.6+, Dropbear SSH 2020.79+
(gen) compression: enabled (zlib@openssh.com)

# key exchange algorithms
(kex) sntrup761x25519-sha512@openssh.com    -- [info] available since OpenSSH 8.5
                                            `- [info] default key exchange from OpenSSH 9.0 to 9.8
                                            `- [info] hybrid key exchange based on post-quantum resistant algorithm and proven conventional X25519 algorithm
(kex) curve25519-sha256                     -- [info] available since OpenSSH 7.4, Dropbear SSH 2018.76
                                            `- [info] default key exchange from OpenSSH 7.4 to 8.9
(kex) curve25519-sha256@libssh.org          -- [info] available since OpenSSH 6.4, Dropbear SSH 2013.62
                                            `- [info] default key exchange from OpenSSH 6.5 to 7.3
(kex) diffie-hellman-group16-sha512         -- [info] available since OpenSSH 7.3, Dropbear SSH 2016.73
(kex) diffie-hellman-group18-sha512         -- [info] available since OpenSSH 7.3
(kex) diffie-hellman-group-exchange-sha256 (3072-bit) -- [info] available since OpenSSH 4.4
                                                      `- [info] OpenSSH&#39;s GEX fallback mechanism was triggered during testing. Very old SSH clients will still be able to create connections using a 2048-bit modulus, though modern clients will use 3072. This can only be disabled by recompiling the code (see https://github.com/openssh/openssh-portable/blob/V_9_4/dh.c#L477).
(kex) ext-info-s                            -- [info] available since OpenSSH 9.6
                                            `- [info] pseudo-algorithm that denotes the peer supports RFC8308 extensions
(kex) kex-strict-s-v00@openssh.com          -- [info] pseudo-algorithm that denotes the peer supports a stricter key exchange method as a counter-measure to the Terrapin attack (CVE-2023-48795)

# host-key algorithms
(key) ssh-ed25519                           -- [info] available since OpenSSH 6.5, Dropbear SSH 2020.79

# encryption algorithms (ciphers)
(enc) aes256-gcm@openssh.com                -- [info] available since OpenSSH 6.2
(enc) aes256-ctr                            -- [info] available since OpenSSH 3.7, Dropbear SSH 0.52
(enc) aes192-ctr                            -- [info] available since OpenSSH 3.7
(enc) aes128-gcm@openssh.com                -- [info] available since OpenSSH 6.2
(enc) aes128-ctr                            -- [info] available since OpenSSH 3.7, Dropbear SSH 0.52

# message authentication code algorithms
(mac) hmac-sha2-256-etm@openssh.com         -- [info] available since OpenSSH 6.2
(mac) hmac-sha2-512-etm@openssh.com         -- [info] available since OpenSSH 6.2
(mac) umac-128-etm@openssh.com              -- [info] available since OpenSSH 6.2

# fingerprints
(fin) ssh-ed25519: SHA256:MQLZsXQca6z39VMYmL3a+BkZCbBSQywXlwUQ7t/SJJc
</code></pre>

<p>Tutto molto verde, molto più rassicurante</p>

<p>Idem dicasi per il client:</p>

<pre><code># general
(gen) client IP: 127.0.0.1
(gen) banner: SSH-2.0-OpenSSH_10.0
(gen) software: OpenSSH 10.0
(gen) compression: enabled (zlib@openssh.com)

# key exchange algorithms
(kex) sntrup761x25519-sha512@openssh.com    -- [info] available since OpenSSH 8.5
                                            `- [info] default key exchange from OpenSSH 9.0 to 9.8
                                            `- [info] hybrid key exchange based on post-quantum resistant algorithm and proven conventional X25519 algorithm
(kex) curve25519-sha256                     -- [info] available since OpenSSH 7.4, Dropbear SSH 2018.76
                                            `- [info] default key exchange from OpenSSH 7.4 to 8.9
(kex) curve25519-sha256@libssh.org          -- [info] available since OpenSSH 6.4, Dropbear SSH 2013.62
                                            `- [info] default key exchange from OpenSSH 6.5 to 7.3
(kex) diffie-hellman-group16-sha512         -- [info] available since OpenSSH 7.3, Dropbear SSH 2016.73
(kex) diffie-hellman-group18-sha512         -- [info] available since OpenSSH 7.3
(kex) diffie-hellman-group-exchange-sha256  -- [info] available since OpenSSH 4.4
(kex) ext-info-c                            -- [info] available since OpenSSH 7.2
                                            `- [info] pseudo-algorithm that denotes the peer supports RFC8308 extensions
(kex) kex-strict-c-v00@openssh.com          -- [info] pseudo-algorithm that denotes the peer supports a stricter key exchange method as a counter-measure to the Terrapin attack (CVE-2023-48795)

# host-key algorithms
(key) sk-ssh-ed25519-cert-v01@openssh.com   -- [info] available since OpenSSH 8.2
(key) ssh-ed25519-cert-v01@openssh.com      -- [info] available since OpenSSH 6.5
(key) rsa-sha2-512-cert-v01@openssh.com     -- [info] available since OpenSSH 7.8
(key) rsa-sha2-256-cert-v01@openssh.com     -- [info] available since OpenSSH 7.8
(key) sk-ssh-ed25519@openssh.com            -- [info] available since OpenSSH 8.2
(key) ssh-ed25519                           -- [info] available since OpenSSH 6.5, Dropbear SSH 2020.79
(key) rsa-sha2-512                          -- [info] available since OpenSSH 7.2
(key) rsa-sha2-256                          -- [info] available since OpenSSH 7.2, Dropbear SSH 2020.79

# encryption algorithms (ciphers)
(enc) aes256-gcm@openssh.com                -- [info] available since OpenSSH 6.2
(enc) aes256-ctr                            -- [info] available since OpenSSH 3.7, Dropbear SSH 0.52
(enc) aes192-ctr                            -- [info] available since OpenSSH 3.7
(enc) aes128-gcm@openssh.com                -- [info] available since OpenSSH 6.2
(enc) aes128-ctr                            -- [info] available since OpenSSH 3.7, Dropbear SSH 0.52

# message authentication code algorithms
(mac) hmac-sha2-256-etm@openssh.com         -- [info] available since OpenSSH 6.2
(mac) hmac-sha2-512-etm@openssh.com         -- [info] available since OpenSSH 6.2
(mac) umac-128-etm@openssh.com              -- [info] available since OpenSSH 6.2
Connection closed by 127.0.0.1 port 2222
</code></pre>

<p>Giusto per completezza, anche se la scansione generica può essere positiva, non è detto che lo sia l&#39;aderenza ad una specifica compliance.</p>

<p>Una scansione di questo tipo infatti tiene conto di <strong>tutti</strong> gli algoritmi che devono essere presenti. E nell&#39;ordine stabilito.</p>

<p><a href="/aytin/tag:ssh" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">ssh</span></a> <a href="/aytin/tag:sshaudit" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">sshaudit</span></a></p>
]]></content:encoded>
      <guid>https://noblogo.org/aytin/audit-per-client-e-server-ssh</guid>
      <pubDate>Sat, 13 Dec 2025 11:08:44 +0000</pubDate>
    </item>
  </channel>
</rss>