mirror of
https://github.com/jtesta/ssh-audit.git
synced 2026-05-25 15:31:23 +02:00
Compare commits
16 Commits
v3.3.0
..
829265ce6b
| Author | SHA1 | Date | |
|---|---|---|---|
| 829265ce6b | |||
| 62d41ea35f | |||
| f15e53ef17 | |||
| 6b8b20aebb | |||
| 231a47959a | |||
| 48b9ee7deb | |||
| e318787a5c | |||
| d9c703c777 | |||
| 28a1e23986 | |||
| 9814d18baf | |||
| a01baadfa8 | |||
| 45abc3aaf4 | |||
| 99c64787d9 | |||
| 3fa62c3ac5 | |||
| d7fff591fa | |||
| 84647ecb32 |
+9
-9
@@ -15,10 +15,10 @@ An executable can only be made on a Windows host because the PyInstaller tool (h
|
|||||||
|
|
||||||
# PyPI
|
# PyPI
|
||||||
|
|
||||||
To create package and upload to test server (hint: use username '\_\_token\_\_' and API token for test.pypi.org):
|
To create package and upload to test server (hint: use API token for test.pypi.org):
|
||||||
|
|
||||||
```
|
```
|
||||||
$ sudo apt install python3-virtualenv python3.10-venv
|
$ sudo apt install python3-virtualenv python3.12-venv
|
||||||
$ make -f Makefile.pypi
|
$ make -f Makefile.pypi
|
||||||
$ make -f Makefile.pypi uploadtest
|
$ make -f Makefile.pypi uploadtest
|
||||||
```
|
```
|
||||||
@@ -26,12 +26,12 @@ To create package and upload to test server (hint: use username '\_\_token\_\_'
|
|||||||
To download from test server and verify:
|
To download from test server and verify:
|
||||||
|
|
||||||
```
|
```
|
||||||
$ virtualenv -p /usr/bin/python3 /tmp/pypi_test
|
$ virtualenv /tmp/pypi_test
|
||||||
$ cd /tmp/pypi_test; source bin/activate
|
$ cd /tmp/pypi_test; source bin/activate
|
||||||
$ pip3 install --index-url https://test.pypi.org/simple ssh-audit
|
$ pip3 install --index-url https://test.pypi.org/simple ssh-audit
|
||||||
```
|
```
|
||||||
|
|
||||||
To upload to production server (hint: use username '\_\_token\_\_' and API token for production pypi.org):
|
To upload to production server (hint: use API token for production pypi.org):
|
||||||
|
|
||||||
```
|
```
|
||||||
$ make -f Makefile.pypi uploadprod
|
$ make -f Makefile.pypi uploadprod
|
||||||
@@ -40,7 +40,7 @@ To upload to production server (hint: use username '\_\_token\_\_' and API token
|
|||||||
To download from production server and verify:
|
To download from production server and verify:
|
||||||
|
|
||||||
```
|
```
|
||||||
$ virtualenv -p /usr/bin/python3 /tmp/pypi_prod
|
$ virtualenv /tmp/pypi_prod
|
||||||
$ cd /tmp/pypi_prod; source bin/activate
|
$ cd /tmp/pypi_prod; source bin/activate
|
||||||
$ pip3 install ssh-audit
|
$ pip3 install ssh-audit
|
||||||
```
|
```
|
||||||
@@ -48,14 +48,14 @@ To download from production server and verify:
|
|||||||
|
|
||||||
# Snap
|
# Snap
|
||||||
|
|
||||||
To create the snap package, run a fully-updated Ubuntu Server 22.04 VM.
|
To create the Snap package, run a fully-updated Ubuntu Server 24.04 VM.
|
||||||
|
|
||||||
Create the snap package with:
|
Create the Snap package with:
|
||||||
```
|
```
|
||||||
$ ./build_snap.sh
|
$ ./build_snap.sh
|
||||||
```
|
```
|
||||||
|
|
||||||
Upload the snap with:
|
Upload the Snap with:
|
||||||
|
|
||||||
```
|
```
|
||||||
$ snapcraft export-login ~/snap_creds.txt
|
$ snapcraft export-login ~/snap_creds.txt
|
||||||
@@ -68,7 +68,7 @@ Upload the snap with:
|
|||||||
|
|
||||||
# Docker
|
# Docker
|
||||||
|
|
||||||
Ensure that the buildx plugin is available by following the installation instructions available at: https://docs.docker.com/engine/install/ubuntu/
|
Ensure that the `buildx` plugin is available by following the installation instructions available at: https://docs.docker.com/engine/install/ubuntu/
|
||||||
|
|
||||||
Build a local image with:
|
Build a local image with:
|
||||||
|
|
||||||
|
|||||||
@@ -41,64 +41,61 @@
|
|||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
```
|
```
|
||||||
usage: ssh-audit.py [options] <host>
|
usage: ssh-audit.py [-h] [-1] [-2] [-4] [-6] [-b] [-c] [-d]
|
||||||
|
[-g <min1:pref1:max1[,min2:pref2:max2,...]> / <x-y[:step]>] [-j] [-l {info,warn,fail}] [-L]
|
||||||
|
[-M custom_policy.txt] [-m] [-n] [-P "Built-In Policy Name" / custom_policy.txt] [-p N]
|
||||||
|
[-T targets.txt] [-t N] [-v] [--conn-rate-test N[:max_rate]] [--dheat N[:kex[:e_len]]]
|
||||||
|
[--lookup alg1[,alg2,...]] [--skip-rate-test] [--threads N]
|
||||||
|
[host]
|
||||||
|
|
||||||
-h, --help print this help
|
positional arguments:
|
||||||
|
host target hostname or IPv4/IPv6 address
|
||||||
|
|
||||||
|
optional arguments:
|
||||||
|
-h, --help show this help message and exit
|
||||||
-1, --ssh1 force ssh version 1 only
|
-1, --ssh1 force ssh version 1 only
|
||||||
-2, --ssh2 force ssh version 2 only
|
-2, --ssh2 force ssh version 2 only
|
||||||
-4, --ipv4 enable IPv4 (order of precedence)
|
-4, --ipv4 enable IPv4 (order of precedence)
|
||||||
-6, --ipv6 enable IPv6 (order of precedence)
|
-6, --ipv6 enable IPv6 (order of precedence)
|
||||||
-b, --batch batch output
|
-b, --batch batch output
|
||||||
-c, --client-audit starts a server on port 2222 to audit client
|
-c, --client-audit starts a server on port 2222 to audit client software config (use -p to change port; use -t
|
||||||
software config (use -p to change port;
|
to change timeout)
|
||||||
use -t to change timeout)
|
-d, --debug enable debugging output
|
||||||
--conn-rate-test=N[:max_rate] perform a connection rate test (useful
|
-g <min1:pref1:max1[,min2:pref2:max2,...]> / <x-y[:step]>, --gex-test <min1:pref1:max1[,min2:pref2:max2,...]> / <x-y[:step]>
|
||||||
for collecting metrics related to
|
conducts a very customized Diffie-Hellman GEX modulus size test. Tests an array of minimum,
|
||||||
susceptibility of the DHEat vuln).
|
preferred, and maximum values, or a range of values with an optional incremental step amount
|
||||||
Testing is conducted with N concurrent
|
-j, --json enable JSON output (use -jj to enable indentation for better readability)
|
||||||
sockets with an optional maximum rate
|
-l {info,warn,fail}, --level {info,warn,fail}
|
||||||
of connections per second.
|
minimum output level (default: info)
|
||||||
-d, --debug Enable debug output.
|
-L, --list-policies list all the official, built-in policies. Combine with -v to view policy change logs
|
||||||
--dheat=N[:kex[:e_len]] continuously perform the DHEat DoS attack
|
-M custom_policy.txt, --make-policy custom_policy.txt
|
||||||
(CVE-2002-20001) against the target using N
|
creates a policy based on the target server (i.e.: the target server has the ideal
|
||||||
concurrent sockets. Optionally, a specific
|
configuration that other servers should adhere to), and stores it in the file path specified
|
||||||
key exchange algorithm can be specified
|
-m, --manual print the man page (Docker, PyPI, Snap, and Windows builds only)
|
||||||
instead of allowing it to be automatically
|
-n, --no-colors disable colors (automatic when the NO_COLOR environment variable is set)
|
||||||
chosen. Additionally, a small length of
|
-P "Built-In Policy Name" / custom_policy.txt, --policy "Built-In Policy Name" / custom_policy.txt
|
||||||
the fake e value sent to the server can
|
run a policy test using the specified policy (use -L to see built-in policies, or specify
|
||||||
be chosen for a more efficient attack (such
|
filesystem path to custom policy created by -M)
|
||||||
as 4).
|
-p N, --port N the TCP port to connect to (or to listen on when -c is used)
|
||||||
-g, --gex-test=<x[,y,...]> dh gex modulus size test
|
-T targets.txt, --targets targets.txt
|
||||||
<min1:pref1:max1[,min2:pref2:max2,...]>
|
a file containing a list of target hosts (one per line, format HOST[:PORT]). Use -p/--port
|
||||||
<x-y[:step]>
|
to set the default port for all hosts. Use --threads to control concurrent scans
|
||||||
-j, --json JSON output (use -jj to enable indents)
|
-t N, --timeout N timeout (in seconds) for connection and reading (default: 5)
|
||||||
-l, --level=<level> minimum output level (info|warn|fail)
|
-v, --verbose enable verbose output
|
||||||
-L, --list-policies list all the official, built-in policies. Use with -v
|
--conn-rate-test N[:max_rate]
|
||||||
to view policy change logs.
|
perform a connection rate test (useful for collecting metrics related to susceptibility of
|
||||||
--lookup=<alg1,alg2,...> looks up an algorithm(s) without
|
the DHEat vuln). Testing is conducted with N concurrent sockets with an optional maximum
|
||||||
connecting to a server
|
rate of connections per second
|
||||||
-m, --manual print the man page (Docker, PyPI, Snap, and Windows
|
--dheat N[:kex[:e_len]]
|
||||||
builds only)
|
continuously perform the DHEat DoS attack (CVE-2002-20001) against the target using N
|
||||||
-M, --make-policy=<policy.txt> creates a policy based on the target server
|
concurrent sockets. Optionally, a specific key exchange algorithm can be specified instead
|
||||||
(i.e.: the target server has the ideal
|
of allowing it to be automatically chosen. Additionally, a small length of the fake e value
|
||||||
configuration that other servers should
|
sent to the server can be chosen for a more efficient attack (such as 4).
|
||||||
adhere to)
|
--lookup alg1[,alg2,...]
|
||||||
-n, --no-colors disable colors
|
looks up an algorithm(s) without connecting to a server.
|
||||||
-p, --port=<port> port to connect
|
--skip-rate-test skip the connection rate test during standard audits (used to safely infer whether the DHEat
|
||||||
-P, --policy=<"policy name" | policy.txt> run a policy test using the
|
attack is viable)
|
||||||
specified policy
|
--threads N number of threads to use when scanning multiple targets (-T/--targets) (default: 32)
|
||||||
--skip-rate-test skip the connection rate test during standard audits
|
|
||||||
(used to safely infer whether the DHEat attack
|
|
||||||
is viable)
|
|
||||||
-t, --timeout=<secs> timeout (in seconds) for connection and reading
|
|
||||||
(default: 5)
|
|
||||||
-T, --targets=<hosts.txt> a file containing a list of target hosts (one
|
|
||||||
per line, format HOST[:PORT]). Use -p/--port
|
|
||||||
to set the default port for all hosts. Use
|
|
||||||
--threads to control concurrent scans.
|
|
||||||
--threads=<threads> number of threads to use when scanning multiple
|
|
||||||
targets (-T/--targets) (default: 32)
|
|
||||||
-v, --verbose verbose output
|
|
||||||
```
|
```
|
||||||
* if both IPv4 and IPv6 are used, order of precedence can be set by using either `-46` or `-64`.
|
* if both IPv4 and IPv6 are used, order of precedence can be set by using either `-46` or `-64`.
|
||||||
* batch flag `-b` will output sections without header and without empty lines (implies verbose flag).
|
* batch flag `-b` will output sections without header and without empty lines (implies verbose flag).
|
||||||
@@ -219,6 +216,12 @@ For convenience, a web front-end on top of the command-line tool is available at
|
|||||||
|
|
||||||
## ChangeLog
|
## ChangeLog
|
||||||
|
|
||||||
|
### v3.4.0-dev
|
||||||
|
- Added warning to all key exchanges that do not include protections against quantum attacks due to the Harvest Now, Decrypt Later strategy (see https://en.wikipedia.org/wiki/Harvest_now,_decrypt_later).
|
||||||
|
- Migrated from deprecated `getopt` module to `argparse`; partial credit [oam7575](https://github.com/oam7575).
|
||||||
|
- When running against multiple hosts, now prints each target host regardless of output level.
|
||||||
|
- Batch mode (`-b`) no longer automatically enables verbose mode, due to sometimes confusing results; users can still explicitly enable verbose mode using the `-v` flag.
|
||||||
|
|
||||||
### v3.3.0 (2024-10-15)
|
### v3.3.0 (2024-10-15)
|
||||||
- Added Python 3.13 support.
|
- Added Python 3.13 support.
|
||||||
- Added built-in policies for Ubuntu 24.04 LTS server & client, OpenSSH 9.8, and OpenSSH 9.9.
|
- Added built-in policies for Ubuntu 24.04 LTS server & client, OpenSSH 9.8, and OpenSSH 9.9.
|
||||||
|
|||||||
@@ -111,18 +111,9 @@ echo "Processing man page at ${MAN_PAGE} and placing output into ${GLOBALS_PY}..
|
|||||||
# * 'MAN_KEEP_FORMATTING' preserves the backspace-overwrite sequence when
|
# * 'MAN_KEEP_FORMATTING' preserves the backspace-overwrite sequence when
|
||||||
# redirected to a file or a pipe.
|
# redirected to a file or a pipe.
|
||||||
# * sed converts unicode hyphens into an ASCI equivalent.
|
# * sed converts unicode hyphens into an ASCI equivalent.
|
||||||
# * The 'ul' command converts the backspace-overwrite sequence to an ANSI
|
|
||||||
# escape sequence. Not required under Cygwin because man outputs ANSI escape
|
|
||||||
# codes automatically.
|
|
||||||
|
|
||||||
echo BUILTIN_MAN_PAGE = '"""' >> "${GLOBALS_PY}"
|
echo BUILTIN_MAN_PAGE = '"""' >> "${GLOBALS_PY}"
|
||||||
|
|
||||||
if [[ "${PLATFORM}" == CYGWIN* ]]; then
|
|
||||||
MANWIDTH=80 MAN_KEEP_FORMATTING=1 man "${MAN_PAGE}" | sed $'s/\u2010/-/g' >> "${GLOBALS_PY}"
|
MANWIDTH=80 MAN_KEEP_FORMATTING=1 man "${MAN_PAGE}" | sed $'s/\u2010/-/g' >> "${GLOBALS_PY}"
|
||||||
else
|
|
||||||
MANWIDTH=80 MAN_KEEP_FORMATTING=1 man "${MAN_PAGE}" | ul | sed $'s/\u2010/-/g' >> "${GLOBALS_PY}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo '"""' >> "${GLOBALS_PY}"
|
echo '"""' >> "${GLOBALS_PY}"
|
||||||
|
|
||||||
echo "Done."
|
echo "Done."
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
THE SOFTWARE.
|
THE SOFTWARE.
|
||||||
"""
|
"""
|
||||||
# The version to display.
|
# The version to display.
|
||||||
VERSION = 'v3.3.0'
|
VERSION = 'v3.4.0-dev'
|
||||||
|
|
||||||
# SSH software to impersonate
|
# SSH software to impersonate
|
||||||
SSH_HEADER = 'SSH-{0}-OpenSSH_8.2'
|
SSH_HEADER = 'SSH-{0}-OpenSSH_8.2'
|
||||||
|
|||||||
@@ -0,0 +1,477 @@
|
|||||||
|
"""
|
||||||
|
The MIT License (MIT)
|
||||||
|
|
||||||
|
Copyright (C) 2020-2024 Joe Testa (jtesta@positronsecurity.com)
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in
|
||||||
|
all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
THE SOFTWARE.
|
||||||
|
"""
|
||||||
|
from typing import Dict, Any
|
||||||
|
import sys
|
||||||
|
|
||||||
|
from ssh_audit import exitcodes
|
||||||
|
from ssh_audit.globals import VERSION
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
BUILTIN_GUIDES: Dict[str, Dict[str, Any]] = {
|
||||||
|
|
||||||
|
# Server
|
||||||
|
# Amazon Server
|
||||||
|
'Amazon 2023 Server (version 1)': {'version': '1', 'changelog': {'2024-10-01': 'Re-ordered host keys to prioritize ED25519 due to efficiency. Re-ordered cipher list to prioritize larger key sizes as a countermeasure to quantum attacks', '2024-04-22': 'added connection throttling instructions to counteract the DHEat denial-of-service attack.', '2024-03-15': 'Initial revision'}, 'server_policy': True},
|
||||||
|
|
||||||
|
# Debian Server
|
||||||
|
'Debian Bullseye Server (version 1)': {'version': '1', 'changelog': {'2021-09-17': 'Initial Revision.'}, 'server_policy': True},
|
||||||
|
'Debian Bookworm Server (version 1)': {'version': '1', 'changelog': {'2021-09-17': 'Initial Revision.'}, 'server_policy': True},
|
||||||
|
|
||||||
|
# Rocky Linux
|
||||||
|
'Rocky 9 Server (version 1)': {'version': '1', 'changelog': {'2024-10-01': 'Re-ordered host keys to prioritize ED25519 due to efficiency. Re-ordered cipher list to prioritize larger key sizes as a countermeasure to quantum attacks', '\n2024-04-24': 'Added connection throttling instructions to counteract the DHEat denial-of-service attack.'}, 'server_policy': True},
|
||||||
|
|
||||||
|
# Ubuntu Server
|
||||||
|
'Ubuntu 2004 Server (version 1)': {'version': '1', 'changelog': {'2024-04-24': '\nAdded connection throttling instructions to counteract the DHEat denial-of-service attack.'}, 'server_policy': True},
|
||||||
|
'Ubuntu 2204 Server (version 1)': {'version': '1', 'changelog': {'2024-10-01': '\nRe-ordered host keys to prioritize ED25519 due to efficiency. \nRe-ordered cipher list to prioritize larger key sizes as a countermeasure to quantum attacks', '\n2024-04-22': '\nAdded connection throttling instructions to counteract the DHEat denial-of-service attack.'}, 'server_policy': True},
|
||||||
|
'Ubuntu 2404 Server (version 1)': {'version': '1', 'changelog': {'2024-10-01': '\nAdded Required RSASize directive to enforce a minimum of 3072-bit user and host-based authentication keys.', '\n2024-04-29': '\nInitial revision. In comparison to Ubuntu 22.04 LTS guide, the following changes were made: \n1.) For key exchanges, diffie-hellman-group18-sha512 and diffie-hellman-group-exchange-sha256 were prioritized over diffie-hellman-group16-sha512 due to greater security strength; GSS algorithms were prioritized over their non-GSS equivalents in order to match the client guide, \n2.) For ciphers, 256-bit AES ciphers were prioritized over 192 and 128-bit AES ciphers due to their increased resistence against quantum computing attacks (previously, weaker GCM ciphers had priority over CTR ciphers), \n3.) The HostbasedAcceptedAlgorithms and PubkeyAcceptedAlgorithms settings are now the same as HostKeyAlgorithms setting, \n4.) The hmac-sha2-512-etm@openssh.com MAC was increased in priority due to its increased resistence against quantum computing attacks, and \n5.) The ED25519 host keys were given priority over RSA host keys due to their greater efficiency.'}, 'server_policy': True},
|
||||||
|
|
||||||
|
# Client
|
||||||
|
# Amazon
|
||||||
|
'Amazon 2023 Client (version 1)': {'version': '1', 'changelog': {'2024-10-01': 'Re-ordered cipher list to prioritize larger key sizes as a countermeasure to quantum attacks.', '2024-04-22': 'added connection throttling instructions to counteract the DHEat denial-of-service attack.', '2024-03-15': 'Initial revision'}, 'server_policy': False},
|
||||||
|
|
||||||
|
# Debian
|
||||||
|
'Debian Bookworm Client (version 1)': {'version': '1', 'changelog': {'2024-10-01': 'Added RequiredRSASize directive to enforce a minimum of 3072-bit user and host-based authentication keys. Re-ordered cipher list to prioritize larger key sizes as a countermeasure to quantum attacks.', '2024-03-15': 'Initial Revision'}, 'server_policy': False},
|
||||||
|
|
||||||
|
# Rocky Linux
|
||||||
|
'Rocky 9 Client (version 1)': {'version': '1', 'changelog': {'2024-10-01': 'Added RequiredRSASize directive to enforce a minimum of 3072-bit user and host-based authentication keys. Re-ordered cipher list to prioritize larger key sizes as a countermeasure to quantum attacks.', '2024-03-15': 'Initial Revision'}, 'server_policy': False},
|
||||||
|
|
||||||
|
# Mint
|
||||||
|
'Mint 20 Client (version 1)': {'version': '1', 'changelog': {'2020-10-20': 'Initial Revision'}, 'server_policy': False},
|
||||||
|
'Mint 21 Client (version 1)': {'version': '1', 'changelog': {'2020-10-20': 'Initial Revision'}, 'server_policy': False},
|
||||||
|
'Mint 22 Client (version 1)': {'version': '1', 'changelog': {'2020-10-20': 'Initial Revision'}, 'server_policy': False},
|
||||||
|
|
||||||
|
# Ubuntu
|
||||||
|
'Ubuntu 2004 Client (version 1)': {'version': '1', 'changelog': {'2020-10-20': 'Initial Revision'}, 'server_policy': False},
|
||||||
|
'Ubuntu 2204 Client (version 1)': {'version': '1', 'changelog': {'2020-10-20': 'Initial Revision'}, 'server_policy': False},
|
||||||
|
'Ubuntu 2404 Client (version 1)': {'version': '1', 'changelog': {'2020-10-20': 'Initial Revision'}, 'server_policy': False},
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
class PrintHardeningGuides:
|
||||||
|
def __init__(self, os_type: str, os_ver: str, clientserver: str) -> None:
|
||||||
|
self.os_type = os_type
|
||||||
|
self.os_ver = os_ver
|
||||||
|
self.clientserver = clientserver
|
||||||
|
|
||||||
|
self.get_config()
|
||||||
|
|
||||||
|
def get_config(self) -> None:
|
||||||
|
|
||||||
|
retval = exitcodes.GOOD
|
||||||
|
|
||||||
|
os_type = self.os_type
|
||||||
|
os_ver = self.os_ver
|
||||||
|
clientserver = self.clientserver
|
||||||
|
policy_name = os_type + " " + os_ver + " " + clientserver
|
||||||
|
|
||||||
|
supported_os = ["Amazon", "Debian", "Mint", "Rocky", "Ubuntu"]
|
||||||
|
supported_edition = ["2404", "2204", "2004", "1804", "2023", "22", "21", "20", "9", "Bookworm", "Bullseye"]
|
||||||
|
if clientserver not in ["Server", "Client"] or os_type not in supported_os and os_ver not in supported_edition:
|
||||||
|
print(" ")
|
||||||
|
print(f"\033[1mssh-audit Version : {VERSION}\033[0m")
|
||||||
|
print(" ")
|
||||||
|
print(f"\033[1mConfiguration : {os_type} {os_ver} {clientserver} is not supported\033[0m")
|
||||||
|
PrintHardeningGuides.supported_varient()
|
||||||
|
sys.exit(retval)
|
||||||
|
|
||||||
|
# Server Configs
|
||||||
|
if clientserver in ["Server"]:
|
||||||
|
# Amazon Linux
|
||||||
|
if os_type in ["Amazon"] and os_ver in ["2023"]:
|
||||||
|
PrintHardeningGuides.print_ver_changelog(policy_name)
|
||||||
|
PrintHardeningGuides.server_modern_common()
|
||||||
|
PrintHardeningGuides.amazon_server_2023()
|
||||||
|
sys.exit(retval)
|
||||||
|
# Debian
|
||||||
|
elif os_type in ["Debian"] and os_ver in ["Bookworm"]:
|
||||||
|
PrintHardeningGuides.print_ver_changelog(policy_name)
|
||||||
|
PrintHardeningGuides.server_modern_common()
|
||||||
|
PrintHardeningGuides.bookworm_server()
|
||||||
|
PrintHardeningGuides.debian_ubuntu_rate_throttling()
|
||||||
|
sys.exit(retval)
|
||||||
|
elif os_type in ["Debian"] and os_ver in ["Bullseye"]:
|
||||||
|
PrintHardeningGuides.print_ver_changelog(policy_name)
|
||||||
|
PrintHardeningGuides.server_modern_common()
|
||||||
|
PrintHardeningGuides.bullseye_server()
|
||||||
|
sys.exit(retval)
|
||||||
|
# Rocky Linux
|
||||||
|
elif os_type in ["Rocky"] and os_ver in ["9"]:
|
||||||
|
PrintHardeningGuides.print_ver_changelog(policy_name)
|
||||||
|
PrintHardeningGuides.server_modern_common()
|
||||||
|
PrintHardeningGuides.rocky_9_server()
|
||||||
|
sys.exit(retval)
|
||||||
|
# Ubuntu
|
||||||
|
elif os_type in ["Ubuntu"] and os_ver in ["2404"]:
|
||||||
|
PrintHardeningGuides.print_ver_changelog(policy_name)
|
||||||
|
PrintHardeningGuides.server_modern_common()
|
||||||
|
PrintHardeningGuides.ubuntu_server_2404()
|
||||||
|
PrintHardeningGuides.debian_ubuntu_rate_throttling()
|
||||||
|
sys.exit(retval)
|
||||||
|
elif os_type in ["Ubuntu"] and os_ver in ["2204"]:
|
||||||
|
PrintHardeningGuides.print_ver_changelog(policy_name)
|
||||||
|
PrintHardeningGuides.server_modern_common()
|
||||||
|
PrintHardeningGuides.ubuntu_server_2204()
|
||||||
|
PrintHardeningGuides.debian_ubuntu_rate_throttling()
|
||||||
|
sys.exit(retval)
|
||||||
|
elif os_type in ["Ubuntu"] and os_ver in ["2004"]:
|
||||||
|
PrintHardeningGuides.print_ver_changelog(policy_name)
|
||||||
|
PrintHardeningGuides.server_modern_common()
|
||||||
|
PrintHardeningGuides.ubuntu_server_2004()
|
||||||
|
PrintHardeningGuides.debian_ubuntu_rate_throttling()
|
||||||
|
sys.exit(retval)
|
||||||
|
elif os_type in ["Ubuntu"] and os_ver in ["1804"]:
|
||||||
|
PrintHardeningGuides.print_ver_changelog(policy_name)
|
||||||
|
PrintHardeningGuides.server_legacy_common()
|
||||||
|
PrintHardeningGuides.ubuntu_server_1804()
|
||||||
|
sys.exit(retval)
|
||||||
|
else:
|
||||||
|
PrintHardeningGuides.supported_varient()
|
||||||
|
sys.exit(retval)
|
||||||
|
|
||||||
|
|
||||||
|
# Client Configs
|
||||||
|
if clientserver in ["Client"]:
|
||||||
|
# Amazon
|
||||||
|
if os_type in ["Amazon"] and os_ver in ["2023"]:
|
||||||
|
PrintHardeningGuides.print_ver_changelog(policy_name)
|
||||||
|
PrintHardeningGuides.amazon_2023_client()
|
||||||
|
sys.exit(retval)
|
||||||
|
# Debian
|
||||||
|
elif os_type in ["Debian"] and os_ver in ["Bookworm"]:
|
||||||
|
PrintHardeningGuides.print_ver_changelog(policy_name)
|
||||||
|
PrintHardeningGuides.debian_bookworm_client()
|
||||||
|
sys.exit(retval)
|
||||||
|
# Mint
|
||||||
|
elif os_type in ["Mint"] and os_ver in ["22"]:
|
||||||
|
PrintHardeningGuides.print_ver_changelog(policy_name)
|
||||||
|
PrintHardeningGuides.ubuntu_2404_mint_22_client()
|
||||||
|
sys.exit(retval)
|
||||||
|
elif os_type in ["Mint"] and os_ver in ["21"]:
|
||||||
|
PrintHardeningGuides.print_ver_changelog(policy_name)
|
||||||
|
PrintHardeningGuides.ubuntu_2204_mint_21_client()
|
||||||
|
sys.exit(retval)
|
||||||
|
elif os_type in ["Mint"] and os_ver in ["20"]:
|
||||||
|
PrintHardeningGuides.print_ver_changelog(policy_name)
|
||||||
|
PrintHardeningGuides.print_ver_changelog(policy_name)
|
||||||
|
PrintHardeningGuides.ubuntu_2004_mint_20_client()
|
||||||
|
sys.exit(retval)
|
||||||
|
# Rocky
|
||||||
|
elif os_type in ["Rocky"] and os_ver in ["9"]:
|
||||||
|
PrintHardeningGuides.print_ver_changelog(policy_name)
|
||||||
|
PrintHardeningGuides.rocky_9_client()
|
||||||
|
sys.exit(retval)
|
||||||
|
# Ubuntu
|
||||||
|
elif os_type in ["Ubuntu"] and os_ver in ["2404"]:
|
||||||
|
PrintHardeningGuides.print_ver_changelog(policy_name)
|
||||||
|
PrintHardeningGuides.ubuntu_2404_mint_22_client()
|
||||||
|
sys.exit(retval)
|
||||||
|
elif os_type in ["Ubuntu"] and os_ver in ["2204"]:
|
||||||
|
PrintHardeningGuides.print_ver_changelog(policy_name)
|
||||||
|
PrintHardeningGuides.ubuntu_2204_mint_21_client()
|
||||||
|
sys.exit(retval)
|
||||||
|
elif os_type in ["Ubuntu"] and os_ver in ["2004"]:
|
||||||
|
PrintHardeningGuides.print_ver_changelog(policy_name)
|
||||||
|
PrintHardeningGuides.ubuntu_2004_mint_20_client()
|
||||||
|
sys.exit(retval)
|
||||||
|
else:
|
||||||
|
PrintHardeningGuides.supported_varient()
|
||||||
|
sys.exit(retval)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def supported_varient() -> None:
|
||||||
|
retval = exitcodes.GOOD
|
||||||
|
print(" ")
|
||||||
|
print("For current, community developed and legacy guides")
|
||||||
|
print("check the website : https://www.ssh-audit.com/hardening_guides.html")
|
||||||
|
print(" ")
|
||||||
|
print("\033[1mSupported Server Configurations : \033[0m")
|
||||||
|
print(" ")
|
||||||
|
print(r"Amazon 2023 Server")
|
||||||
|
print(r"Debian Bookworm Server")
|
||||||
|
print(r"Debian Bullseye Server")
|
||||||
|
print(r"Rocky 9 Server")
|
||||||
|
print(r"Ubuntu 2404 Server")
|
||||||
|
print(r"Ubuntu 2204 Server")
|
||||||
|
print(r"Ubuntu 2004 Server")
|
||||||
|
print(" ")
|
||||||
|
print("\033[1mSupported Client Configurations : \033[0m")
|
||||||
|
print(r"Amazon 2023 Client")
|
||||||
|
print(r"Debian Bookworm Client")
|
||||||
|
print(r"Mint 22 Client")
|
||||||
|
print(r"Mint 21 Client")
|
||||||
|
print(r"Mint 20 Client")
|
||||||
|
print(r"Rocky 9 Client")
|
||||||
|
print(r"Ubuntu 2404 Client")
|
||||||
|
print(r"Ubuntu 2204 Client")
|
||||||
|
print(r"Ubuntu 2004 Client")
|
||||||
|
print(" ")
|
||||||
|
print("\033[1mExample Usage : \033[0m ")
|
||||||
|
print(r"python3 ssh-audit.py --get-hardening-guides Ubuntu 2404 Server")
|
||||||
|
print(" ")
|
||||||
|
sys.exit(retval)
|
||||||
|
|
||||||
|
|
||||||
|
# Client Configurations
|
||||||
|
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def amazon_2023_client() -> None:
|
||||||
|
print(" ")
|
||||||
|
print("\033[1mRun the following in a terminal to harden the SSH client for the local user:\033[0m")
|
||||||
|
print(" ")
|
||||||
|
print(r'mkdir -p -m 0700 ~/.ssh; echo -e "\nHost *\n Ciphers chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes256-ctr,aes192-ctr,aes128-gcm@openssh.com,aes128-ctr\n\n KexAlgorithms sntrup761x25519-sha512@openssh.com,gss-curve25519-sha256-,curve25519-sha256,curve25519-sha256@libssh.org,gss-group16-sha512-,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group-exchange-sha256\n\n MACs hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,umac-128-etm@openssh.com\n\n HostKeyAlgorithms sk-ssh-ed25519-cert-v01@openssh.com,ssh-ed25519-cert-v01@openssh.com,rsa-sha2-512-cert-v01@openssh.com,rsa-sha2-256-cert-v01@openssh.com,sk-ssh-ed25519@openssh.com,ssh-ed25519,rsa-sha2-512,rsa-sha2-256\n\n CASignatureAlgorithms sk-ssh-ed25519@openssh.com,ssh-ed25519,rsa-sha2-512,rsa-sha2-256\n\n GSSAPIKexAlgorithms gss-curve25519-sha256-,gss-group16-sha512-\n\n HostbasedAcceptedAlgorithms sk-ssh-ed25519-cert-v01@openssh.com,ssh-ed25519-cert-v01@openssh.com,sk-ssh-ed25519@openssh.com,ssh-ed25519,rsa-sha2-512-cert-v01@openssh.com,rsa-sha2-512,rsa-sha2-256-cert-v01@openssh.com,rsa-sha2-256\n\n PubkeyAcceptedAlgorithms sk-ssh-ed25519-cert-v01@openssh.com,ssh-ed25519-cert-v01@openssh.com,sk-ssh-ed25519@openssh.com,ssh-ed25519,rsa-sha2-512-cert-v01@openssh.com,rsa-sha2-512,rsa-sha2-256-cert-v01@openssh.com,rsa-sha2-256\n\n" >> ~/.ssh/config')
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def debian_bookworm_client() -> None:
|
||||||
|
print(" ")
|
||||||
|
print("\033[1mRun the following in a terminal to harden the SSH client for the local user:\033[0m")
|
||||||
|
print(" ")
|
||||||
|
print(r'mkdir -p -m 0700 ~/.ssh; echo -e "\nHost *\n Ciphers chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes256-ctr,aes192-ctr,aes128-gcm@openssh.com,aes128-ctr\n\n KexAlgorithms sntrup761x25519-sha512@openssh.com,gss-curve25519-sha256-,curve25519-sha256,curve25519-sha256@libssh.org,gss-group16-sha512-,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group-exchange-sha256\n\n MACs hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,umac-128-etm@openssh.com\n\n RequiredRSASize 3072\n\n HostKeyAlgorithms sk-ssh-ed25519-cert-v01@openssh.com,ssh-ed25519-cert-v01@openssh.com,rsa-sha2-512-cert-v01@openssh.com,rsa-sha2-256-cert-v01@openssh.com,sk-ssh-ed25519@openssh.com,ssh-ed25519,rsa-sha2-512,rsa-sha2-256\n\n CASignatureAlgorithms sk-ssh-ed25519@openssh.com,ssh-ed25519,rsa-sha2-512,rsa-sha2-256\n\n GSSAPIKexAlgorithms gss-curve25519-sha256-,gss-group16-sha512-\n\n HostbasedAcceptedAlgorithms sk-ssh-ed25519-cert-v01@openssh.com,ssh-ed25519-cert-v01@openssh.com,sk-ssh-ed25519@openssh.com,ssh-ed25519,rsa-sha2-512-cert-v01@openssh.com,rsa-sha2-512,rsa-sha2-256-cert-v01@openssh.com,rsa-sha2-256\n\n PubkeyAcceptedAlgorithms sk-ssh-ed25519-cert-v01@openssh.com,ssh-ed25519-cert-v01@openssh.com,sk-ssh-ed25519@openssh.com,ssh-ed25519,rsa-sha2-512-cert-v01@openssh.com,rsa-sha2-512,rsa-sha2-256-cert-v01@openssh.com,rsa-sha2-256\n\n" >> ~/.ssh/config')
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def rocky_9_client() -> None:
|
||||||
|
print("\033[1mRun the following in a terminal to harden the SSH client for the local user:\033[0m")
|
||||||
|
print(" ")
|
||||||
|
print(r'mkdir -p -m 0700 ~/.ssh; echo -e "\nHost *\n Ciphers chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes256-ctr,aes192-ctr,aes128-gcm@openssh.com,aes128-ctr\n\n KexAlgorithms sntrup761x25519-sha512@openssh.com,gss-curve25519-sha256-,curve25519-sha256,curve25519-sha256@libssh.org,gss-group16-sha512-,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group-exchange-sha256\n\n MACs hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,umac-128-etm@openssh.com\n\n RequiredRSASize 3072\n\n HostKeyAlgorithms sk-ssh-ed25519-cert-v01@openssh.com,ssh-ed25519-cert-v01@openssh.com,rsa-sha2-512-cert-v01@openssh.com,rsa-sha2-256-cert-v01@openssh.com,sk-ssh-ed25519@openssh.com,ssh-ed25519,rsa-sha2-512,rsa-sha2-256\n\n CASignatureAlgorithms sk-ssh-ed25519@openssh.com,ssh-ed25519,rsa-sha2-512,rsa-sha2-256\n\n GSSAPIKexAlgorithms gss-curve25519-sha256-,gss-group16-sha512-\n\n HostbasedAcceptedAlgorithms sk-ssh-ed25519-cert-v01@openssh.com,ssh-ed25519-cert-v01@openssh.com,sk-ssh-ed25519@openssh.com,ssh-ed25519,rsa-sha2-512-cert-v01@openssh.com,rsa-sha2-512,rsa-sha2-256-cert-v01@openssh.com,rsa-sha2-256\n\n PubkeyAcceptedAlgorithms sk-ssh-ed25519-cert-v01@openssh.com,ssh-ed25519-cert-v01@openssh.com,sk-ssh-ed25519@openssh.com,ssh-ed25519,rsa-sha2-512-cert-v01@openssh.com,rsa-sha2-512,rsa-sha2-256-cert-v01@openssh.com,rsa-sha2-256\n\n" >> ~/.ssh/config')
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def ubuntu_2404_mint_22_client() -> None:
|
||||||
|
print("\033[1mRun the following in a terminal to harden the SSH client for the local user:\033[0m")
|
||||||
|
print(" ")
|
||||||
|
print(r'mkdir -p -m 0700 ~/.ssh; echo -e "\nHost *\n Ciphers chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes256-ctr,aes192-ctr,aes128-gcm@openssh.com,aes128-ctr\n\n KexAlgorithms sntrup761x25519-sha512@openssh.com,gss-curve25519-sha256-,curve25519-sha256,curve25519-sha256@libssh.org,diffie-hellman-group18-sha512,diffie-hellman-group-exchange-sha256,gss-group16-sha512-,diffie-hellman-group16-sha512\n\n MACs hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com,umac-128-etm@openssh.com\n\n RequiredRSASize 3072\n\n HostKeyAlgorithms sk-ssh-ed25519-cert-v01@openssh.com,ssh-ed25519-cert-v01@openssh.com,rsa-sha2-512-cert-v01@openssh.com,rsa-sha2-256-cert-v01@openssh.com,sk-ssh-ed25519@openssh.com,ssh-ed25519,rsa-sha2-512,rsa-sha2-256\n\n CASignatureAlgorithms sk-ssh-ed25519@openssh.com,ssh-ed25519,rsa-sha2-512,rsa-sha2-256\n\n GSSAPIKexAlgorithms gss-curve25519-sha256-,gss-group16-sha512-\n\n HostbasedAcceptedAlgorithms sk-ssh-ed25519-cert-v01@openssh.com,ssh-ed25519-cert-v01@openssh.com,rsa-sha2-512-cert-v01@openssh.com,rsa-sha2-256-cert-v01@openssh.com,sk-ssh-ed25519@openssh.com,ssh-ed25519,rsa-sha2-512,rsa-sha2-256\n\n PubkeyAcceptedAlgorithms sk-ssh-ed25519-cert-v01@openssh.com,ssh-ed25519-cert-v01@openssh.com,rsa-sha2-512-cert-v01@openssh.com,rsa-sha2-256-cert-v01@openssh.com,sk-ssh-ed25519@openssh.com,ssh-ed25519,rsa-sha2-512,rsa-sha2-256\n\n" >> ~/.ssh/config')
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def ubuntu_2204_mint_21_client() -> None:
|
||||||
|
print("\033[1mRun the following in a terminal to harden the SSH client for the local user:\033[0m")
|
||||||
|
print(" ")
|
||||||
|
print(r'mkdir -p -m 0700 ~/.ssh; echo -e "\nHost *\n Ciphers chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes256-ctr,aes192-ctr,aes128-gcm@openssh.com,aes128-ctr\n\n KexAlgorithms sntrup761x25519-sha512@openssh.com,gss-curve25519-sha256-,curve25519-sha256,curve25519-sha256@libssh.org,gss-group16-sha512-,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group-exchange-sha256\n\n MACs hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,umac-128-etm@openssh.com\n\n HostKeyAlgorithms sk-ssh-ed25519-cert-v01@openssh.com,ssh-ed25519-cert-v01@openssh.com,rsa-sha2-512-cert-v01@openssh.com,rsa-sha2-256-cert-v01@openssh.com,sk-ssh-ed25519@openssh.com,ssh-ed25519,rsa-sha2-512,rsa-sha2-256\n\n CASignatureAlgorithms sk-ssh-ed25519@openssh.com,ssh-ed25519,rsa-sha2-512,rsa-sha2-256\n\n GSSAPIKexAlgorithms gss-curve25519-sha256-,gss-group16-sha512-\n\n HostbasedAcceptedAlgorithms sk-ssh-ed25519-cert-v01@openssh.com,ssh-ed25519-cert-v01@openssh.com,sk-ssh-ed25519@openssh.com,ssh-ed25519,rsa-sha2-512-cert-v01@openssh.com,rsa-sha2-512,rsa-sha2-256-cert-v01@openssh.com,rsa-sha2-256\n\n PubkeyAcceptedAlgorithms sk-ssh-ed25519-cert-v01@openssh.com,ssh-ed25519-cert-v01@openssh.com,sk-ssh-ed25519@openssh.com,ssh-ed25519,rsa-sha2-512-cert-v01@openssh.com,rsa-sha2-512,rsa-sha2-256-cert-v01@openssh.com,rsa-sha2-256\n\n" >> ~/.ssh/config')
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def ubuntu_2004_mint_20_client() -> None:
|
||||||
|
print("\033[1mRun the following in a terminal to harden the SSH client for the local user:\033[0m")
|
||||||
|
print(" ")
|
||||||
|
print(r'mkdir -p -m 0700 ~/.ssh; echo -e "\nHost *\n Ciphers chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes128-gcm@openssh.com,aes256-ctr,aes192-ctr,aes128-ctr\n KexAlgorithms curve25519-sha256,curve25519-sha256@libssh.org,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group-exchange-sha256\n MACs hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,umac-128-etm@openssh.com\n HostKeyAlgorithms ssh-ed25519,ssh-ed25519-cert-v01@openssh.com,sk-ssh-ed25519@openssh.com,sk-ssh-ed25519-cert-v01@openssh.com,rsa-sha2-256,rsa-sha2-256-cert-v01@openssh.com,rsa-sha2-512,rsa-sha2-512-cert-v01@openssh.com\n" >> ~/.ssh/config')
|
||||||
|
|
||||||
|
|
||||||
|
# Server Configurations
|
||||||
|
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def server_modern_common() -> None:
|
||||||
|
print("\033[1mRe-generate the ED25519 and RSA keys\033[0m")
|
||||||
|
print(" ")
|
||||||
|
print("rm /etc/ssh/ssh_host_*")
|
||||||
|
print(r'ssh-keygen -t rsa -b 4096 -f /etc/ssh/ssh_host_rsa_key -N ""')
|
||||||
|
print(r'ssh-keygen -t ed25519 -f /etc/ssh/ssh_host_ed25519_key -N ""')
|
||||||
|
print(" ")
|
||||||
|
print("\033[1mRemove small Diffie-Hellman moduli\033[0m")
|
||||||
|
print(" ")
|
||||||
|
print(r"awk '$5 >= 3071' /etc/ssh/moduli > /etc/ssh/moduli.safe")
|
||||||
|
print("mv /etc/ssh/moduli.safe /etc/ssh/moduli")
|
||||||
|
print(" ")
|
||||||
|
print("\033[1mEnable the ED25519 and RSA keys\033[0m")
|
||||||
|
print(" ")
|
||||||
|
print("Enable the ED25519 and RSA HostKey directives in the /etc/ssh/sshd_config file:")
|
||||||
|
print(" ")
|
||||||
|
print(r'echo -e "\nHostKey /etc/ssh/ssh_host_ed25519_key\nHostKey /etc/ssh/ssh_host_rsa_key" >> /etc/ssh/sshd_config')
|
||||||
|
print(" ")
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def server_legacy_common() -> None:
|
||||||
|
print("\033[1mRe-generate the ED25519 and RSA keys\033[0m")
|
||||||
|
print(" ")
|
||||||
|
print(r"rm /etc/ssh/ssh_host_*")
|
||||||
|
print(r'ssh-keygen -t rsa -b 4096 -f /etc/ssh/ssh_host_rsa_key -N ""')
|
||||||
|
print(r'ssh-keygen -t ed25519 -f /etc/ssh/ssh_host_ed25519_key -N ""')
|
||||||
|
print(" ")
|
||||||
|
print("\033[1mRemove small Diffie-Hellman moduli\033[0m")
|
||||||
|
print(" ")
|
||||||
|
print(r"awk '$5 >= 3071' /etc/ssh/moduli > /etc/ssh/moduli.safe")
|
||||||
|
print("mv /etc/ssh/moduli.safe /etc/ssh/moduli")
|
||||||
|
print(" ")
|
||||||
|
print("\033[1mDisable the DSA and ECDSA host keys\033[0m")
|
||||||
|
print(" ")
|
||||||
|
print("Comment out the DSA and ECDSA HostKey directives in the /etc/ssh/sshd_config file:")
|
||||||
|
print(" ")
|
||||||
|
print(r"sed -i 's/^HostKey \/etc\/ssh\/ssh_host_\(dsa\|ecdsa\)_key$/\#HostKey \/etc\/ssh\/ssh_host_\1_key/g' /etc/ssh/sshd_config")
|
||||||
|
print(" ")
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def debian_ubuntu_rate_throttling() -> None:
|
||||||
|
print("\033[1mImplement connection rate throttling\033[0m")
|
||||||
|
print(" ")
|
||||||
|
print("iptables -I INPUT -p tcp --dport 22 -m state --state NEW -m recent --set")
|
||||||
|
print("iptables -I INPUT -p tcp --dport 22 -m state --state NEW -m recent --update --seconds 10 --hitcount 10 -j DROP")
|
||||||
|
print("ip6tables -I INPUT -p tcp --dport 22 -m state --state NEW -m recent --set")
|
||||||
|
print("ip6tables -I INPUT -p tcp --dport 22 -m state --state NEW -m recent --update --seconds 10 --hitcount 10 -j DROP")
|
||||||
|
print(" ")
|
||||||
|
print("\033[1mEnable persistence of the iptables rules across server reboots: \033[0m")
|
||||||
|
print(" ")
|
||||||
|
print("DEBIAN_FRONTEND=noninteractive apt install -q -y netfilter-persistent iptables-persistent service netfilter-persistent save")
|
||||||
|
print(" ")
|
||||||
|
print("\033[1mRestart OpenSSH server\033[0m")
|
||||||
|
print(" ")
|
||||||
|
print("service ssh restart")
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def ubuntu_server_2404() -> None:
|
||||||
|
print("\033[1mRestrict supported key exchange, cipher, and MAC algorithms\033[0m")
|
||||||
|
print(" ")
|
||||||
|
print(r'echo -e "# Restrict key exchange, cipher, and MAC algorithms, as per sshaudit.com\n# hardening guide.\nKexAlgorithms sntrup761x25519-sha512@openssh.com,gss-curve25519-sha256-,curve25519-sha256,curve25519-sha256@libssh.org,diffie-hellman-group18-sha512,diffie-hellman-group-exchange-sha256,gss-group16-sha512-,diffie-hellman-group16-sha512\n\nCiphers chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes256-ctr,aes192-ctr,aes128-gcm@openssh.com,aes128-ctr\n\nMACs hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com,umac-128-etm@openssh.com\n\nRequiredRSASize 3072\n\nHostKeyAlgorithms sk-ssh-ed25519-cert-v01@openssh.com,ssh-ed25519-cert-v01@openssh.com,rsa-sha2-512-cert-v01@openssh.com,rsa-sha2-256-cert-v01@openssh.com,sk-ssh-ed25519@openssh.com,ssh-ed25519,rsa-sha2-512,rsa-sha2-256\n\nCASignatureAlgorithms sk-ssh-ed25519@openssh.com,ssh-ed25519,rsa-sha2-512,rsa-sha2-256\n\nGSSAPIKexAlgorithms gss-curve25519-sha256-,gss-group16-sha512-\n\nHostbasedAcceptedAlgorithms sk-ssh-ed25519-cert-v01@openssh.com,ssh-ed25519-cert-v01@openssh.com,rsa-sha2-512-cert-v01@openssh.com,rsa-sha2-256-cert-v01@openssh.com,sk-ssh-ed25519@openssh.com,ssh-ed25519,rsa-sha2-512,rsa-sha2-256\n\nPubkeyAcceptedAlgorithms sk-ssh-ed25519-cert-v01@openssh.com,ssh-ed25519-cert-v01@openssh.com,rsa-sha2-512-cert-v01@openssh.com,rsa-sha2-256-cert-v01@openssh.com,sk-ssh-ed25519@openssh.com,ssh-ed25519,rsa-sha2-512,rsa-sha2-256" > /etc/ssh/sshd_config.d/ssh-audit_hardening.conf')
|
||||||
|
print(" ")
|
||||||
|
print("\033[1mRestart OpenSSH server\033[0m")
|
||||||
|
print(" ")
|
||||||
|
print("service ssh restart")
|
||||||
|
print(" ")
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def ubuntu_server_2204() -> None:
|
||||||
|
print("\033[1mRestrict supported key exchange, cipher, and MAC algorithms\033[0m")
|
||||||
|
print(" ")
|
||||||
|
print(r'echo -e "# Restrict key exchange, cipher, and MAC algorithms, as per sshaudit.com\n# hardening guide.\nKexAlgorithms sntrup761x25519-sha512@openssh.com,curve25519-sha256,curve25519-sha256@libssh.org,gss-curve25519-sha256-,diffie-hellman-group16-sha512,gss-group16-sha512-,diffie-hellman-group18-sha512,diffie-hellman-group-exchange-sha256\n\nCiphers chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes256-ctr,aes192-ctr,aes128-gcm@openssh.com,aes128-ctr\n\nMACs hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,umac-128-etm@openssh.com\n\nHostKeyAlgorithms sk-ssh-ed25519-cert-v01@openssh.com,ssh-ed25519-cert-v01@openssh.com,rsa-sha2-512-cert-v01@openssh.com,rsa-sha2-256-cert-v01@openssh.com,sk-ssh-ed25519@openssh.com,ssh-ed25519,rsa-sha2-512,rsa-sha2-256\n\nCASignatureAlgorithms sk-ssh-ed25519@openssh.com,ssh-ed25519,rsa-sha2-512,rsa-sha2-256\n\nGSSAPIKexAlgorithms gss-curve25519-sha256-,gss-group16-sha512-\n\nHostbasedAcceptedAlgorithms sk-ssh-ed25519-cert-v01@openssh.com,ssh-ed25519-cert-v01@openssh.com,sk-ssh-ed25519@openssh.com,ssh-ed25519,rsa-sha2-512-cert-v01@openssh.com,rsa-sha2-512,rsa-sha2-256-cert-v01@openssh.com,rsa-sha2-256\n\nPubkeyAcceptedAlgorithms sk-ssh-ed25519-cert-v01@openssh.com,ssh-ed25519-cert-v01@openssh.com,sk-ssh-ed25519@openssh.com,ssh-ed25519,rsa-sha2-512-cert-v01@openssh.com,rsa-sha2-512,rsa-sha2-256-cert-v01@openssh.com,rsa-sha2-256" > /etc/ssh/sshd_config.d/ssh-audit_hardening.conf')
|
||||||
|
print(" ")
|
||||||
|
print("\033[1mRestart OpenSSH server\033[0m")
|
||||||
|
print(" ")
|
||||||
|
print("service ssh restart")
|
||||||
|
print(" ")
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def ubuntu_server_2004() -> None:
|
||||||
|
print("\033[1mRestrict supported key exchange, cipher, and MAC algorithms\033[0m")
|
||||||
|
print(" ")
|
||||||
|
print(r'echo -e "# Restrict key exchange, cipher, and MAC algorithms, as per sshaudit.com\n# hardening guide.\nKexAlgorithms sntrup761x25519-sha512@openssh.com,gss-curve25519-sha256-,curve25519-sha256,curve25519-sha256@libssh.org,diffie-hellman-group18-sha512,diffie-hellman-group-exchange-sha256,gss-group16-sha512-,diffie-hellman-group16-sha512\n\nCiphers chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes256-ctr,aes192-ctr,aes128-gcm@openssh.com,aes128-ctr\n\nMACs hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com,umac-128-etm@openssh.com\n\nRequiredRSASize 3072\n\nHostKeyAlgorithms sk-ssh-ed25519-cert-v01@openssh.com,ssh-ed25519-cert-v01@openssh.com,rsa-sha2-512-cert-v01@openssh.com,rsa-sha2-256-cert-v01@openssh.com,sk-ssh-ed25519@openssh.com,ssh-ed25519,rsa-sha2-512,rsa-sha2-256\n\nCASignatureAlgorithms sk-ssh-ed25519@openssh.com,ssh-ed25519,rsa-sha2-512,rsa-sha2-256\n\nGSSAPIKexAlgorithms gss-curve25519-sha256-,gss-group16-sha512-\n\nHostbasedAcceptedAlgorithms sk-ssh-ed25519-cert-v01@openssh.com,ssh-ed25519-cert-v01@openssh.com,rsa-sha2-512-cert-v01@openssh.com,rsa-sha2-256-cert-v01@openssh.com,sk-ssh-ed25519@openssh.com,ssh-ed25519,rsa-sha2-512,rsa-sha2-256\n\nPubkeyAcceptedAlgorithms sk-ssh-ed25519-cert-v01@openssh.com,ssh-ed25519-cert-v01@openssh.com,rsa-sha2-512-cert-v01@openssh.com,rsa-sha2-256-cert-v01@openssh.com,sk-ssh-ed25519@openssh.com,ssh-ed25519,rsa-sha2-512,rsa-sha2-256" > /etc/ssh/sshd_config.d/ssh-audit_hardening.conf')
|
||||||
|
print(" ")
|
||||||
|
print("\033[1mRestart OpenSSH server\033[0m")
|
||||||
|
print(" ")
|
||||||
|
print("service ssh restart")
|
||||||
|
print(" ")
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def ubuntu_server_1804() -> None:
|
||||||
|
print("\033[1mRestrict supported key exchange, cipher, and MAC algorithms\033[0m")
|
||||||
|
print(" ")
|
||||||
|
print(r'echo -e "# Restrict key exchange, cipher, and MAC algorithms, as per sshaudit.com\n# hardening guide.\nKexAlgorithms curve25519-sha256,curve25519-sha256@libssh.org,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group-exchange-sha256\nCiphers chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes128-gcm@openssh.com,aes256-ctr,aes192-ctr,aes128-ctr\nMACs hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,umac-128-etm@openssh.com\nHostKeyAlgorithms ssh-ed25519,ssh-ed25519-cert-v01@openssh.com" >> /etc/ssh/sshd_config')
|
||||||
|
print(" ")
|
||||||
|
print("\033[1mRestart OpenSSH server\033[0m")
|
||||||
|
print(" ")
|
||||||
|
print("service ssh restart")
|
||||||
|
print(" ")
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def bookworm_server() -> None:
|
||||||
|
print("\033[1mRestrict supported key exchange, cipher, and MAC algorithms\033[0m")
|
||||||
|
print(" ")
|
||||||
|
print(r'echo -e "# Restrict key exchange, cipher, and MAC algorithms, as per sshaudit.com\n# hardening guide.\nKexAlgorithms sntrup761x25519-sha512@openssh.com,gss-curve25519-sha256-,curve25519-sha256,curve25519-sha256@libssh.org,diffie-hellman-group18-sha512,diffie-hellman-group-exchange-sha256,gss-group16-sha512-,diffie-hellman-group16-sha512\n\nCiphers chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes256-ctr,aes192-ctr,aes128-gcm@openssh.com,aes128-ctr\n\nMACs hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com,umac-128-etm@openssh.com\n\nRequiredRSASize 3072\n\nHostKeyAlgorithms sk-ssh-ed25519-cert-v01@openssh.com,ssh-ed25519-cert-v01@openssh.com,rsa-sha2-512-cert-v01@openssh.com,rsa-sha2-256-cert-v01@openssh.com,sk-ssh-ed25519@openssh.com,ssh-ed25519,rsa-sha2-512,rsa-sha2-256\n\nCASignatureAlgorithms sk-ssh-ed25519@openssh.com,ssh-ed25519,rsa-sha2-512,rsa-sha2-256\n\nGSSAPIKexAlgorithms gss-curve25519-sha256-,gss-group16-sha512-\n\nHostbasedAcceptedAlgorithms sk-ssh-ed25519-cert-v01@openssh.com,ssh-ed25519-cert-v01@openssh.com,rsa-sha2-512-cert-v01@openssh.com,rsa-sha2-256-cert-v01@openssh.com,sk-ssh-ed25519@openssh.com,ssh-ed25519,rsa-sha2-512,rsa-sha2-256\n\nPubkeyAcceptedAlgorithms sk-ssh-ed25519-cert-v01@openssh.com,ssh-ed25519-cert-v01@openssh.com,rsa-sha2-512-cert-v01@openssh.com,rsa-sha2-256-cert-v01@openssh.com,sk-ssh-ed25519@openssh.com,ssh-ed25519,rsa-sha2-512,rsa-sha2-256" > /etc/ssh/sshd_config.d/ssh-audit_hardening.conf')
|
||||||
|
print(" ")
|
||||||
|
print("\033[1mRestart OpenSSH server\033[0m")
|
||||||
|
print(" ")
|
||||||
|
print("service ssh restart")
|
||||||
|
print(" ")
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def bullseye_server() -> None:
|
||||||
|
print("\033[1mRestrict supported key exchange, cipher, and MAC algorithms\033[0m")
|
||||||
|
print(" ")
|
||||||
|
print(r'echo -e "# Restrict key exchange, cipher, and MAC algorithms, as per sshaudit.com\n# hardening guide.\nKexAlgorithms sntrup761x25519-sha512@openssh.com,curve25519-sha256,curve25519-sha256@libssh.org,gss-curve25519-sha256-,diffie-hellman-group16-sha512,gss-group16-sha512-,diffie-hellman-group18-sha512,diffie-hellman-group-exchange-sha256\n\nCiphers chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes256-ctr,aes192-ctr,aes128-gcm@openssh.com,aes128-ctr\n\nMACs hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,umac-128-etm@openssh.com\n\nHostKeyAlgorithms sk-ssh-ed25519-cert-v01@openssh.com,ssh-ed25519-cert-v01@openssh.com,rsa-sha2-512-cert-v01@openssh.com,rsa-sha2-256-cert-v01@openssh.com,sk-ssh-ed25519@openssh.com,ssh-ed25519,rsa-sha2-512,rsa-sha2-256\n\nCASignatureAlgorithms sk-ssh-ed25519@openssh.com,ssh-ed25519,rsa-sha2-512,rsa-sha2-256\n\nGSSAPIKexAlgorithms gss-curve25519-sha256-,gss-group16-sha512-\n\nHostbasedAcceptedAlgorithms sk-ssh-ed25519-cert-v01@openssh.com,ssh-ed25519-cert-v01@openssh.com,sk-ssh-ed25519@openssh.com,ssh-ed25519,rsa-sha2-512-cert-v01@openssh.com,rsa-sha2-512,rsa-sha2-256-cert-v01@openssh.com,rsa-sha2-256\n\nPubkeyAcceptedAlgorithms sk-ssh-ed25519-cert-v01@openssh.com,ssh-ed25519-cert-v01@openssh.com,sk-ssh-ed25519@openssh.com,ssh-ed25519,rsa-sha2-512-cert-v01@openssh.com,rsa-sha2-512,rsa-sha2-256-cert-v01@openssh.com,rsa-sha2-256" > /etc/ssh/sshd_config.d/ssh-audit_hardening.conf')
|
||||||
|
print(" ")
|
||||||
|
print("\033[1mRestart OpenSSH server\033[0m")
|
||||||
|
print(" ")
|
||||||
|
print("service ssh restart")
|
||||||
|
print(" ")
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def rocky_9_server() -> None:
|
||||||
|
print("\033[1mRestrict supported key exchange, cipher, and MAC algorithms\033[0m")
|
||||||
|
print(" ")
|
||||||
|
print(r'echo -e "# Restrict key exchange, cipher, and MAC algorithms, as per sshaudit.com\n# hardening guide.\nKexAlgorithms sntrup761x25519-sha512@openssh.com,curve25519-sha256,curve25519-sha256@libssh.org,gss-curve25519-sha256-,diffie-hellman-group16-sha512,gss-group16-sha512-,diffie-hellman-group18-sha512,diffie-hellman-group-exchange-sha256\n\nCiphers chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes256-ctr,aes192-ctr,aes128-gcm@openssh.com,aes128-ctr\n\nMACs hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,umac-128-etm@openssh.com\n\nHostKeyAlgorithms sk-ssh-ed25519-cert-v01@openssh.com,ssh-ed25519-cert-v01@openssh.com,rsa-sha2-512-cert-v01@openssh.com,rsa-sha2-256-cert-v01@openssh.com,sk-ssh-ed25519@openssh.com,ssh-ed25519,rsa-sha2-512,rsa-sha2-256\n\nRequiredRSASize 3072\n\nCASignatureAlgorithms sk-ssh-ed25519@openssh.com,ssh-ed25519,rsa-sha2-512,rsa-sha2-256\n\nGSSAPIKexAlgorithms gss-curve25519-sha256-,gss-group16-sha512-\n\nHostbasedAcceptedAlgorithms sk-ssh-ed25519-cert-v01@openssh.com,ssh-ed25519-cert-v01@openssh.com,sk-ssh-ed25519@openssh.com,ssh-ed25519,rsa-sha2-512-cert-v01@openssh.com,rsa-sha2-512,rsa-sha2-256-cert-v01@openssh.com,rsa-sha2-256\n\nPubkeyAcceptedAlgorithms sk-ssh-ed25519-cert-v01@openssh.com,ssh-ed25519-cert-v01@openssh.com,rsa-sha2-512-cert-v01@openssh.com,rsa-sha2-256-cert-v01@openssh.com,sk-ssh-ed25519@openssh.com,ssh-ed25519,rsa-sha2-512,rsa-sha2-256\n\n" > /etc/crypto-policies/back-ends/opensshserver.config')
|
||||||
|
print(" ")
|
||||||
|
print("\033[1mRestart OpenSSH server\033[0m")
|
||||||
|
print(" ")
|
||||||
|
print("systemctl restart sshd")
|
||||||
|
print(" ")
|
||||||
|
print("\033[1mImplement connection rate throttling\033[0m")
|
||||||
|
print(" ")
|
||||||
|
print("firewall-cmd --permanent --direct --add-rule ipv4 filter INPUT 0 -p tcp --dport 22 -m state --state NEW -m recent --set")
|
||||||
|
print("firewall-cmd --permanent --direct --add-rule ipv4 filter INPUT 1 -p tcp --dport 22 -m state --state NEW -m recent --update --seconds 10 --hitcount 10 -j DROP")
|
||||||
|
print("firewall-cmd --permanent --direct --add-rule ipv6 filter INPUT 0 -p tcp --dport 22 -m state --state NEW -m recent --set")
|
||||||
|
print("firewall-cmd --permanent --direct --add-rule ipv6 filter INPUT 1 -p tcp --dport 22 -m state --state NEW -m recent --update --seconds 10 --hitcount 10 -j DROP")
|
||||||
|
print(" ")
|
||||||
|
print("\033[1mReload firewalld to enable new rules:\033[0m")
|
||||||
|
print(" ")
|
||||||
|
print("systemctl reload firewalld")
|
||||||
|
print(" ")
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def amazon_server_2023() -> None:
|
||||||
|
print("\033[1mRestrict supported key exchange, cipher, and MAC algorithms\033[0m")
|
||||||
|
print(" ")
|
||||||
|
print(r'echo -e "# Restrict key exchange, cipher, and MAC algorithms, as per sshaudit.com\n# hardening guide.\nKexAlgorithms sntrup761x25519-sha512@openssh.com,curve25519-sha256,curve25519-sha256@libssh.org,gss-curve25519-sha256-,diffie-hellman-group16-sha512,gss-group16-sha512-,diffie-hellman-group18-sha512,diffie-hellman-group-exchange-sha256\n\nCiphers chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes256-ctr,aes192-ctr,aes128-gcm@openssh.com,aes128-ctr\n\nMACs hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,umac-128-etm@openssh.com\n\nHostKeyAlgorithms sk-ssh-ed25519-cert-v01@openssh.com,ssh-ed25519-cert-v01@openssh.com,rsa-sha2-512-cert-v01@openssh.com,rsa-sha2-256-cert-v01@openssh.com,sk-ssh-ed25519@openssh.com,ssh-ed25519,rsa-sha2-512,rsa-sha2-256\n\nCASignatureAlgorithms sk-ssh-ed25519@openssh.com,ssh-ed25519,rsa-sha2-512,rsa-sha2-256\n\nGSSAPIKexAlgorithms gss-curve25519-sha256-,gss-group16-sha512-\n\nHostbasedAcceptedAlgorithms sk-ssh-ed25519-cert-v01@openssh.com,ssh-ed25519-cert-v01@openssh.com,sk-ssh-ed25519@openssh.com,ssh-ed25519,rsa-sha2-512-cert-v01@openssh.com,rsa-sha2-512,rsa-sha2-256-cert-v01@openssh.com,rsa-sha2-256\n\nPubkeyAcceptedAlgorithms sk-ssh-ed25519-cert-v01@openssh.com,ssh-ed25519-cert-v01@openssh.com,rsa-sha2-512-cert-v01@openssh.com,rsa-sha2-256-cert-v01@openssh.com,sk-ssh-ed25519@openssh.com,ssh-ed25519,rsa-sha2-512,rsa-sha2-256\n\n" > /etc/crypto-policies/back-ends/opensshserver.config')
|
||||||
|
print(" ")
|
||||||
|
print("\033[1mRestart OpenSSH server\033[0m")
|
||||||
|
print(" ")
|
||||||
|
print("systemctl restart sshd")
|
||||||
|
print(" ")
|
||||||
|
print("\033[1mImplement connection rate throttling\033[0m")
|
||||||
|
print(" ")
|
||||||
|
print("dnf install -y iptables")
|
||||||
|
print("iptables -I INPUT -p tcp --dport 22 -m state --state NEW -m recent --set")
|
||||||
|
print("iptables -I INPUT -p tcp --dport 22 -m state --state NEW -m recent --update --seconds 10 --hitcount 10 -j DROP")
|
||||||
|
print("ip6tables -I INPUT -p tcp --dport 22 -m state --state NEW -m recent --set")
|
||||||
|
print("ip6tables -I INPUT -p tcp --dport 22 -m state --state NEW -m recent --update --seconds 10 --hitcount 10 -j DROP")
|
||||||
|
print(" ")
|
||||||
|
print("\033[1mEnable persistence of the iptables rules across server reboots:\033[0m")
|
||||||
|
print(" ")
|
||||||
|
print("dnf install -y iptables-services")
|
||||||
|
print("iptables-save > /etc/sysconfig/iptables")
|
||||||
|
print("ip6tables-save > /etc/sysconfig/ip6tables")
|
||||||
|
print("systemctl enable iptables")
|
||||||
|
print("systemctl enable ip6tables")
|
||||||
|
print("systemctl start iptables")
|
||||||
|
print("systemctl start ip6tables")
|
||||||
|
print(" ")
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def print_ver_changelog(policy_name: str) -> None:
|
||||||
|
'''Prints ssh-audit version and change log for a supported configuration'''
|
||||||
|
|
||||||
|
for key_name, policy in BUILTIN_GUIDES.items():
|
||||||
|
if policy_name in key_name:
|
||||||
|
|
||||||
|
policy_struct = policy
|
||||||
|
policy_name_without_version = policy_name.split('(')[0]
|
||||||
|
name = policy_name_without_version # pylint: disable=protected-access
|
||||||
|
changelog_struct = policy_struct['changelog'] # pylint: disable=protected-access
|
||||||
|
print(" ")
|
||||||
|
print(f"\033[1mssh-audit Version : {VERSION}\033[0m")
|
||||||
|
print(" ")
|
||||||
|
print(f"\033[1mLocating configuration for {name}\033[0m")
|
||||||
|
print(" ")
|
||||||
|
print("\033[1mChange Log :\033[0m")
|
||||||
|
for date, change in changelog_struct.items():
|
||||||
|
print(f"\033[1m{date} : {change}\033[0m")
|
||||||
|
print(" ")
|
||||||
@@ -54,11 +54,11 @@ class OutputBuffer:
|
|||||||
self.__is_color_supported = ('colorama' in sys.modules) or (os.name == 'posix')
|
self.__is_color_supported = ('colorama' in sys.modules) or (os.name == 'posix')
|
||||||
self.line_ended = True
|
self.line_ended = True
|
||||||
|
|
||||||
def _print(self, level: str, s: str = '', line_ended: bool = True) -> None:
|
def _print(self, level: str, s: str = '', line_ended: bool = True, always_print: bool = False) -> None:
|
||||||
'''Saves output to buffer (if in buffered mode), or immediately prints to stdout otherwise.'''
|
'''Saves output to buffer (if in buffered mode), or immediately prints to stdout otherwise.'''
|
||||||
|
|
||||||
# If we're logging only 'warn' or above, and this is an 'info', ignore message.
|
# If we're logging only 'warn' or above, and this is an 'info', ignore message, unless always_print is True (useful for printing informational lines regardless of the level setting).
|
||||||
if self.get_level(level) < self.__level:
|
if (always_print is False) and (self.get_level(level) < self.__level):
|
||||||
return
|
return
|
||||||
|
|
||||||
if self.use_colors and self.colors_supported and len(s) > 0 and level != 'info':
|
if self.use_colors and self.colors_supported and len(s) > 0 and level != 'info':
|
||||||
@@ -145,20 +145,22 @@ class OutputBuffer:
|
|||||||
self._print('head', s, line_ended)
|
self._print('head', s, line_ended)
|
||||||
return self
|
return self
|
||||||
|
|
||||||
def fail(self, s: str, line_ended: bool = True) -> 'OutputBuffer':
|
def fail(self, s: str, line_ended: bool = True, write_now: bool = False, always_print: bool = False) -> 'OutputBuffer':
|
||||||
self._print('fail', s, line_ended)
|
self._print('fail', s, line_ended, always_print=always_print)
|
||||||
|
if write_now:
|
||||||
|
self.write()
|
||||||
return self
|
return self
|
||||||
|
|
||||||
def warn(self, s: str, line_ended: bool = True) -> 'OutputBuffer':
|
def warn(self, s: str, line_ended: bool = True, always_print: bool = False) -> 'OutputBuffer':
|
||||||
self._print('warn', s, line_ended)
|
self._print('warn', s, line_ended, always_print=always_print)
|
||||||
return self
|
return self
|
||||||
|
|
||||||
def info(self, s: str, line_ended: bool = True) -> 'OutputBuffer':
|
def info(self, s: str, line_ended: bool = True, always_print: bool = False) -> 'OutputBuffer':
|
||||||
self._print('info', s, line_ended)
|
self._print('info', s, line_ended, always_print=always_print)
|
||||||
return self
|
return self
|
||||||
|
|
||||||
def good(self, s: str, line_ended: bool = True) -> 'OutputBuffer':
|
def good(self, s: str, line_ended: bool = True, always_print: bool = False) -> 'OutputBuffer':
|
||||||
self._print('good', s, line_ended)
|
self._print('good', s, line_ended, always_print=always_print)
|
||||||
return self
|
return self
|
||||||
|
|
||||||
def sep(self) -> 'OutputBuffer':
|
def sep(self) -> 'OutputBuffer':
|
||||||
|
|||||||
+100
-99
@@ -57,6 +57,7 @@ class SSH2_KexDB: # pylint: disable=too-few-public-methods
|
|||||||
WARN_CIPHER_MODE = 'using weak cipher mode'
|
WARN_CIPHER_MODE = 'using weak cipher mode'
|
||||||
WARN_ENCRYPT_AND_MAC = 'using encrypt-and-MAC mode'
|
WARN_ENCRYPT_AND_MAC = 'using encrypt-and-MAC mode'
|
||||||
WARN_EXPERIMENTAL = 'using experimental algorithm'
|
WARN_EXPERIMENTAL = 'using experimental algorithm'
|
||||||
|
WARN_NOT_PQ_SAFE = 'does not provide protection against post-quantum attacks'
|
||||||
WARN_RNDSIG_KEY = 'using weak random number generator could reveal the key'
|
WARN_RNDSIG_KEY = 'using weak random number generator could reveal the key'
|
||||||
WARN_TAG_SIZE = 'using small 64-bit tag size'
|
WARN_TAG_SIZE = 'using small 64-bit tag size'
|
||||||
WARN_TAG_SIZE_96 = 'using small 96-bit tag size'
|
WARN_TAG_SIZE_96 = 'using small 96-bit tag size'
|
||||||
@@ -84,117 +85,117 @@ class SSH2_KexDB: # pylint: disable=too-few-public-methods
|
|||||||
MASTER_DB: Dict[str, Dict[str, List[List[Optional[str]]]]] = {
|
MASTER_DB: Dict[str, Dict[str, List[List[Optional[str]]]]] = {
|
||||||
# Format: 'algorithm_name': [['version_first_appeared_in'], [reason_for_failure1, reason_for_failure2, ...], [warning1, warning2, ...], [info1, info2, ...]]
|
# Format: 'algorithm_name': [['version_first_appeared_in'], [reason_for_failure1, reason_for_failure2, ...], [warning1, warning2, ...], [info1, info2, ...]]
|
||||||
'kex': {
|
'kex': {
|
||||||
'Curve25519SHA256': [[]],
|
'Curve25519SHA256': [[], [], [WARN_NOT_PQ_SAFE]],
|
||||||
'curve25519-sha256': [['7.4,d2018.76'], [], [], [INFO_DEFAULT_OPENSSH_KEX_74_TO_89]],
|
'curve25519-sha256': [['7.4,d2018.76'], [], [WARN_NOT_PQ_SAFE], [INFO_DEFAULT_OPENSSH_KEX_74_TO_89]],
|
||||||
'curve25519-sha256@libssh.org': [['6.4,d2013.62,l10.6.0'], [], [], [INFO_DEFAULT_OPENSSH_KEX_65_TO_73]],
|
'curve25519-sha256@libssh.org': [['6.4,d2013.62,l10.6.0'], [], [WARN_NOT_PQ_SAFE], [INFO_DEFAULT_OPENSSH_KEX_65_TO_73]],
|
||||||
'curve448-sha512': [[]],
|
'curve448-sha512': [[], [], [WARN_NOT_PQ_SAFE]],
|
||||||
'curve448-sha512@libssh.org': [[]],
|
'curve448-sha512@libssh.org': [[], [], [WARN_NOT_PQ_SAFE]],
|
||||||
'diffie-hellman-group14-sha1': [['3.9,d0.53,l10.6.0'], [FAIL_SHA1], [WARN_2048BIT_MODULUS]],
|
'diffie-hellman-group14-sha1': [['3.9,d0.53,l10.6.0'], [FAIL_SHA1], [WARN_2048BIT_MODULUS, WARN_NOT_PQ_SAFE]],
|
||||||
'diffie-hellman-group14-sha224@ssh.com': [[]],
|
'diffie-hellman-group14-sha224@ssh.com': [[], [], [WARN_2048BIT_MODULUS, WARN_NOT_PQ_SAFE]],
|
||||||
'diffie-hellman-group14-sha256': [['7.3,d2016.73'], [], [WARN_2048BIT_MODULUS]],
|
'diffie-hellman-group14-sha256': [['7.3,d2016.73'], [], [WARN_2048BIT_MODULUS, WARN_NOT_PQ_SAFE]],
|
||||||
'diffie-hellman-group14-sha256@ssh.com': [[], [], [WARN_2048BIT_MODULUS]],
|
'diffie-hellman-group14-sha256@ssh.com': [[], [], [WARN_2048BIT_MODULUS, WARN_NOT_PQ_SAFE]],
|
||||||
'diffie-hellman-group15-sha256': [[]],
|
'diffie-hellman-group15-sha256': [[], [], [WARN_NOT_PQ_SAFE]],
|
||||||
'diffie-hellman-group15-sha256@ssh.com': [[]],
|
'diffie-hellman-group15-sha256@ssh.com': [[], [], [WARN_NOT_PQ_SAFE]],
|
||||||
'diffie-hellman-group15-sha384@ssh.com': [[]],
|
'diffie-hellman-group15-sha384@ssh.com': [[], [], [WARN_NOT_PQ_SAFE]],
|
||||||
'diffie-hellman-group15-sha512': [[]],
|
'diffie-hellman-group15-sha512': [[], [], [WARN_NOT_PQ_SAFE]],
|
||||||
'diffie-hellman-group16-sha256': [[]],
|
'diffie-hellman-group16-sha256': [[], [], [WARN_NOT_PQ_SAFE]],
|
||||||
'diffie-hellman-group16-sha384@ssh.com': [[]],
|
'diffie-hellman-group16-sha384@ssh.com': [[], [], [WARN_NOT_PQ_SAFE]],
|
||||||
'diffie-hellman-group16-sha512': [['7.3,d2016.73']],
|
'diffie-hellman-group16-sha512': [['7.3,d2016.73'], [], [WARN_NOT_PQ_SAFE]],
|
||||||
'diffie-hellman-group16-sha512@ssh.com': [[]],
|
'diffie-hellman-group16-sha512@ssh.com': [[], [], [WARN_NOT_PQ_SAFE]],
|
||||||
'diffie-hellman-group17-sha512': [[]],
|
'diffie-hellman-group17-sha512': [[], [], [WARN_NOT_PQ_SAFE]],
|
||||||
'diffie-hellman_group17-sha512': [[]],
|
'diffie-hellman_group17-sha512': [[], [], [WARN_NOT_PQ_SAFE]],
|
||||||
'diffie-hellman-group18-sha512': [['7.3']],
|
'diffie-hellman-group18-sha512': [['7.3'], [], [WARN_NOT_PQ_SAFE]],
|
||||||
'diffie-hellman-group18-sha512@ssh.com': [[]],
|
'diffie-hellman-group18-sha512@ssh.com': [[], [], [WARN_NOT_PQ_SAFE]],
|
||||||
'diffie-hellman-group1-sha1': [['2.3.0,d0.28,l10.2', '6.6', '6.9'], [FAIL_1024BIT_MODULUS, FAIL_LOGJAM_ATTACK, FAIL_SHA1], [], [INFO_REMOVED_IN_OPENSSH69]],
|
'diffie-hellman-group1-sha1': [['2.3.0,d0.28,l10.2', '6.6', '6.9'], [FAIL_1024BIT_MODULUS, FAIL_LOGJAM_ATTACK, FAIL_SHA1], [WARN_NOT_PQ_SAFE], [INFO_REMOVED_IN_OPENSSH69]],
|
||||||
'diffie-hellman-group1-sha256': [[], [FAIL_1024BIT_MODULUS]],
|
'diffie-hellman-group1-sha256': [[], [FAIL_1024BIT_MODULUS], [WARN_NOT_PQ_SAFE]],
|
||||||
'diffie-hellman-group-exchange-sha1': [['2.3.0', '6.6', None], [FAIL_SHA1]],
|
'diffie-hellman-group-exchange-sha1': [['2.3.0', '6.6', None], [FAIL_SHA1], [WARN_NOT_PQ_SAFE]],
|
||||||
'diffie-hellman-group-exchange-sha224@ssh.com': [[]],
|
'diffie-hellman-group-exchange-sha224@ssh.com': [[], [], [WARN_NOT_PQ_SAFE]],
|
||||||
'diffie-hellman-group-exchange-sha256': [['4.4']],
|
'diffie-hellman-group-exchange-sha256': [['4.4'], [], [WARN_NOT_PQ_SAFE]],
|
||||||
'diffie-hellman-group-exchange-sha256@ssh.com': [[]],
|
'diffie-hellman-group-exchange-sha256@ssh.com': [[], [], [WARN_NOT_PQ_SAFE]],
|
||||||
'diffie-hellman-group-exchange-sha384@ssh.com': [[]],
|
'diffie-hellman-group-exchange-sha384@ssh.com': [[], [], [WARN_NOT_PQ_SAFE]],
|
||||||
'diffie-hellman-group-exchange-sha512@ssh.com': [[]],
|
'diffie-hellman-group-exchange-sha512@ssh.com': [[], [], [WARN_NOT_PQ_SAFE]],
|
||||||
'ecdh-nistp256-kyber-512r3-sha256-d00@openquantumsafe.org': [[], [FAIL_NSA_BACKDOORED_CURVE]],
|
'ecdh-nistp256-kyber-512r3-sha256-d00@openquantumsafe.org': [[], [FAIL_NSA_BACKDOORED_CURVE]],
|
||||||
'ecdh-nistp384-kyber-768r3-sha384-d00@openquantumsafe.org': [[], [FAIL_NSA_BACKDOORED_CURVE]],
|
'ecdh-nistp384-kyber-768r3-sha384-d00@openquantumsafe.org': [[], [FAIL_NSA_BACKDOORED_CURVE]],
|
||||||
'ecdh-nistp521-kyber-1024r3-sha512-d00@openquantumsafe.org': [[], [FAIL_NSA_BACKDOORED_CURVE]],
|
'ecdh-nistp521-kyber-1024r3-sha512-d00@openquantumsafe.org': [[], [FAIL_NSA_BACKDOORED_CURVE]],
|
||||||
'ecdh-sha2-1.2.840.10045.3.1.1': [[], [FAIL_SMALL_ECC_MODULUS, FAIL_NSA_BACKDOORED_CURVE]], # NIST P-192 / secp192r1
|
'ecdh-sha2-1.2.840.10045.3.1.1': [[], [FAIL_SMALL_ECC_MODULUS, FAIL_NSA_BACKDOORED_CURVE], [WARN_NOT_PQ_SAFE]], # NIST P-192 / secp192r1
|
||||||
'ecdh-sha2-1.2.840.10045.3.1.7': [[], [FAIL_NSA_BACKDOORED_CURVE]], # NIST P-256 / secp256r1
|
'ecdh-sha2-1.2.840.10045.3.1.7': [[], [FAIL_NSA_BACKDOORED_CURVE], [WARN_NOT_PQ_SAFE]], # NIST P-256 / secp256r1
|
||||||
'ecdh-sha2-1.3.132.0.10': [[]], # ECDH over secp256k1 (i.e.: the Bitcoin curve)
|
'ecdh-sha2-1.3.132.0.10': [[], [], [WARN_NOT_PQ_SAFE]], # ECDH over secp256k1 (i.e.: the Bitcoin curve)
|
||||||
'ecdh-sha2-1.3.132.0.16': [[], [FAIL_UNPROVEN]], # sect283k1
|
'ecdh-sha2-1.3.132.0.16': [[], [FAIL_UNPROVEN], [WARN_NOT_PQ_SAFE]], # sect283k1
|
||||||
'ecdh-sha2-1.3.132.0.1': [[], [FAIL_UNPROVEN, FAIL_SMALL_ECC_MODULUS]], # sect163k1
|
'ecdh-sha2-1.3.132.0.1': [[], [FAIL_UNPROVEN, FAIL_SMALL_ECC_MODULUS], [WARN_NOT_PQ_SAFE]], # sect163k1
|
||||||
'ecdh-sha2-1.3.132.0.26': [[], [FAIL_UNPROVEN, FAIL_SMALL_ECC_MODULUS]], # sect233k1
|
'ecdh-sha2-1.3.132.0.26': [[], [FAIL_UNPROVEN, FAIL_SMALL_ECC_MODULUS], [WARN_NOT_PQ_SAFE]], # sect233k1
|
||||||
'ecdh-sha2-1.3.132.0.27': [[], [FAIL_SMALL_ECC_MODULUS, FAIL_NSA_BACKDOORED_CURVE]], # sect233r1
|
'ecdh-sha2-1.3.132.0.27': [[], [FAIL_SMALL_ECC_MODULUS, FAIL_NSA_BACKDOORED_CURVE], [WARN_NOT_PQ_SAFE]], # sect233r1
|
||||||
'ecdh-sha2-1.3.132.0.33': [[], [FAIL_SMALL_ECC_MODULUS, FAIL_NSA_BACKDOORED_CURVE]], # NIST P-224 / secp224r1
|
'ecdh-sha2-1.3.132.0.33': [[], [FAIL_SMALL_ECC_MODULUS, FAIL_NSA_BACKDOORED_CURVE], [WARN_NOT_PQ_SAFE]], # NIST P-224 / secp224r1
|
||||||
'ecdh-sha2-1.3.132.0.34': [[], [FAIL_NSA_BACKDOORED_CURVE]], # NIST P-384 / secp384r1
|
'ecdh-sha2-1.3.132.0.34': [[], [FAIL_NSA_BACKDOORED_CURVE], [WARN_NOT_PQ_SAFE]], # NIST P-384 / secp384r1
|
||||||
'ecdh-sha2-1.3.132.0.35': [[], [FAIL_NSA_BACKDOORED_CURVE]], # NIST P-521 / secp521r1
|
'ecdh-sha2-1.3.132.0.35': [[], [FAIL_NSA_BACKDOORED_CURVE], [WARN_NOT_PQ_SAFE]], # NIST P-521 / secp521r1
|
||||||
'ecdh-sha2-1.3.132.0.36': [[], [FAIL_UNPROVEN]], # sect409k1
|
'ecdh-sha2-1.3.132.0.36': [[], [FAIL_UNPROVEN], [WARN_NOT_PQ_SAFE]], # sect409k1
|
||||||
'ecdh-sha2-1.3.132.0.37': [[], [FAIL_NSA_BACKDOORED_CURVE]], # sect409r1
|
'ecdh-sha2-1.3.132.0.37': [[], [FAIL_NSA_BACKDOORED_CURVE], [WARN_NOT_PQ_SAFE]], # sect409r1
|
||||||
'ecdh-sha2-1.3.132.0.38': [[], [FAIL_UNPROVEN]], # sect571k1
|
'ecdh-sha2-1.3.132.0.38': [[], [FAIL_UNPROVEN], [WARN_NOT_PQ_SAFE]], # sect571k1
|
||||||
|
|
||||||
# Note: the base64 strings, according to draft 6 of RFC5656, is Base64(MD5(DER(OID))). The final RFC5656 dropped the base64 strings in favor of plain OID concatenation, but apparently some SSH servers implement them anyway. See: https://datatracker.ietf.org/doc/html/draft-green-secsh-ecc-06#section-9.2
|
# Note: the base64 strings, according to draft 6 of RFC5656, is Base64(MD5(DER(OID))). The final RFC5656 dropped the base64 strings in favor of plain OID concatenation, but apparently some SSH servers implement them anyway. See: https://datatracker.ietf.org/doc/html/draft-green-secsh-ecc-06#section-9.2
|
||||||
'ecdh-sha2-4MHB+NBt3AlaSRQ7MnB4cg==': [[], [FAIL_UNPROVEN, FAIL_SMALL_ECC_MODULUS]], # sect163k1
|
'ecdh-sha2-4MHB+NBt3AlaSRQ7MnB4cg==': [[], [FAIL_UNPROVEN, FAIL_SMALL_ECC_MODULUS], [WARN_NOT_PQ_SAFE]], # sect163k1
|
||||||
'ecdh-sha2-5pPrSUQtIaTjUSt5VZNBjg==': [[], [FAIL_SMALL_ECC_MODULUS, FAIL_NSA_BACKDOORED_CURVE]], # NIST P-192 / secp192r1
|
'ecdh-sha2-5pPrSUQtIaTjUSt5VZNBjg==': [[], [FAIL_SMALL_ECC_MODULUS, FAIL_NSA_BACKDOORED_CURVE], [WARN_NOT_PQ_SAFE]], # NIST P-192 / secp192r1
|
||||||
'ecdh-sha2-9UzNcgwTlEnSCECZa7V1mw==': [[], [FAIL_NSA_BACKDOORED_CURVE]], # NIST P-256 / secp256r1
|
'ecdh-sha2-9UzNcgwTlEnSCECZa7V1mw==': [[], [FAIL_NSA_BACKDOORED_CURVE], [WARN_NOT_PQ_SAFE]], # NIST P-256 / secp256r1
|
||||||
'ecdh-sha2-brainpoolp256r1@genua.de': [[], [FAIL_UNPROVEN]],
|
'ecdh-sha2-brainpoolp256r1@genua.de': [[], [FAIL_UNPROVEN], [WARN_NOT_PQ_SAFE]],
|
||||||
'ecdh-sha2-brainpoolp384r1@genua.de': [[], [FAIL_UNPROVEN]],
|
'ecdh-sha2-brainpoolp384r1@genua.de': [[], [FAIL_UNPROVEN], [WARN_NOT_PQ_SAFE]],
|
||||||
'ecdh-sha2-brainpoolp521r1@genua.de': [[], [FAIL_UNPROVEN]],
|
'ecdh-sha2-brainpoolp521r1@genua.de': [[], [FAIL_UNPROVEN], [WARN_NOT_PQ_SAFE]],
|
||||||
'ecdh-sha2-curve25519': [[], []],
|
'ecdh-sha2-curve25519': [[], [], [WARN_NOT_PQ_SAFE]],
|
||||||
'ecdh-sha2-D3FefCjYoJ/kfXgAyLddYA==': [[], [FAIL_NSA_BACKDOORED_CURVE]], # sect409r1
|
'ecdh-sha2-D3FefCjYoJ/kfXgAyLddYA==': [[], [FAIL_NSA_BACKDOORED_CURVE], [WARN_NOT_PQ_SAFE]], # sect409r1
|
||||||
'ecdh-sha2-h/SsxnLCtRBh7I9ATyeB3A==': [[], [FAIL_NSA_BACKDOORED_CURVE]], # NIST P-521 / secp521r1
|
'ecdh-sha2-h/SsxnLCtRBh7I9ATyeB3A==': [[], [FAIL_NSA_BACKDOORED_CURVE], [WARN_NOT_PQ_SAFE]], # NIST P-521 / secp521r1
|
||||||
'ecdh-sha2-m/FtSAmrV4j/Wy6RVUaK7A==': [[], [FAIL_UNPROVEN]], # sect409k1
|
'ecdh-sha2-m/FtSAmrV4j/Wy6RVUaK7A==': [[], [FAIL_UNPROVEN], [WARN_NOT_PQ_SAFE]], # sect409k1
|
||||||
'ecdh-sha2-mNVwCXAoS1HGmHpLvBC94w==': [[], [FAIL_UNPROVEN]], # sect571k1
|
'ecdh-sha2-mNVwCXAoS1HGmHpLvBC94w==': [[], [FAIL_UNPROVEN], [WARN_NOT_PQ_SAFE]], # sect571k1
|
||||||
'ecdh-sha2-nistb233': [[], [FAIL_UNPROVEN, FAIL_SMALL_ECC_MODULUS]],
|
'ecdh-sha2-nistb233': [[], [FAIL_UNPROVEN, FAIL_SMALL_ECC_MODULUS], [WARN_NOT_PQ_SAFE]],
|
||||||
'ecdh-sha2-nistb409': [[], [FAIL_UNPROVEN]],
|
'ecdh-sha2-nistb409': [[], [FAIL_UNPROVEN], [WARN_NOT_PQ_SAFE]],
|
||||||
'ecdh-sha2-nistk163': [[], [FAIL_UNPROVEN, FAIL_SMALL_ECC_MODULUS]],
|
'ecdh-sha2-nistk163': [[], [FAIL_UNPROVEN, FAIL_SMALL_ECC_MODULUS], [WARN_NOT_PQ_SAFE]],
|
||||||
'ecdh-sha2-nistk233': [[], [FAIL_UNPROVEN, FAIL_SMALL_ECC_MODULUS]],
|
'ecdh-sha2-nistk233': [[], [FAIL_UNPROVEN, FAIL_SMALL_ECC_MODULUS], [WARN_NOT_PQ_SAFE]],
|
||||||
'ecdh-sha2-nistk283': [[], [FAIL_UNPROVEN]],
|
'ecdh-sha2-nistk283': [[], [FAIL_UNPROVEN], [WARN_NOT_PQ_SAFE]],
|
||||||
'ecdh-sha2-nistk409': [[], [FAIL_UNPROVEN]],
|
'ecdh-sha2-nistk409': [[], [FAIL_UNPROVEN], [WARN_NOT_PQ_SAFE]],
|
||||||
'ecdh-sha2-nistp192': [[], [FAIL_NSA_BACKDOORED_CURVE]],
|
'ecdh-sha2-nistp192': [[], [FAIL_NSA_BACKDOORED_CURVE], [WARN_NOT_PQ_SAFE]],
|
||||||
'ecdh-sha2-nistp224': [[], [FAIL_NSA_BACKDOORED_CURVE]],
|
'ecdh-sha2-nistp224': [[], [FAIL_NSA_BACKDOORED_CURVE], [WARN_NOT_PQ_SAFE]],
|
||||||
'ecdh-sha2-nistp256': [['5.7,d2013.62,l10.6.0'], [FAIL_NSA_BACKDOORED_CURVE]],
|
'ecdh-sha2-nistp256': [['5.7,d2013.62,l10.6.0'], [FAIL_NSA_BACKDOORED_CURVE], [WARN_NOT_PQ_SAFE]],
|
||||||
'ecdh-sha2-nistp384': [['5.7,d2013.62'], [FAIL_NSA_BACKDOORED_CURVE]],
|
'ecdh-sha2-nistp384': [['5.7,d2013.62'], [FAIL_NSA_BACKDOORED_CURVE], [WARN_NOT_PQ_SAFE]],
|
||||||
'ecdh-sha2-nistp521': [['5.7,d2013.62'], [FAIL_NSA_BACKDOORED_CURVE]],
|
'ecdh-sha2-nistp521': [['5.7,d2013.62'], [FAIL_NSA_BACKDOORED_CURVE], [WARN_NOT_PQ_SAFE]],
|
||||||
'ecdh-sha2-nistt571': [[], [FAIL_UNPROVEN]],
|
'ecdh-sha2-nistt571': [[], [FAIL_UNPROVEN], [WARN_NOT_PQ_SAFE]],
|
||||||
'ecdh-sha2-qCbG5Cn/jjsZ7nBeR7EnOA==': [[FAIL_SMALL_ECC_MODULUS, FAIL_NSA_BACKDOORED_CURVE]], # sect233r1
|
'ecdh-sha2-qCbG5Cn/jjsZ7nBeR7EnOA==': [[], [FAIL_SMALL_ECC_MODULUS, FAIL_NSA_BACKDOORED_CURVE], [WARN_NOT_PQ_SAFE]], # sect233r1
|
||||||
'ecdh-sha2-qcFQaMAMGhTziMT0z+Tuzw==': [[], [FAIL_NSA_BACKDOORED_CURVE]], # NIST P-384 / secp384r1
|
'ecdh-sha2-qcFQaMAMGhTziMT0z+Tuzw==': [[], [FAIL_NSA_BACKDOORED_CURVE], [WARN_NOT_PQ_SAFE]], # NIST P-384 / secp384r1
|
||||||
'ecdh-sha2-VqBg4QRPjxx1EXZdV0GdWQ==': [[], [FAIL_NSA_BACKDOORED_CURVE, FAIL_SMALL_ECC_MODULUS]], # NIST P-224 / secp224r1
|
'ecdh-sha2-VqBg4QRPjxx1EXZdV0GdWQ==': [[], [FAIL_NSA_BACKDOORED_CURVE, FAIL_SMALL_ECC_MODULUS], [WARN_NOT_PQ_SAFE]], # NIST P-224 / secp224r1
|
||||||
'ecdh-sha2-wiRIU8TKjMZ418sMqlqtvQ==': [[], [FAIL_UNPROVEN]], # sect283k1
|
'ecdh-sha2-wiRIU8TKjMZ418sMqlqtvQ==': [[], [FAIL_UNPROVEN], [WARN_NOT_PQ_SAFE]], # sect283k1
|
||||||
'ecdh-sha2-zD/b3hu/71952ArpUG4OjQ==': [[], [FAIL_UNPROVEN, FAIL_SMALL_ECC_MODULUS]], # sect233k1
|
'ecdh-sha2-zD/b3hu/71952ArpUG4OjQ==': [[], [FAIL_UNPROVEN, FAIL_SMALL_ECC_MODULUS], [WARN_NOT_PQ_SAFE]], # sect233k1
|
||||||
'ecmqv-sha2': [[], [FAIL_UNPROVEN]],
|
'ecmqv-sha2': [[], [FAIL_UNPROVEN], [WARN_NOT_PQ_SAFE]],
|
||||||
'ext-info-c': [['7.2'], [], [], [INFO_EXTENSION_NEGOTIATION]], # Extension negotiation (RFC 8308)
|
'ext-info-c': [['7.2'], [], [], [INFO_EXTENSION_NEGOTIATION]], # Extension negotiation (RFC 8308)
|
||||||
'ext-info-s': [['9.6'], [], [], [INFO_EXTENSION_NEGOTIATION]], # Extension negotiation (RFC 8308)
|
'ext-info-s': [['9.6'], [], [], [INFO_EXTENSION_NEGOTIATION]], # Extension negotiation (RFC 8308)
|
||||||
'kex-strict-c-v00@openssh.com': [[], [], [], [INFO_STRICT_KEX]], # Strict KEX marker (countermeasure for CVE-2023-48795).
|
'kex-strict-c-v00@openssh.com': [[], [], [], [INFO_STRICT_KEX]], # Strict KEX marker (countermeasure for CVE-2023-48795).
|
||||||
'kex-strict-s-v00@openssh.com': [[], [], [], [INFO_STRICT_KEX]], # Strict KEX marker (countermeasure for CVE-2023-48795).
|
'kex-strict-s-v00@openssh.com': [[], [], [], [INFO_STRICT_KEX]], # Strict KEX marker (countermeasure for CVE-2023-48795).
|
||||||
|
|
||||||
# The GSS kex algorithms get special wildcard handling, since they include variable base64 data after their standard prefixes.
|
# The GSS kex algorithms get special wildcard handling, since they include variable base64 data after their standard prefixes.
|
||||||
'gss-13.3.132.0.10-sha256-*': [[], [FAIL_UNKNOWN]],
|
'gss-13.3.132.0.10-sha256-*': [[], [FAIL_UNKNOWN], [WARN_NOT_PQ_SAFE]],
|
||||||
'gss-curve25519-sha256-*': [[]],
|
'gss-curve25519-sha256-*': [[], [], [WARN_NOT_PQ_SAFE]],
|
||||||
'gss-curve448-sha512-*': [[]],
|
'gss-curve448-sha512-*': [[], [], [WARN_NOT_PQ_SAFE]],
|
||||||
'gss-gex-sha1-*': [[], [FAIL_SHA1]],
|
'gss-gex-sha1-*': [[], [FAIL_SHA1], [WARN_NOT_PQ_SAFE]],
|
||||||
'gss-gex-sha256-*': [[]],
|
'gss-gex-sha256-*': [[], [], [WARN_NOT_PQ_SAFE]],
|
||||||
'gss-group14-sha1-*': [[], [FAIL_SHA1], [WARN_2048BIT_MODULUS]],
|
'gss-group14-sha1-*': [[], [FAIL_SHA1], [WARN_2048BIT_MODULUS, WARN_NOT_PQ_SAFE]],
|
||||||
'gss-group14-sha256-*': [[], [], [WARN_2048BIT_MODULUS]],
|
'gss-group14-sha256-*': [[], [], [WARN_2048BIT_MODULUS, WARN_NOT_PQ_SAFE]],
|
||||||
'gss-group15-sha512-*': [[]],
|
'gss-group15-sha512-*': [[], [], [WARN_NOT_PQ_SAFE]],
|
||||||
'gss-group16-sha512-*': [[]],
|
'gss-group16-sha512-*': [[], [], [WARN_NOT_PQ_SAFE]],
|
||||||
'gss-group17-sha512-*': [[]],
|
'gss-group17-sha512-*': [[], [], [WARN_NOT_PQ_SAFE]],
|
||||||
'gss-group18-sha512-*': [[]],
|
'gss-group18-sha512-*': [[], [], [WARN_NOT_PQ_SAFE]],
|
||||||
'gss-group1-sha1-*': [[], [FAIL_1024BIT_MODULUS, FAIL_LOGJAM_ATTACK, FAIL_SHA1]],
|
'gss-group1-sha1-*': [[], [FAIL_1024BIT_MODULUS, FAIL_LOGJAM_ATTACK, FAIL_SHA1], [WARN_NOT_PQ_SAFE]],
|
||||||
'gss-nistp256-sha256-*': [[], [FAIL_NSA_BACKDOORED_CURVE]],
|
'gss-nistp256-sha256-*': [[], [FAIL_NSA_BACKDOORED_CURVE], [WARN_NOT_PQ_SAFE]],
|
||||||
'gss-nistp384-sha256-*': [[], [FAIL_NSA_BACKDOORED_CURVE]],
|
'gss-nistp384-sha256-*': [[], [FAIL_NSA_BACKDOORED_CURVE], [WARN_NOT_PQ_SAFE]],
|
||||||
'gss-nistp384-sha384-*': [[], [FAIL_NSA_BACKDOORED_CURVE]],
|
'gss-nistp384-sha384-*': [[], [FAIL_NSA_BACKDOORED_CURVE], [WARN_NOT_PQ_SAFE]],
|
||||||
'gss-nistp521-sha512-*': [[], [FAIL_NSA_BACKDOORED_CURVE]],
|
'gss-nistp521-sha512-*': [[], [FAIL_NSA_BACKDOORED_CURVE], [WARN_NOT_PQ_SAFE]],
|
||||||
'kexAlgoCurve25519SHA256': [[]],
|
'kexAlgoCurve25519SHA256': [[], [], [WARN_NOT_PQ_SAFE]],
|
||||||
'kexAlgoDH14SHA1': [[], [FAIL_SHA1], [WARN_2048BIT_MODULUS]],
|
'kexAlgoDH14SHA1': [[], [FAIL_SHA1], [WARN_2048BIT_MODULUS, WARN_NOT_PQ_SAFE]],
|
||||||
'kexAlgoDH1SHA1': [[], [FAIL_1024BIT_MODULUS, FAIL_LOGJAM_ATTACK, FAIL_SHA1]],
|
'kexAlgoDH1SHA1': [[], [FAIL_1024BIT_MODULUS, FAIL_LOGJAM_ATTACK, FAIL_SHA1], [WARN_NOT_PQ_SAFE]],
|
||||||
'kexAlgoECDH256': [[], [FAIL_NSA_BACKDOORED_CURVE]],
|
'kexAlgoECDH256': [[], [FAIL_NSA_BACKDOORED_CURVE], [WARN_NOT_PQ_SAFE]],
|
||||||
'kexAlgoECDH384': [[], [FAIL_NSA_BACKDOORED_CURVE]],
|
'kexAlgoECDH384': [[], [FAIL_NSA_BACKDOORED_CURVE], [WARN_NOT_PQ_SAFE]],
|
||||||
'kexAlgoECDH521': [[], [FAIL_NSA_BACKDOORED_CURVE]],
|
'kexAlgoECDH521': [[], [FAIL_NSA_BACKDOORED_CURVE], [WARN_NOT_PQ_SAFE]],
|
||||||
'kexguess2@matt.ucc.asn.au': [['d2013.57']],
|
'kexguess2@matt.ucc.asn.au': [['d2013.57'], [], [WARN_NOT_PQ_SAFE]],
|
||||||
'm383-sha384@libassh.org': [[], [FAIL_UNPROVEN]],
|
'm383-sha384@libassh.org': [[], [FAIL_UNPROVEN], [WARN_NOT_PQ_SAFE]],
|
||||||
'm511-sha512@libassh.org': [[], [FAIL_UNPROVEN]],
|
'm511-sha512@libassh.org': [[], [FAIL_UNPROVEN], [WARN_NOT_PQ_SAFE]],
|
||||||
'mlkem768x25519-sha256': [['9.9'], [], [], [INFO_HYBRID_PQ_X25519_KEX]],
|
'mlkem768x25519-sha256': [['9.9'], [], [], [INFO_HYBRID_PQ_X25519_KEX]],
|
||||||
'rsa1024-sha1': [[], [FAIL_1024BIT_MODULUS, FAIL_SHA1]],
|
'rsa1024-sha1': [[], [FAIL_1024BIT_MODULUS, FAIL_SHA1], [WARN_NOT_PQ_SAFE]],
|
||||||
'rsa2048-sha256': [[], [], [WARN_2048BIT_MODULUS]],
|
'rsa2048-sha256': [[], [], [WARN_2048BIT_MODULUS, WARN_NOT_PQ_SAFE]],
|
||||||
'sm2kep-sha2-nistp256': [[], [FAIL_NSA_BACKDOORED_CURVE, FAIL_UNTRUSTED]],
|
'sm2kep-sha2-nistp256': [[], [FAIL_NSA_BACKDOORED_CURVE, FAIL_UNTRUSTED], [WARN_NOT_PQ_SAFE]],
|
||||||
'sntrup4591761x25519-sha512@tinyssh.org': [['8.0', '8.4'], [], [WARN_EXPERIMENTAL], [INFO_WITHDRAWN_PQ_ALG]],
|
'sntrup4591761x25519-sha512@tinyssh.org': [['8.0', '8.4'], [], [WARN_EXPERIMENTAL], [INFO_WITHDRAWN_PQ_ALG]],
|
||||||
'sntrup761x25519-sha512': [['9.9'], [], [], [INFO_DEFAULT_OPENSSH_KEX_99, INFO_HYBRID_PQ_X25519_KEX]],
|
'sntrup761x25519-sha512': [['9.9'], [], [], [INFO_DEFAULT_OPENSSH_KEX_99, INFO_HYBRID_PQ_X25519_KEX]],
|
||||||
'sntrup761x25519-sha512@openssh.com': [['8.5'], [], [], [INFO_DEFAULT_OPENSSH_KEX_90_TO_98, INFO_HYBRID_PQ_X25519_KEX]],
|
'sntrup761x25519-sha512@openssh.com': [['8.5'], [], [], [INFO_DEFAULT_OPENSSH_KEX_90_TO_98, INFO_HYBRID_PQ_X25519_KEX]],
|
||||||
|
|||||||
+162
-157
@@ -23,9 +23,9 @@
|
|||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
THE SOFTWARE.
|
THE SOFTWARE.
|
||||||
"""
|
"""
|
||||||
|
import argparse
|
||||||
import concurrent.futures
|
import concurrent.futures
|
||||||
import copy
|
import copy
|
||||||
import getopt # pylint: disable=deprecated-module
|
|
||||||
import json
|
import json
|
||||||
import multiprocessing
|
import multiprocessing
|
||||||
import os
|
import os
|
||||||
@@ -33,6 +33,7 @@ import re
|
|||||||
import sys
|
import sys
|
||||||
import traceback
|
import traceback
|
||||||
|
|
||||||
|
|
||||||
# pylint: disable=unused-import
|
# pylint: disable=unused-import
|
||||||
from typing import Dict, List, Set, Sequence, Tuple, Iterable # noqa: F401
|
from typing import Dict, List, Set, Sequence, Tuple, Iterable # noqa: F401
|
||||||
from typing import cast, Callable, Optional, Union, Any # noqa: F401
|
from typing import cast, Callable, Optional, Union, Any # noqa: F401
|
||||||
@@ -52,6 +53,7 @@ from ssh_audit.gextest import GEXTest
|
|||||||
from ssh_audit.hostkeytest import HostKeyTest
|
from ssh_audit.hostkeytest import HostKeyTest
|
||||||
from ssh_audit.outputbuffer import OutputBuffer
|
from ssh_audit.outputbuffer import OutputBuffer
|
||||||
from ssh_audit.policy import Policy
|
from ssh_audit.policy import Policy
|
||||||
|
from ssh_audit.hardeningguides import PrintHardeningGuides
|
||||||
from ssh_audit.product import Product
|
from ssh_audit.product import Product
|
||||||
from ssh_audit.protocol import Protocol
|
from ssh_audit.protocol import Protocol
|
||||||
from ssh_audit.software import Software
|
from ssh_audit.software import Software
|
||||||
@@ -82,61 +84,6 @@ if sys.platform == 'win32':
|
|||||||
# no_idna_workaround = True
|
# no_idna_workaround = True
|
||||||
|
|
||||||
|
|
||||||
def usage(uout: OutputBuffer, err: Optional[str] = None) -> None:
|
|
||||||
retval = exitcodes.GOOD
|
|
||||||
p = os.path.basename(sys.argv[0])
|
|
||||||
uout.head('# {} {}, https://github.com/jtesta/ssh-audit\n'.format(p, VERSION))
|
|
||||||
if err is not None and len(err) > 0:
|
|
||||||
uout.fail(err + '\n')
|
|
||||||
retval = exitcodes.UNKNOWN_ERROR
|
|
||||||
uout.info('usage: {0} [options] <host>\n'.format(p))
|
|
||||||
uout.info(' -h, --help print this help')
|
|
||||||
uout.info(' -1, --ssh1 force ssh version 1 only')
|
|
||||||
uout.info(' -2, --ssh2 force ssh version 2 only')
|
|
||||||
uout.info(' -4, --ipv4 enable IPv4 (order of precedence)')
|
|
||||||
uout.info(' -6, --ipv6 enable IPv6 (order of precedence)')
|
|
||||||
uout.info(' -b, --batch batch output')
|
|
||||||
uout.info(' -c, --client-audit starts a server on port 2222 to audit client\n software config (use -p to change port;\n use -t to change timeout)')
|
|
||||||
uout.info(' --conn-rate-test=N[:max_rate] perform a connection rate test (useful')
|
|
||||||
uout.info(' for collecting metrics related to')
|
|
||||||
uout.info(' susceptibility of the DHEat vuln).')
|
|
||||||
uout.info(' Testing is conducted with N concurrent')
|
|
||||||
uout.info(' sockets with an optional maximum rate')
|
|
||||||
uout.info(' of connections per second.')
|
|
||||||
uout.info(' -d, --debug debug output')
|
|
||||||
uout.info(' --dheat=N[:kex[:e_len]] continuously perform the DHEat DoS attack')
|
|
||||||
uout.info(' (CVE-2002-20001) against the target using N')
|
|
||||||
uout.info(' concurrent sockets. Optionally, a specific')
|
|
||||||
uout.info(' key exchange algorithm can be specified')
|
|
||||||
uout.info(' instead of allowing it to be automatically')
|
|
||||||
uout.info(' chosen. Additionally, a small length of')
|
|
||||||
uout.info(' the fake e value sent to the server can')
|
|
||||||
uout.info(' be chosen for a more efficient attack (such')
|
|
||||||
uout.info(' as 4).')
|
|
||||||
uout.info(' -g, --gex-test=<x[,y,...]> dh gex modulus size test')
|
|
||||||
uout.info(' <min1:pref1:max1[,min2:pref2:max2,...]>')
|
|
||||||
uout.info(' <x-y[:step]>')
|
|
||||||
uout.info(' -j, --json JSON output (use -jj to enable indents)')
|
|
||||||
uout.info(' -l, --level=<level> minimum output level (info|warn|fail)')
|
|
||||||
uout.info(' -L, --list-policies list all the official, built-in policies. Use with -v')
|
|
||||||
uout.info(' to view policy change logs.')
|
|
||||||
uout.info(' --lookup=<alg1,alg2,...> looks up an algorithm(s) without\n connecting to a server')
|
|
||||||
uout.info(' -M, --make-policy=<policy.txt> creates a policy based on the target server\n (i.e.: the target server has the ideal\n configuration that other servers should\n adhere to)')
|
|
||||||
uout.info(' -m, --manual print the man page (Windows only)')
|
|
||||||
uout.info(' -n, --no-colors disable colors (automatic when the NO_COLOR')
|
|
||||||
uout.info(' environment variable is set)')
|
|
||||||
uout.info(' -p, --port=<port> port to connect')
|
|
||||||
uout.info(' -P, --policy=<policy.txt> run a policy test using the specified policy')
|
|
||||||
uout.info(' --skip-rate-test skip the connection rate test during standard audits\n (used to safely infer whether the DHEat attack\n is viable)')
|
|
||||||
uout.info(' -t, --timeout=<secs> timeout (in seconds) for connection and reading\n (default: 5)')
|
|
||||||
uout.info(' -T, --targets=<hosts.txt> a file containing a list of target hosts (one\n per line, format HOST[:PORT]). Use -p/--port\n to set the default port for all hosts. Use\n --threads to control concurrent scans.')
|
|
||||||
uout.info(' --threads=<threads> number of threads to use when scanning multiple\n targets (-T/--targets) (default: 32)')
|
|
||||||
uout.info(' -v, --verbose verbose output')
|
|
||||||
uout.sep()
|
|
||||||
uout.write()
|
|
||||||
sys.exit(retval)
|
|
||||||
|
|
||||||
|
|
||||||
def output_algorithms(out: OutputBuffer, title: str, alg_db: Dict[str, Dict[str, List[List[Optional[str]]]]], alg_type: str, algorithms: List[str], unknown_algs: List[str], is_json_output: bool, program_retval: int, maxlen: int = 0, host_keys: Optional[Dict[str, Dict[str, Union[bytes, str, int]]]] = None, dh_modulus_sizes: Optional[Dict[str, int]] = None) -> int: # pylint: disable=too-many-arguments
|
def output_algorithms(out: OutputBuffer, title: str, alg_db: Dict[str, Dict[str, List[List[Optional[str]]]]], alg_type: str, algorithms: List[str], unknown_algs: List[str], is_json_output: bool, program_retval: int, maxlen: int = 0, host_keys: Optional[Dict[str, Dict[str, Union[bytes, str, int]]]] = None, dh_modulus_sizes: Optional[Dict[str, int]] = None) -> int: # pylint: disable=too-many-arguments
|
||||||
with out:
|
with out:
|
||||||
for algorithm in algorithms:
|
for algorithm in algorithms:
|
||||||
@@ -371,7 +318,7 @@ def output_recommendations(out: OutputBuffer, algs: Algorithms, algorithm_recomm
|
|||||||
notes = " (%s)" % notes
|
notes = " (%s)" % notes
|
||||||
|
|
||||||
fm = '(rec) {0}{1}{2}-- {3} algorithm to {4}{5} '
|
fm = '(rec) {0}{1}{2}-- {3} algorithm to {4}{5} '
|
||||||
fn(fm.format(sg, name, p, alg_type, an, notes))
|
fn(fm.format(sg, name, p, alg_type, an, notes)) # type: ignore[operator]
|
||||||
|
|
||||||
if not out.is_section_empty() and not is_json_output:
|
if not out.is_section_empty() and not is_json_output:
|
||||||
if software is not None:
|
if software is not None:
|
||||||
@@ -586,9 +533,9 @@ def output(out: OutputBuffer, aconf: AuditConf, banner: Optional[Banner], header
|
|||||||
else:
|
else:
|
||||||
host = '%s:%d' % (aconf.host, aconf.port)
|
host = '%s:%d' % (aconf.host, aconf.port)
|
||||||
|
|
||||||
out.good('(gen) target: {}'. format(host))
|
out.good('(gen) target: {}'. format(host), always_print=True)
|
||||||
if client_audit:
|
if client_audit:
|
||||||
out.good('(gen) client IP: {}'.format(client_host))
|
out.good('(gen) client IP: {}'.format(client_host), always_print=True)
|
||||||
if len(header) > 0:
|
if len(header) > 0:
|
||||||
out.info('(gen) header: ' + '\n'.join(header))
|
out.info('(gen) header: ' + '\n'.join(header))
|
||||||
if banner is not None:
|
if banner is not None:
|
||||||
@@ -823,7 +770,7 @@ def make_policy(aconf: AuditConf, banner: Optional['Banner'], kex: Optional['SSH
|
|||||||
print(err)
|
print(err)
|
||||||
|
|
||||||
|
|
||||||
def process_commandline(out: OutputBuffer, args: List[str], usage_cb: Callable[..., None]) -> 'AuditConf': # pylint: disable=too-many-statements
|
def process_commandline(out: OutputBuffer, args: List[str]) -> 'AuditConf': # pylint: disable=too-many-statements
|
||||||
# pylint: disable=too-many-branches
|
# pylint: disable=too-many-branches
|
||||||
aconf = AuditConf()
|
aconf = AuditConf()
|
||||||
|
|
||||||
@@ -836,82 +783,117 @@ def process_commandline(out: OutputBuffer, args: List[str], usage_cb: Callable[.
|
|||||||
aconf.colors = enable_colors
|
aconf.colors = enable_colors
|
||||||
out.use_colors = enable_colors
|
out.use_colors = enable_colors
|
||||||
|
|
||||||
try:
|
|
||||||
sopts = 'h1246M:p:P:jbcnvl:t:T:Lmdg:'
|
|
||||||
lopts = ['help', 'ssh1', 'ssh2', 'ipv4', 'ipv6', 'make-policy=', 'port=', 'policy=', 'json', 'batch', 'client-audit', 'no-colors', 'verbose', 'level=', 'timeout=', 'targets=', 'list-policies', 'lookup=', 'threads=', 'manual', 'debug', 'gex-test=', 'dheat=', 'skip-rate-test', 'conn-rate-test=']
|
|
||||||
opts, args = getopt.gnu_getopt(args, sopts, lopts)
|
|
||||||
except getopt.GetoptError as err:
|
|
||||||
usage_cb(out, str(err))
|
|
||||||
aconf.ssh1, aconf.ssh2 = False, False
|
aconf.ssh1, aconf.ssh2 = False, False
|
||||||
host: str = ''
|
host: str = ''
|
||||||
oport: Optional[str] = None
|
port: int = 22
|
||||||
port: int = 0
|
|
||||||
for o, a in opts:
|
|
||||||
if o in ('-h', '--help'):
|
|
||||||
usage_cb(out)
|
|
||||||
elif o in ('-1', '--ssh1'):
|
|
||||||
aconf.ssh1 = True
|
|
||||||
elif o in ('-2', '--ssh2'):
|
|
||||||
aconf.ssh2 = True
|
|
||||||
elif o in ('-4', '--ipv4'):
|
|
||||||
aconf.ipv4 = True
|
|
||||||
elif o in ('-6', '--ipv6'):
|
|
||||||
aconf.ipv6 = True
|
|
||||||
elif o in ('-p', '--port'):
|
|
||||||
oport = a
|
|
||||||
elif o in ('-b', '--batch'):
|
|
||||||
aconf.batch = True
|
|
||||||
aconf.verbose = True
|
|
||||||
elif o in ('-c', '--client-audit'):
|
|
||||||
aconf.client_audit = True
|
|
||||||
elif o in ('-j', '--json'):
|
|
||||||
if aconf.json: # If specified twice, enable indent printing.
|
|
||||||
aconf.json_print_indent = True
|
|
||||||
else:
|
|
||||||
aconf.json = True
|
|
||||||
elif o in ('-v', '--verbose'):
|
|
||||||
aconf.verbose = True
|
|
||||||
out.verbose = True
|
|
||||||
elif o in ('-l', '--level'):
|
|
||||||
if a not in ('info', 'warn', 'fail'):
|
|
||||||
usage_cb(out, 'level {} is not valid'.format(a))
|
|
||||||
aconf.level = a
|
|
||||||
elif o in ('-t', '--timeout'):
|
|
||||||
aconf.timeout = float(a)
|
|
||||||
aconf.timeout_set = True
|
|
||||||
elif o in ('-M', '--make-policy'):
|
|
||||||
aconf.make_policy = True
|
|
||||||
aconf.policy_file = a
|
|
||||||
elif o in ('-P', '--policy'):
|
|
||||||
aconf.policy_file = a
|
|
||||||
elif o in ('-T', '--targets'):
|
|
||||||
aconf.target_file = a
|
|
||||||
|
|
||||||
# If we're on Windows, and we can't use the idna workaround, force only one thread to be used (otherwise a crash would occur).
|
parser = argparse.ArgumentParser(description="# {} {}, https://github.com/jtesta/ssh-audit".format(os.path.basename(sys.argv[0]), VERSION), allow_abbrev=False)
|
||||||
# if no_idna_workaround:
|
|
||||||
# print("\nWARNING: the idna module was not found on this system, thus only single-threaded scanning will be done (this is a workaround for this Windows-specific crash: https://github.com/python/cpython/issues/73474). Multi-threaded scanning can be enabled by installing the idna module (pip install idna).\n")
|
# Add short options to the parser
|
||||||
# aconf.threads = 1
|
parser.add_argument("-1", "--ssh1", action="store_true", dest="ssh1", default=False, help="force ssh version 1 only")
|
||||||
elif o == '--threads':
|
parser.add_argument("-2", "--ssh2", action="store_true", dest="ssh2", default=False, help="force ssh version 2 only")
|
||||||
aconf.threads = int(a)
|
parser.add_argument("-4", "--ipv4", action="store_true", dest="ipv4", default=False, help="enable IPv4 (order of precedence)")
|
||||||
# if no_idna_workaround:
|
parser.add_argument("-6", "--ipv6", action="store_true", dest="ipv6", default=False, help="enable IPv6 (order of precedence)")
|
||||||
# aconf.threads = 1
|
parser.add_argument("-b", "--batch", action="store_true", dest="batch", default=False, help="batch output")
|
||||||
elif o in ('-L', '--list-policies'):
|
parser.add_argument("-c", "--client-audit", action="store_true", dest="client_audit", default=False, help="starts a server on port 2222 to audit client software config (use -p to change port; use -t to change timeout)")
|
||||||
aconf.list_policies = True
|
parser.add_argument("-d", "--debug", action="store_true", dest="debug", default=False, help="enable debugging output")
|
||||||
elif o == '--lookup':
|
parser.add_argument("-g", "--gex-test", action="store", dest="gex_test", metavar="<min1:pref1:max1[,min2:pref2:max2,...]> / <x-y[:step]>", type=str, default=None, help="conducts a very customized Diffie-Hellman GEX modulus size test. Tests an array of minimum, preferred, and maximum values, or a range of values with an optional incremental step amount")
|
||||||
aconf.lookup = a
|
parser.add_argument("-j", "--json", action="count", dest="json", default=0, help="enable JSON output (use -jj to enable indentation for better readability)")
|
||||||
elif o in ('-m', '--manual'):
|
parser.add_argument("-l", "--level", action="store", dest="level", type=str, choices=["info", "warn", "fail"], default="info", help="minimum output level (default: %(default)s)")
|
||||||
aconf.manual = True
|
parser.add_argument("-L", "--list-policies", action="store_true", dest="list_policies", default=False, help="list all the official, built-in policies. Combine with -v to view policy change logs")
|
||||||
elif o in ('-d', '--debug'):
|
parser.add_argument("-M", "--make-policy", action="store", dest="make_policy", metavar="custom_policy.txt", type=str, default=None, help="creates a policy based on the target server (i.e.: the target server has the ideal configuration that other servers should adhere to), and stores it in the file path specified")
|
||||||
|
parser.add_argument("-m", "--manual", action="store_true", dest="manual", default=False, help="print the man page (Docker, PyPI, Snap, and Windows builds only)")
|
||||||
|
parser.add_argument("-n", "--no-colors", action="store_true", dest="no_colors", default=False, help="disable colors (automatic when the NO_COLOR environment variable is set)")
|
||||||
|
parser.add_argument("-P", "--policy", action="store", dest="policy", metavar="\"Built-In Policy Name\" / custom_policy.txt", type=str, default=None, help="run a policy test using the specified policy (use -L to see built-in policies, or specify filesystem path to custom policy created by -M)")
|
||||||
|
parser.add_argument("-p", "--port", action="store", dest="oport", metavar="N", type=int, default=None, help="the TCP port to connect to (or to listen on when -c is used)")
|
||||||
|
parser.add_argument("-T", "--targets", action="store", dest="targets", metavar="targets.txt", type=str, default=None, help="a file containing a list of target hosts (one per line, format HOST[:PORT]). Use -p/--port to set the default port for all hosts. Use --threads to control concurrent scans")
|
||||||
|
parser.add_argument("-t", "--timeout", action="store", dest="timeout", metavar="N", type=int, default=5, help="timeout (in seconds) for connection and reading (default: %(default)s)")
|
||||||
|
parser.add_argument("-v", "--verbose", action="store_true", dest="verbose", default=False, help="enable verbose output")
|
||||||
|
|
||||||
|
# Add long options to the parser
|
||||||
|
parser.add_argument("--conn-rate-test", action="store", dest="conn_rate_test", metavar="N[:max_rate]", type=str, default=None, help="perform a connection rate test (useful for collecting metrics related to susceptibility of the DHEat vuln). Testing is conducted with N concurrent sockets with an optional maximum rate of connections per second")
|
||||||
|
parser.add_argument("--dheat", action="store", dest="dheat", metavar="N[:kex[:e_len]]", type=str, default=None, help="continuously perform the DHEat DoS attack (CVE-2002-20001) against the target using N concurrent sockets. Optionally, a specific key exchange algorithm can be specified instead of allowing it to be automatically chosen. Additionally, a small length of the fake e value sent to the server can be chosen for a more efficient attack (such as 4).")
|
||||||
|
parser.add_argument("--lookup", action="store", dest="lookup", metavar="alg1[,alg2,...]", type=str, default=None, help="looks up an algorithm(s) without connecting to a server.")
|
||||||
|
parser.add_argument("--skip-rate-test", action="store_true", dest="skip_rate_test", default=False, help="skip the connection rate test during standard audits (used to safely infer whether the DHEat attack is viable)")
|
||||||
|
parser.add_argument("--threads", action="store", dest="threads", metavar="N", type=int, default=32, help="number of threads to use when scanning multiple targets (-T/--targets) (default: %(default)s)")
|
||||||
|
|
||||||
|
# Print Suggested Configurations from : https://www.ssh-audit.com/hardening_guides.html
|
||||||
|
parser.add_argument("--get-hardening-guides", nargs="*", action="append", metavar="OS Ver Client/Server", dest="get_hardening_guides", type=str, default=None, help="Print suggested server or client configurations. Usage Example : Ubuntu 2404 Server")
|
||||||
|
parser.add_argument("--list-hardening-guides", action="store_true", dest="list_hardening_guides", default=False, help="List supported server and client configurations.")
|
||||||
|
|
||||||
|
# The mandatory target option. Or rather, mandatory when -L, -T, --lookup or --print-config are not used.
|
||||||
|
parser.add_argument("host", nargs="?", action="store", type=str, default="", help="target hostname or IPv4/IPv6 address")
|
||||||
|
|
||||||
|
# If no arguments were given, print the help and exit.
|
||||||
|
if len(args) < 1:
|
||||||
|
parser.print_help()
|
||||||
|
sys.exit(exitcodes.UNKNOWN_ERROR)
|
||||||
|
|
||||||
|
oport: Optional[int] = None
|
||||||
|
try:
|
||||||
|
argument = parser.parse_args(args=args)
|
||||||
|
|
||||||
|
if argument.list_hardening_guides is True:
|
||||||
|
PrintHardeningGuides.supported_varient()
|
||||||
|
|
||||||
|
if argument.get_hardening_guides is not None:
|
||||||
|
print_guides = (getattr(argument, 'get_hardening_guides'))[0]
|
||||||
|
arg_len = len(print_guides)
|
||||||
|
if arg_len <= 2:
|
||||||
|
user_arg = ""
|
||||||
|
for i in range(arg_len):
|
||||||
|
user_arg = user_arg + " " + str(print_guides[i])
|
||||||
|
print(f"\033[1mUnsupported configuration : {user_arg}\033[0m")
|
||||||
|
PrintHardeningGuides.supported_varient()
|
||||||
|
else:
|
||||||
|
print_guides = (getattr(argument, 'get_hardening_guides'))[0]
|
||||||
|
os_type = print_guides[0]
|
||||||
|
os_ver = print_guides[1]
|
||||||
|
clientserver = print_guides[2]
|
||||||
|
|
||||||
|
PrintHardeningGuides(os_type, os_ver, clientserver)
|
||||||
|
|
||||||
|
|
||||||
|
# Set simple flags.
|
||||||
|
aconf.client_audit = argument.client_audit
|
||||||
|
aconf.ipv4 = argument.ipv4
|
||||||
|
aconf.ipv6 = argument.ipv6
|
||||||
|
aconf.level = argument.level
|
||||||
|
aconf.list_policies = argument.list_policies
|
||||||
|
aconf.manual = argument.manual
|
||||||
|
aconf.skip_rate_test = argument.skip_rate_test
|
||||||
|
aconf.ssh1 = argument.ssh1
|
||||||
|
aconf.ssh2 = argument.ssh2
|
||||||
|
oport = argument.oport
|
||||||
|
|
||||||
|
if argument.batch is True:
|
||||||
|
aconf.batch = True
|
||||||
|
|
||||||
|
# If one -j was given, turn on JSON output. If -jj was given, enable indentation.
|
||||||
|
aconf.json = argument.json > 0
|
||||||
|
if argument.json > 1:
|
||||||
|
aconf.json_print_indent = True
|
||||||
|
|
||||||
|
if argument.conn_rate_test is not None:
|
||||||
|
aconf.conn_rate_test = argument.conn_rate_test
|
||||||
|
|
||||||
|
if argument.debug is True:
|
||||||
aconf.debug = True
|
aconf.debug = True
|
||||||
out.debug = True
|
out.debug = True
|
||||||
elif o in ('-g', '--gex-test'):
|
|
||||||
|
if argument.dheat is not None:
|
||||||
|
aconf.dheat = argument.dheat
|
||||||
|
|
||||||
|
if argument.gex_test is not None:
|
||||||
|
dh_gex = argument.gex_test
|
||||||
permitted_syntax = get_permitted_syntax_for_gex_test()
|
permitted_syntax = get_permitted_syntax_for_gex_test()
|
||||||
|
|
||||||
if not any(re.search(regex_str, a) for regex_str in permitted_syntax.values()):
|
if not any(re.search(regex_str, dh_gex) for regex_str in permitted_syntax.values()):
|
||||||
usage_cb(out, '{} {} is not valid'.format(o, a))
|
out.fail('{} is not valid'.format(dh_gex), write_now=True)
|
||||||
|
sys.exit(exitcodes.UNKNOWN_ERROR)
|
||||||
|
|
||||||
if re.search(permitted_syntax['RANGE'], a):
|
if re.search(permitted_syntax['RANGE'], dh_gex):
|
||||||
extracted_digits = re.findall(r'\d+', a)
|
extracted_digits = re.findall(r'\d+', dh_gex)
|
||||||
bits_left_bound = int(extracted_digits[0])
|
bits_left_bound = int(extracted_digits[0])
|
||||||
bits_right_bound = int(extracted_digits[1])
|
bits_right_bound = int(extracted_digits[1])
|
||||||
|
|
||||||
@@ -920,27 +902,52 @@ def process_commandline(out: OutputBuffer, args: List[str], usage_cb: Callable[.
|
|||||||
bits_step = int(extracted_digits[2])
|
bits_step = int(extracted_digits[2])
|
||||||
|
|
||||||
if bits_step <= 0:
|
if bits_step <= 0:
|
||||||
usage_cb(out, '{} {} is not valid'.format(o, bits_step))
|
out.fail('the step field cannot be 0 or less: {}'.format(bits_step), write_now=True)
|
||||||
|
sys.exit(exitcodes.UNKNOWN_ERROR)
|
||||||
|
|
||||||
if all(x < 0 for x in (bits_left_bound, bits_right_bound)):
|
if all(x < 0 for x in (bits_left_bound, bits_right_bound)):
|
||||||
usage_cb(out, '{} {} {} is not valid'.format(o, bits_left_bound, bits_right_bound))
|
out.fail('{} {} {} is not valid'.format(dh_gex, bits_left_bound, bits_right_bound), write_now=True)
|
||||||
|
sys.exit(exitcodes.UNKNOWN_ERROR)
|
||||||
|
|
||||||
aconf.gex_test = a
|
aconf.gex_test = dh_gex
|
||||||
elif o == '--dheat':
|
|
||||||
aconf.dheat = a
|
|
||||||
elif o == '--skip-rate-test':
|
|
||||||
aconf.skip_rate_test = True
|
|
||||||
elif o == '--conn-rate-test':
|
|
||||||
aconf.conn_rate_test = a
|
|
||||||
|
|
||||||
|
if argument.lookup is not None:
|
||||||
|
aconf.lookup = argument.lookup
|
||||||
|
|
||||||
if len(args) == 0 and aconf.client_audit is False and aconf.target_file is None and aconf.list_policies is False and aconf.lookup == '' and aconf.manual is False:
|
if argument.make_policy is not None:
|
||||||
usage_cb(out)
|
aconf.make_policy = True
|
||||||
|
aconf.policy_file = argument.make_policy
|
||||||
|
|
||||||
|
if argument.policy is not None:
|
||||||
|
aconf.policy_file = argument.policy
|
||||||
|
|
||||||
|
if argument.targets is not None:
|
||||||
|
aconf.target_file = argument.targets
|
||||||
|
|
||||||
|
if argument.threads is not None:
|
||||||
|
aconf.threads = argument.threads
|
||||||
|
|
||||||
|
if argument.timeout is not None:
|
||||||
|
aconf.timeout = float(argument.timeout)
|
||||||
|
aconf.timeout_set = True
|
||||||
|
|
||||||
|
if argument.verbose is True:
|
||||||
|
aconf.verbose = True
|
||||||
|
out.verbose = True
|
||||||
|
|
||||||
|
except argparse.ArgumentError as err:
|
||||||
|
out.fail(str(err), write_now=True)
|
||||||
|
parser.print_help()
|
||||||
|
sys.exit(exitcodes.UNKNOWN_ERROR)
|
||||||
|
|
||||||
|
if argument.host == "" and argument.client_audit is False and argument.targets is None and argument.list_policies is False and argument.lookup is None and argument.manual is False and argument.get_hardening_guides is None:
|
||||||
|
out.fail("target host must be specified, unless -c, -m, -L, -T, --lookup or --print-configuration are used", write_now=True)
|
||||||
|
sys.exit(exitcodes.UNKNOWN_ERROR)
|
||||||
|
|
||||||
if aconf.manual:
|
if aconf.manual:
|
||||||
return aconf
|
return aconf
|
||||||
|
|
||||||
if aconf.lookup != '':
|
if aconf.lookup != "":
|
||||||
return aconf
|
return aconf
|
||||||
|
|
||||||
if aconf.list_policies:
|
if aconf.list_policies:
|
||||||
@@ -949,25 +956,26 @@ def process_commandline(out: OutputBuffer, args: List[str], usage_cb: Callable[.
|
|||||||
|
|
||||||
if aconf.client_audit is False and aconf.target_file is None:
|
if aconf.client_audit is False and aconf.target_file is None:
|
||||||
if oport is not None:
|
if oport is not None:
|
||||||
host = args[0]
|
host = argument.host
|
||||||
else:
|
else:
|
||||||
host, port = Utils.parse_host_and_port(args[0])
|
host, port = Utils.parse_host_and_port(argument.host)
|
||||||
if not host and aconf.target_file is None:
|
|
||||||
usage_cb(out, 'host is empty')
|
|
||||||
|
|
||||||
if port == 0 and oport is None:
|
if not host and aconf.target_file is None:
|
||||||
if aconf.client_audit: # The default port to listen on during a client audit is 2222.
|
out.fail("target host is not specified", write_now=True)
|
||||||
|
sys.exit(exitcodes.UNKNOWN_ERROR)
|
||||||
|
|
||||||
|
if oport is None and aconf.client_audit: # The default port to listen on during a client audit is 2222.
|
||||||
port = 2222
|
port = 2222
|
||||||
else:
|
|
||||||
port = 22
|
|
||||||
|
|
||||||
if oport is not None:
|
if oport is not None:
|
||||||
port = Utils.parse_int(oport)
|
port = Utils.parse_int(oport)
|
||||||
if port <= 0 or port > 65535:
|
if port < 1 or port > 65535:
|
||||||
usage_cb(out, 'port {} is not valid'.format(oport))
|
out.fail("port must be greater than 0 and less than 65535: {}".format(oport), write_now=True)
|
||||||
|
sys.exit(exitcodes.UNKNOWN_ERROR)
|
||||||
|
|
||||||
aconf.host = host
|
aconf.host = host
|
||||||
aconf.port = port
|
aconf.port = port
|
||||||
|
|
||||||
if not (aconf.ssh1 or aconf.ssh2):
|
if not (aconf.ssh1 or aconf.ssh2):
|
||||||
aconf.ssh1, aconf.ssh2 = True, True
|
aconf.ssh1, aconf.ssh2 = True, True
|
||||||
|
|
||||||
@@ -996,20 +1004,17 @@ def process_commandline(out: OutputBuffer, args: List[str], usage_cb: Callable[.
|
|||||||
try:
|
try:
|
||||||
aconf.policy = Policy(policy_file=aconf.policy_file, json_output=aconf.json)
|
aconf.policy = Policy(policy_file=aconf.policy_file, json_output=aconf.json)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
out.fail("Error while loading policy file: %s: %s" % (str(e), traceback.format_exc()))
|
out.fail("Error while loading policy file: %s: %s" % (str(e), traceback.format_exc()), write_now=True)
|
||||||
out.write()
|
|
||||||
sys.exit(exitcodes.UNKNOWN_ERROR)
|
sys.exit(exitcodes.UNKNOWN_ERROR)
|
||||||
|
|
||||||
# If the user wants to do a client audit, but provided a server policy, terminate.
|
# If the user wants to do a client audit, but provided a server policy, terminate.
|
||||||
if aconf.client_audit and aconf.policy.is_server_policy():
|
if aconf.client_audit and aconf.policy.is_server_policy():
|
||||||
out.fail("Error: client audit selected, but server policy provided.")
|
out.fail("Error: client audit selected, but server policy provided.", write_now=True)
|
||||||
out.write()
|
|
||||||
sys.exit(exitcodes.UNKNOWN_ERROR)
|
sys.exit(exitcodes.UNKNOWN_ERROR)
|
||||||
|
|
||||||
# If the user wants to do a server audit, but provided a client policy, terminate.
|
# If the user wants to do a server audit, but provided a client policy, terminate.
|
||||||
if aconf.client_audit is False and aconf.policy.is_server_policy() is False:
|
if aconf.client_audit is False and aconf.policy.is_server_policy() is False:
|
||||||
out.fail("Error: server audit selected, but client policy provided.")
|
out.fail("Error: server audit selected, but client policy provided.", write_now=True)
|
||||||
out.write()
|
|
||||||
sys.exit(exitcodes.UNKNOWN_ERROR)
|
sys.exit(exitcodes.UNKNOWN_ERROR)
|
||||||
|
|
||||||
return aconf
|
return aconf
|
||||||
@@ -1499,7 +1504,7 @@ def run_gex_granular_modulus_size_test(out: OutputBuffer, s: 'SSH_Socket', kex:
|
|||||||
|
|
||||||
def main() -> int:
|
def main() -> int:
|
||||||
out = OutputBuffer()
|
out = OutputBuffer()
|
||||||
aconf = process_commandline(out, sys.argv[1:], usage)
|
aconf = process_commandline(out, sys.argv[1:])
|
||||||
|
|
||||||
# If we're on Windows, but the colorama module could not be imported, print a warning if we're in verbose mode.
|
# If we're on Windows, but the colorama module could not be imported, print a warning if we're in verbose mode.
|
||||||
if (sys.platform == 'win32') and ('colorama' not in sys.modules):
|
if (sys.platform == 'win32') and ('colorama' not in sys.modules):
|
||||||
|
|||||||
@@ -129,7 +129,7 @@ class Utils:
|
|||||||
return -1.0
|
return -1.0
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def parse_host_and_port(host_and_port: str, default_port: int = 0) -> Tuple[str, int]:
|
def parse_host_and_port(host_and_port: str, default_port: int = 22) -> Tuple[str, int]:
|
||||||
'''Parses a string into a tuple of its host and port. The port is 0 if not specified.'''
|
'''Parses a string into a tuple of its host and port. The port is 0 if not specified.'''
|
||||||
host = host_and_port
|
host = host_and_port
|
||||||
port = default_port
|
port = default_port
|
||||||
|
|||||||
@@ -116,6 +116,9 @@
|
|||||||
"info": [
|
"info": [
|
||||||
"default key exchange from OpenSSH 7.4 to 8.9",
|
"default key exchange from OpenSSH 7.4 to 8.9",
|
||||||
"available since OpenSSH 7.4, Dropbear SSH 2018.76"
|
"available since OpenSSH 7.4, Dropbear SSH 2018.76"
|
||||||
|
],
|
||||||
|
"warn": [
|
||||||
|
"does not provide protection against post-quantum attacks"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -125,6 +128,9 @@
|
|||||||
"info": [
|
"info": [
|
||||||
"default key exchange from OpenSSH 6.5 to 7.3",
|
"default key exchange from OpenSSH 6.5 to 7.3",
|
||||||
"available since OpenSSH 6.4, Dropbear SSH 2013.62"
|
"available since OpenSSH 6.4, Dropbear SSH 2013.62"
|
||||||
|
],
|
||||||
|
"warn": [
|
||||||
|
"does not provide protection against post-quantum attacks"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -136,6 +142,9 @@
|
|||||||
],
|
],
|
||||||
"info": [
|
"info": [
|
||||||
"available since OpenSSH 5.7, Dropbear SSH 2013.62"
|
"available since OpenSSH 5.7, Dropbear SSH 2013.62"
|
||||||
|
],
|
||||||
|
"warn": [
|
||||||
|
"does not provide protection against post-quantum attacks"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -147,6 +156,9 @@
|
|||||||
],
|
],
|
||||||
"info": [
|
"info": [
|
||||||
"available since OpenSSH 5.7, Dropbear SSH 2013.62"
|
"available since OpenSSH 5.7, Dropbear SSH 2013.62"
|
||||||
|
],
|
||||||
|
"warn": [
|
||||||
|
"does not provide protection against post-quantum attacks"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -158,6 +170,9 @@
|
|||||||
],
|
],
|
||||||
"info": [
|
"info": [
|
||||||
"available since OpenSSH 5.7, Dropbear SSH 2013.62"
|
"available since OpenSSH 5.7, Dropbear SSH 2013.62"
|
||||||
|
],
|
||||||
|
"warn": [
|
||||||
|
"does not provide protection against post-quantum attacks"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -168,7 +183,8 @@
|
|||||||
"available since OpenSSH 7.3, Dropbear SSH 2016.73"
|
"available since OpenSSH 7.3, Dropbear SSH 2016.73"
|
||||||
],
|
],
|
||||||
"warn": [
|
"warn": [
|
||||||
"2048-bit modulus only provides 112-bits of symmetric strength"
|
"2048-bit modulus only provides 112-bits of symmetric strength",
|
||||||
|
"does not provide protection against post-quantum attacks"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -182,7 +198,8 @@
|
|||||||
"available since OpenSSH 3.9, Dropbear SSH 0.53"
|
"available since OpenSSH 3.9, Dropbear SSH 0.53"
|
||||||
],
|
],
|
||||||
"warn": [
|
"warn": [
|
||||||
"2048-bit modulus only provides 112-bits of symmetric strength"
|
"2048-bit modulus only provides 112-bits of symmetric strength",
|
||||||
|
"does not provide protection against post-quantum attacks"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -191,6 +208,9 @@
|
|||||||
"notes": {
|
"notes": {
|
||||||
"info": [
|
"info": [
|
||||||
"available since Dropbear SSH 2013.57"
|
"available since Dropbear SSH 2013.57"
|
||||||
|
],
|
||||||
|
"warn": [
|
||||||
|
"does not provide protection against post-quantum attacks"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -349,12 +369,6 @@
|
|||||||
"name": "twofish256-ctr",
|
"name": "twofish256-ctr",
|
||||||
"notes": ""
|
"notes": ""
|
||||||
}
|
}
|
||||||
],
|
|
||||||
"kex": [
|
|
||||||
{
|
|
||||||
"name": "diffie-hellman-group16-sha512",
|
|
||||||
"notes": ""
|
|
||||||
}
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -371,9 +385,21 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"kex": [
|
"kex": [
|
||||||
|
{
|
||||||
|
"name": "curve25519-sha256",
|
||||||
|
"notes": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "curve25519-sha256@libssh.org",
|
||||||
|
"notes": ""
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "diffie-hellman-group14-sha256",
|
"name": "diffie-hellman-group14-sha256",
|
||||||
"notes": ""
|
"notes": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "kexguess2@matt.ucc.asn.au",
|
||||||
|
"notes": ""
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"mac": [
|
"mac": [
|
||||||
|
|||||||
@@ -5,22 +5,30 @@
|
|||||||
[0;32m(gen) compression: enabled (zlib@openssh.com)[0m
|
[0;32m(gen) compression: enabled (zlib@openssh.com)[0m
|
||||||
|
|
||||||
[0;36m# key exchange algorithms[0m
|
[0;36m# key exchange algorithms[0m
|
||||||
[0;32m(kex) curve25519-sha256 -- [info] available since OpenSSH 7.4, Dropbear SSH 2018.76[0m
|
[0;33m(kex) curve25519-sha256 -- [warn] does not provide protection against post-quantum attacks[0m
|
||||||
[0;32m `- [info] default key exchange from OpenSSH 7.4 to 8.9[0m
|
`- [info] available since OpenSSH 7.4, Dropbear SSH 2018.76
|
||||||
[0;32m(kex) curve25519-sha256@libssh.org -- [info] available since OpenSSH 6.4, Dropbear SSH 2013.62[0m
|
`- [info] default key exchange from OpenSSH 7.4 to 8.9
|
||||||
[0;32m `- [info] default key exchange from OpenSSH 6.5 to 7.3[0m
|
[0;33m(kex) curve25519-sha256@libssh.org -- [warn] does not provide protection against post-quantum attacks[0m
|
||||||
|
`- [info] available since OpenSSH 6.4, Dropbear SSH 2013.62
|
||||||
|
`- [info] default key exchange from OpenSSH 6.5 to 7.3
|
||||||
[0;31m(kex) ecdh-sha2-nistp521 -- [fail] using elliptic curves that are suspected as being backdoored by the U.S. National Security Agency[0m
|
[0;31m(kex) ecdh-sha2-nistp521 -- [fail] using elliptic curves that are suspected as being backdoored by the U.S. National Security Agency[0m
|
||||||
|
[0;33m `- [warn] does not provide protection against post-quantum attacks[0m
|
||||||
`- [info] available since OpenSSH 5.7, Dropbear SSH 2013.62
|
`- [info] available since OpenSSH 5.7, Dropbear SSH 2013.62
|
||||||
[0;31m(kex) ecdh-sha2-nistp384 -- [fail] using elliptic curves that are suspected as being backdoored by the U.S. National Security Agency[0m
|
[0;31m(kex) ecdh-sha2-nistp384 -- [fail] using elliptic curves that are suspected as being backdoored by the U.S. National Security Agency[0m
|
||||||
|
[0;33m `- [warn] does not provide protection against post-quantum attacks[0m
|
||||||
`- [info] available since OpenSSH 5.7, Dropbear SSH 2013.62
|
`- [info] available since OpenSSH 5.7, Dropbear SSH 2013.62
|
||||||
[0;31m(kex) ecdh-sha2-nistp256 -- [fail] using elliptic curves that are suspected as being backdoored by the U.S. National Security Agency[0m
|
[0;31m(kex) ecdh-sha2-nistp256 -- [fail] using elliptic curves that are suspected as being backdoored by the U.S. National Security Agency[0m
|
||||||
|
[0;33m `- [warn] does not provide protection against post-quantum attacks[0m
|
||||||
`- [info] available since OpenSSH 5.7, Dropbear SSH 2013.62
|
`- [info] available since OpenSSH 5.7, Dropbear SSH 2013.62
|
||||||
[0;33m(kex) diffie-hellman-group14-sha256 -- [warn] 2048-bit modulus only provides 112-bits of symmetric strength[0m
|
[0;33m(kex) diffie-hellman-group14-sha256 -- [warn] 2048-bit modulus only provides 112-bits of symmetric strength[0m
|
||||||
|
[0;33m `- [warn] does not provide protection against post-quantum attacks[0m
|
||||||
`- [info] available since OpenSSH 7.3, Dropbear SSH 2016.73
|
`- [info] available since OpenSSH 7.3, Dropbear SSH 2016.73
|
||||||
[0;31m(kex) diffie-hellman-group14-sha1 -- [fail] using broken SHA-1 hash algorithm[0m
|
[0;31m(kex) diffie-hellman-group14-sha1 -- [fail] using broken SHA-1 hash algorithm[0m
|
||||||
[0;33m `- [warn] 2048-bit modulus only provides 112-bits of symmetric strength[0m
|
[0;33m `- [warn] 2048-bit modulus only provides 112-bits of symmetric strength[0m
|
||||||
|
[0;33m `- [warn] does not provide protection against post-quantum attacks[0m
|
||||||
`- [info] available since OpenSSH 3.9, Dropbear SSH 0.53
|
`- [info] available since OpenSSH 3.9, Dropbear SSH 0.53
|
||||||
[0;32m(kex) kexguess2@matt.ucc.asn.au -- [info] available since Dropbear SSH 2013.57[0m
|
[0;33m(kex) kexguess2@matt.ucc.asn.au -- [warn] does not provide protection against post-quantum attacks[0m
|
||||||
|
`- [info] available since Dropbear SSH 2013.57
|
||||||
|
|
||||||
[0;36m# host-key algorithms[0m
|
[0;36m# host-key algorithms[0m
|
||||||
[0;31m(key) ecdsa-sha2-nistp256 -- [fail] using elliptic curves that are suspected as being backdoored by the U.S. National Security Agency[0m
|
[0;31m(key) ecdsa-sha2-nistp256 -- [fail] using elliptic curves that are suspected as being backdoored by the U.S. National Security Agency[0m
|
||||||
@@ -74,13 +82,15 @@
|
|||||||
[0;31m(rec) -hmac-sha1-96 -- mac algorithm to remove [0m
|
[0;31m(rec) -hmac-sha1-96 -- mac algorithm to remove [0m
|
||||||
[0;31m(rec) -ssh-dss -- key algorithm to remove [0m
|
[0;31m(rec) -ssh-dss -- key algorithm to remove [0m
|
||||||
[0;31m(rec) -ssh-rsa -- key algorithm to remove [0m
|
[0;31m(rec) -ssh-rsa -- key algorithm to remove [0m
|
||||||
[0;32m(rec) +diffie-hellman-group16-sha512 -- kex algorithm to append [0m
|
|
||||||
[0;32m(rec) +twofish128-ctr -- enc algorithm to append [0m
|
[0;32m(rec) +twofish128-ctr -- enc algorithm to append [0m
|
||||||
[0;32m(rec) +twofish256-ctr -- enc algorithm to append [0m
|
[0;32m(rec) +twofish256-ctr -- enc algorithm to append [0m
|
||||||
[0;33m(rec) -aes128-cbc -- enc algorithm to remove [0m
|
[0;33m(rec) -aes128-cbc -- enc algorithm to remove [0m
|
||||||
[0;33m(rec) -aes256-cbc -- enc algorithm to remove [0m
|
[0;33m(rec) -aes256-cbc -- enc algorithm to remove [0m
|
||||||
|
[0;33m(rec) -curve25519-sha256 -- kex algorithm to remove [0m
|
||||||
|
[0;33m(rec) -curve25519-sha256@libssh.org -- kex algorithm to remove [0m
|
||||||
[0;33m(rec) -diffie-hellman-group14-sha256 -- kex algorithm to remove [0m
|
[0;33m(rec) -diffie-hellman-group14-sha256 -- kex algorithm to remove [0m
|
||||||
[0;33m(rec) -hmac-sha2-256 -- mac algorithm to remove [0m
|
[0;33m(rec) -hmac-sha2-256 -- mac algorithm to remove [0m
|
||||||
|
[0;33m(rec) -kexguess2@matt.ucc.asn.au -- kex algorithm to remove [0m
|
||||||
|
|
||||||
[0;36m# additional info[0m
|
[0;36m# additional info[0m
|
||||||
[0;33m(nfo) For hardening guides on common OSes, please see: <https://www.ssh-audit.com/hardening_guides.html>[0m
|
[0;33m(nfo) For hardening guides on common OSes, please see: <https://www.ssh-audit.com/hardening_guides.html>[0m
|
||||||
|
|||||||
@@ -173,6 +173,9 @@
|
|||||||
],
|
],
|
||||||
"info": [
|
"info": [
|
||||||
"available since OpenSSH 2.3.0"
|
"available since OpenSSH 2.3.0"
|
||||||
|
],
|
||||||
|
"warn": [
|
||||||
|
"does not provide protection against post-quantum attacks"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -186,7 +189,8 @@
|
|||||||
"available since OpenSSH 3.9, Dropbear SSH 0.53"
|
"available since OpenSSH 3.9, Dropbear SSH 0.53"
|
||||||
],
|
],
|
||||||
"warn": [
|
"warn": [
|
||||||
"2048-bit modulus only provides 112-bits of symmetric strength"
|
"2048-bit modulus only provides 112-bits of symmetric strength",
|
||||||
|
"does not provide protection against post-quantum attacks"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -201,6 +205,9 @@
|
|||||||
"info": [
|
"info": [
|
||||||
"removed in OpenSSH 6.9: https://www.openssh.com/txt/release-6.9",
|
"removed in OpenSSH 6.9: https://www.openssh.com/txt/release-6.9",
|
||||||
"available since OpenSSH 2.3.0, Dropbear SSH 0.28"
|
"available since OpenSSH 2.3.0, Dropbear SSH 0.28"
|
||||||
|
],
|
||||||
|
"warn": [
|
||||||
|
"does not provide protection against post-quantum attacks"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,13 +10,16 @@
|
|||||||
|
|
||||||
[0;36m# key exchange algorithms[0m
|
[0;36m# key exchange algorithms[0m
|
||||||
[0;31m(kex) diffie-hellman-group-exchange-sha1 (1024-bit) -- [fail] using small 1024-bit modulus[0m
|
[0;31m(kex) diffie-hellman-group-exchange-sha1 (1024-bit) -- [fail] using small 1024-bit modulus[0m
|
||||||
|
[0;33m `- [warn] does not provide protection against post-quantum attacks[0m
|
||||||
`- [info] available since OpenSSH 2.3.0
|
`- [info] available since OpenSSH 2.3.0
|
||||||
[0;31m(kex) diffie-hellman-group14-sha1 -- [fail] using broken SHA-1 hash algorithm[0m
|
[0;31m(kex) diffie-hellman-group14-sha1 -- [fail] using broken SHA-1 hash algorithm[0m
|
||||||
[0;33m `- [warn] 2048-bit modulus only provides 112-bits of symmetric strength[0m
|
[0;33m `- [warn] 2048-bit modulus only provides 112-bits of symmetric strength[0m
|
||||||
|
[0;33m `- [warn] does not provide protection against post-quantum attacks[0m
|
||||||
`- [info] available since OpenSSH 3.9, Dropbear SSH 0.53
|
`- [info] available since OpenSSH 3.9, Dropbear SSH 0.53
|
||||||
[0;31m(kex) diffie-hellman-group1-sha1 -- [fail] using small 1024-bit modulus[0m
|
[0;31m(kex) diffie-hellman-group1-sha1 -- [fail] using small 1024-bit modulus[0m
|
||||||
[0;31m `- [fail] vulnerable to the Logjam attack: https://en.wikipedia.org/wiki/Logjam_(computer_security)[0m
|
[0;31m `- [fail] vulnerable to the Logjam attack: https://en.wikipedia.org/wiki/Logjam_(computer_security)[0m
|
||||||
[0;31m `- [fail] using broken SHA-1 hash algorithm[0m
|
[0;31m `- [fail] using broken SHA-1 hash algorithm[0m
|
||||||
|
[0;33m `- [warn] does not provide protection against post-quantum attacks[0m
|
||||||
`- [info] available since OpenSSH 2.3.0, Dropbear SSH 0.28
|
`- [info] available since OpenSSH 2.3.0, Dropbear SSH 0.28
|
||||||
`- [info] removed in OpenSSH 6.9: https://www.openssh.com/txt/release-6.9
|
`- [info] removed in OpenSSH 6.9: https://www.openssh.com/txt/release-6.9
|
||||||
|
|
||||||
|
|||||||
@@ -195,6 +195,9 @@
|
|||||||
],
|
],
|
||||||
"info": [
|
"info": [
|
||||||
"available since OpenSSH 4.4"
|
"available since OpenSSH 4.4"
|
||||||
|
],
|
||||||
|
"warn": [
|
||||||
|
"does not provide protection against post-quantum attacks"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -207,6 +210,9 @@
|
|||||||
],
|
],
|
||||||
"info": [
|
"info": [
|
||||||
"available since OpenSSH 2.3.0"
|
"available since OpenSSH 2.3.0"
|
||||||
|
],
|
||||||
|
"warn": [
|
||||||
|
"does not provide protection against post-quantum attacks"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -220,7 +226,8 @@
|
|||||||
"available since OpenSSH 3.9, Dropbear SSH 0.53"
|
"available since OpenSSH 3.9, Dropbear SSH 0.53"
|
||||||
],
|
],
|
||||||
"warn": [
|
"warn": [
|
||||||
"2048-bit modulus only provides 112-bits of symmetric strength"
|
"2048-bit modulus only provides 112-bits of symmetric strength",
|
||||||
|
"does not provide protection against post-quantum attacks"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -235,6 +242,9 @@
|
|||||||
"info": [
|
"info": [
|
||||||
"removed in OpenSSH 6.9: https://www.openssh.com/txt/release-6.9",
|
"removed in OpenSSH 6.9: https://www.openssh.com/txt/release-6.9",
|
||||||
"available since OpenSSH 2.3.0, Dropbear SSH 0.28"
|
"available since OpenSSH 2.3.0, Dropbear SSH 0.28"
|
||||||
|
],
|
||||||
|
"warn": [
|
||||||
|
"does not provide protection against post-quantum attacks"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,15 +6,19 @@
|
|||||||
|
|
||||||
[0;36m# key exchange algorithms[0m
|
[0;36m# key exchange algorithms[0m
|
||||||
[0;31m(kex) diffie-hellman-group-exchange-sha256 (1024-bit) -- [fail] using small 1024-bit modulus[0m
|
[0;31m(kex) diffie-hellman-group-exchange-sha256 (1024-bit) -- [fail] using small 1024-bit modulus[0m
|
||||||
|
[0;33m `- [warn] does not provide protection against post-quantum attacks[0m
|
||||||
`- [info] available since OpenSSH 4.4
|
`- [info] available since OpenSSH 4.4
|
||||||
[0;31m(kex) diffie-hellman-group-exchange-sha1 (1024-bit) -- [fail] using small 1024-bit modulus[0m
|
[0;31m(kex) diffie-hellman-group-exchange-sha1 (1024-bit) -- [fail] using small 1024-bit modulus[0m
|
||||||
|
[0;33m `- [warn] does not provide protection against post-quantum attacks[0m
|
||||||
`- [info] available since OpenSSH 2.3.0
|
`- [info] available since OpenSSH 2.3.0
|
||||||
[0;31m(kex) diffie-hellman-group14-sha1 -- [fail] using broken SHA-1 hash algorithm[0m
|
[0;31m(kex) diffie-hellman-group14-sha1 -- [fail] using broken SHA-1 hash algorithm[0m
|
||||||
[0;33m `- [warn] 2048-bit modulus only provides 112-bits of symmetric strength[0m
|
[0;33m `- [warn] 2048-bit modulus only provides 112-bits of symmetric strength[0m
|
||||||
|
[0;33m `- [warn] does not provide protection against post-quantum attacks[0m
|
||||||
`- [info] available since OpenSSH 3.9, Dropbear SSH 0.53
|
`- [info] available since OpenSSH 3.9, Dropbear SSH 0.53
|
||||||
[0;31m(kex) diffie-hellman-group1-sha1 -- [fail] using small 1024-bit modulus[0m
|
[0;31m(kex) diffie-hellman-group1-sha1 -- [fail] using small 1024-bit modulus[0m
|
||||||
[0;31m `- [fail] vulnerable to the Logjam attack: https://en.wikipedia.org/wiki/Logjam_(computer_security)[0m
|
[0;31m `- [fail] vulnerable to the Logjam attack: https://en.wikipedia.org/wiki/Logjam_(computer_security)[0m
|
||||||
[0;31m `- [fail] using broken SHA-1 hash algorithm[0m
|
[0;31m `- [fail] using broken SHA-1 hash algorithm[0m
|
||||||
|
[0;33m `- [warn] does not provide protection against post-quantum attacks[0m
|
||||||
`- [info] available since OpenSSH 2.3.0, Dropbear SSH 0.28
|
`- [info] available since OpenSSH 2.3.0, Dropbear SSH 0.28
|
||||||
`- [info] removed in OpenSSH 6.9: https://www.openssh.com/txt/release-6.9
|
`- [info] removed in OpenSSH 6.9: https://www.openssh.com/txt/release-6.9
|
||||||
|
|
||||||
|
|||||||
@@ -185,6 +185,9 @@
|
|||||||
],
|
],
|
||||||
"info": [
|
"info": [
|
||||||
"available since OpenSSH 4.4"
|
"available since OpenSSH 4.4"
|
||||||
|
],
|
||||||
|
"warn": [
|
||||||
|
"does not provide protection against post-quantum attacks"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -197,6 +200,9 @@
|
|||||||
],
|
],
|
||||||
"info": [
|
"info": [
|
||||||
"available since OpenSSH 2.3.0"
|
"available since OpenSSH 2.3.0"
|
||||||
|
],
|
||||||
|
"warn": [
|
||||||
|
"does not provide protection against post-quantum attacks"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -210,7 +216,8 @@
|
|||||||
"available since OpenSSH 3.9, Dropbear SSH 0.53"
|
"available since OpenSSH 3.9, Dropbear SSH 0.53"
|
||||||
],
|
],
|
||||||
"warn": [
|
"warn": [
|
||||||
"2048-bit modulus only provides 112-bits of symmetric strength"
|
"2048-bit modulus only provides 112-bits of symmetric strength",
|
||||||
|
"does not provide protection against post-quantum attacks"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -225,6 +232,9 @@
|
|||||||
"info": [
|
"info": [
|
||||||
"removed in OpenSSH 6.9: https://www.openssh.com/txt/release-6.9",
|
"removed in OpenSSH 6.9: https://www.openssh.com/txt/release-6.9",
|
||||||
"available since OpenSSH 2.3.0, Dropbear SSH 0.28"
|
"available since OpenSSH 2.3.0, Dropbear SSH 0.28"
|
||||||
|
],
|
||||||
|
"warn": [
|
||||||
|
"does not provide protection against post-quantum attacks"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,15 +6,19 @@
|
|||||||
|
|
||||||
[0;36m# key exchange algorithms[0m
|
[0;36m# key exchange algorithms[0m
|
||||||
[0;31m(kex) diffie-hellman-group-exchange-sha256 (1024-bit) -- [fail] using small 1024-bit modulus[0m
|
[0;31m(kex) diffie-hellman-group-exchange-sha256 (1024-bit) -- [fail] using small 1024-bit modulus[0m
|
||||||
|
[0;33m `- [warn] does not provide protection against post-quantum attacks[0m
|
||||||
`- [info] available since OpenSSH 4.4
|
`- [info] available since OpenSSH 4.4
|
||||||
[0;31m(kex) diffie-hellman-group-exchange-sha1 (1024-bit) -- [fail] using small 1024-bit modulus[0m
|
[0;31m(kex) diffie-hellman-group-exchange-sha1 (1024-bit) -- [fail] using small 1024-bit modulus[0m
|
||||||
|
[0;33m `- [warn] does not provide protection against post-quantum attacks[0m
|
||||||
`- [info] available since OpenSSH 2.3.0
|
`- [info] available since OpenSSH 2.3.0
|
||||||
[0;31m(kex) diffie-hellman-group14-sha1 -- [fail] using broken SHA-1 hash algorithm[0m
|
[0;31m(kex) diffie-hellman-group14-sha1 -- [fail] using broken SHA-1 hash algorithm[0m
|
||||||
[0;33m `- [warn] 2048-bit modulus only provides 112-bits of symmetric strength[0m
|
[0;33m `- [warn] 2048-bit modulus only provides 112-bits of symmetric strength[0m
|
||||||
|
[0;33m `- [warn] does not provide protection against post-quantum attacks[0m
|
||||||
`- [info] available since OpenSSH 3.9, Dropbear SSH 0.53
|
`- [info] available since OpenSSH 3.9, Dropbear SSH 0.53
|
||||||
[0;31m(kex) diffie-hellman-group1-sha1 -- [fail] using small 1024-bit modulus[0m
|
[0;31m(kex) diffie-hellman-group1-sha1 -- [fail] using small 1024-bit modulus[0m
|
||||||
[0;31m `- [fail] vulnerable to the Logjam attack: https://en.wikipedia.org/wiki/Logjam_(computer_security)[0m
|
[0;31m `- [fail] vulnerable to the Logjam attack: https://en.wikipedia.org/wiki/Logjam_(computer_security)[0m
|
||||||
[0;31m `- [fail] using broken SHA-1 hash algorithm[0m
|
[0;31m `- [fail] using broken SHA-1 hash algorithm[0m
|
||||||
|
[0;33m `- [warn] does not provide protection against post-quantum attacks[0m
|
||||||
`- [info] available since OpenSSH 2.3.0, Dropbear SSH 0.28
|
`- [info] available since OpenSSH 2.3.0, Dropbear SSH 0.28
|
||||||
`- [info] removed in OpenSSH 6.9: https://www.openssh.com/txt/release-6.9
|
`- [info] removed in OpenSSH 6.9: https://www.openssh.com/txt/release-6.9
|
||||||
|
|
||||||
|
|||||||
@@ -185,6 +185,9 @@
|
|||||||
],
|
],
|
||||||
"info": [
|
"info": [
|
||||||
"available since OpenSSH 4.4"
|
"available since OpenSSH 4.4"
|
||||||
|
],
|
||||||
|
"warn": [
|
||||||
|
"does not provide protection against post-quantum attacks"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -197,6 +200,9 @@
|
|||||||
],
|
],
|
||||||
"info": [
|
"info": [
|
||||||
"available since OpenSSH 2.3.0"
|
"available since OpenSSH 2.3.0"
|
||||||
|
],
|
||||||
|
"warn": [
|
||||||
|
"does not provide protection against post-quantum attacks"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -210,7 +216,8 @@
|
|||||||
"available since OpenSSH 3.9, Dropbear SSH 0.53"
|
"available since OpenSSH 3.9, Dropbear SSH 0.53"
|
||||||
],
|
],
|
||||||
"warn": [
|
"warn": [
|
||||||
"2048-bit modulus only provides 112-bits of symmetric strength"
|
"2048-bit modulus only provides 112-bits of symmetric strength",
|
||||||
|
"does not provide protection against post-quantum attacks"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -225,6 +232,9 @@
|
|||||||
"info": [
|
"info": [
|
||||||
"removed in OpenSSH 6.9: https://www.openssh.com/txt/release-6.9",
|
"removed in OpenSSH 6.9: https://www.openssh.com/txt/release-6.9",
|
||||||
"available since OpenSSH 2.3.0, Dropbear SSH 0.28"
|
"available since OpenSSH 2.3.0, Dropbear SSH 0.28"
|
||||||
|
],
|
||||||
|
"warn": [
|
||||||
|
"does not provide protection against post-quantum attacks"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,15 +6,19 @@
|
|||||||
|
|
||||||
[0;36m# key exchange algorithms[0m
|
[0;36m# key exchange algorithms[0m
|
||||||
[0;31m(kex) diffie-hellman-group-exchange-sha256 (1024-bit) -- [fail] using small 1024-bit modulus[0m
|
[0;31m(kex) diffie-hellman-group-exchange-sha256 (1024-bit) -- [fail] using small 1024-bit modulus[0m
|
||||||
|
[0;33m `- [warn] does not provide protection against post-quantum attacks[0m
|
||||||
`- [info] available since OpenSSH 4.4
|
`- [info] available since OpenSSH 4.4
|
||||||
[0;31m(kex) diffie-hellman-group-exchange-sha1 (1024-bit) -- [fail] using small 1024-bit modulus[0m
|
[0;31m(kex) diffie-hellman-group-exchange-sha1 (1024-bit) -- [fail] using small 1024-bit modulus[0m
|
||||||
|
[0;33m `- [warn] does not provide protection against post-quantum attacks[0m
|
||||||
`- [info] available since OpenSSH 2.3.0
|
`- [info] available since OpenSSH 2.3.0
|
||||||
[0;31m(kex) diffie-hellman-group14-sha1 -- [fail] using broken SHA-1 hash algorithm[0m
|
[0;31m(kex) diffie-hellman-group14-sha1 -- [fail] using broken SHA-1 hash algorithm[0m
|
||||||
[0;33m `- [warn] 2048-bit modulus only provides 112-bits of symmetric strength[0m
|
[0;33m `- [warn] 2048-bit modulus only provides 112-bits of symmetric strength[0m
|
||||||
|
[0;33m `- [warn] does not provide protection against post-quantum attacks[0m
|
||||||
`- [info] available since OpenSSH 3.9, Dropbear SSH 0.53
|
`- [info] available since OpenSSH 3.9, Dropbear SSH 0.53
|
||||||
[0;31m(kex) diffie-hellman-group1-sha1 -- [fail] using small 1024-bit modulus[0m
|
[0;31m(kex) diffie-hellman-group1-sha1 -- [fail] using small 1024-bit modulus[0m
|
||||||
[0;31m `- [fail] vulnerable to the Logjam attack: https://en.wikipedia.org/wiki/Logjam_(computer_security)[0m
|
[0;31m `- [fail] vulnerable to the Logjam attack: https://en.wikipedia.org/wiki/Logjam_(computer_security)[0m
|
||||||
[0;31m `- [fail] using broken SHA-1 hash algorithm[0m
|
[0;31m `- [fail] using broken SHA-1 hash algorithm[0m
|
||||||
|
[0;33m `- [warn] does not provide protection against post-quantum attacks[0m
|
||||||
`- [info] available since OpenSSH 2.3.0, Dropbear SSH 0.28
|
`- [info] available since OpenSSH 2.3.0, Dropbear SSH 0.28
|
||||||
`- [info] removed in OpenSSH 6.9: https://www.openssh.com/txt/release-6.9
|
`- [info] removed in OpenSSH 6.9: https://www.openssh.com/txt/release-6.9
|
||||||
|
|
||||||
|
|||||||
@@ -185,6 +185,9 @@
|
|||||||
],
|
],
|
||||||
"info": [
|
"info": [
|
||||||
"available since OpenSSH 4.4"
|
"available since OpenSSH 4.4"
|
||||||
|
],
|
||||||
|
"warn": [
|
||||||
|
"does not provide protection against post-quantum attacks"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -197,6 +200,9 @@
|
|||||||
],
|
],
|
||||||
"info": [
|
"info": [
|
||||||
"available since OpenSSH 2.3.0"
|
"available since OpenSSH 2.3.0"
|
||||||
|
],
|
||||||
|
"warn": [
|
||||||
|
"does not provide protection against post-quantum attacks"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -210,7 +216,8 @@
|
|||||||
"available since OpenSSH 3.9, Dropbear SSH 0.53"
|
"available since OpenSSH 3.9, Dropbear SSH 0.53"
|
||||||
],
|
],
|
||||||
"warn": [
|
"warn": [
|
||||||
"2048-bit modulus only provides 112-bits of symmetric strength"
|
"2048-bit modulus only provides 112-bits of symmetric strength",
|
||||||
|
"does not provide protection against post-quantum attacks"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -225,6 +232,9 @@
|
|||||||
"info": [
|
"info": [
|
||||||
"removed in OpenSSH 6.9: https://www.openssh.com/txt/release-6.9",
|
"removed in OpenSSH 6.9: https://www.openssh.com/txt/release-6.9",
|
||||||
"available since OpenSSH 2.3.0, Dropbear SSH 0.28"
|
"available since OpenSSH 2.3.0, Dropbear SSH 0.28"
|
||||||
|
],
|
||||||
|
"warn": [
|
||||||
|
"does not provide protection against post-quantum attacks"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,15 +6,19 @@
|
|||||||
|
|
||||||
[0;36m# key exchange algorithms[0m
|
[0;36m# key exchange algorithms[0m
|
||||||
[0;31m(kex) diffie-hellman-group-exchange-sha256 (1024-bit) -- [fail] using small 1024-bit modulus[0m
|
[0;31m(kex) diffie-hellman-group-exchange-sha256 (1024-bit) -- [fail] using small 1024-bit modulus[0m
|
||||||
|
[0;33m `- [warn] does not provide protection against post-quantum attacks[0m
|
||||||
`- [info] available since OpenSSH 4.4
|
`- [info] available since OpenSSH 4.4
|
||||||
[0;31m(kex) diffie-hellman-group-exchange-sha1 (1024-bit) -- [fail] using small 1024-bit modulus[0m
|
[0;31m(kex) diffie-hellman-group-exchange-sha1 (1024-bit) -- [fail] using small 1024-bit modulus[0m
|
||||||
|
[0;33m `- [warn] does not provide protection against post-quantum attacks[0m
|
||||||
`- [info] available since OpenSSH 2.3.0
|
`- [info] available since OpenSSH 2.3.0
|
||||||
[0;31m(kex) diffie-hellman-group14-sha1 -- [fail] using broken SHA-1 hash algorithm[0m
|
[0;31m(kex) diffie-hellman-group14-sha1 -- [fail] using broken SHA-1 hash algorithm[0m
|
||||||
[0;33m `- [warn] 2048-bit modulus only provides 112-bits of symmetric strength[0m
|
[0;33m `- [warn] 2048-bit modulus only provides 112-bits of symmetric strength[0m
|
||||||
|
[0;33m `- [warn] does not provide protection against post-quantum attacks[0m
|
||||||
`- [info] available since OpenSSH 3.9, Dropbear SSH 0.53
|
`- [info] available since OpenSSH 3.9, Dropbear SSH 0.53
|
||||||
[0;31m(kex) diffie-hellman-group1-sha1 -- [fail] using small 1024-bit modulus[0m
|
[0;31m(kex) diffie-hellman-group1-sha1 -- [fail] using small 1024-bit modulus[0m
|
||||||
[0;31m `- [fail] vulnerable to the Logjam attack: https://en.wikipedia.org/wiki/Logjam_(computer_security)[0m
|
[0;31m `- [fail] vulnerable to the Logjam attack: https://en.wikipedia.org/wiki/Logjam_(computer_security)[0m
|
||||||
[0;31m `- [fail] using broken SHA-1 hash algorithm[0m
|
[0;31m `- [fail] using broken SHA-1 hash algorithm[0m
|
||||||
|
[0;33m `- [warn] does not provide protection against post-quantum attacks[0m
|
||||||
`- [info] available since OpenSSH 2.3.0, Dropbear SSH 0.28
|
`- [info] available since OpenSSH 2.3.0, Dropbear SSH 0.28
|
||||||
`- [info] removed in OpenSSH 6.9: https://www.openssh.com/txt/release-6.9
|
`- [info] removed in OpenSSH 6.9: https://www.openssh.com/txt/release-6.9
|
||||||
|
|
||||||
|
|||||||
@@ -185,6 +185,9 @@
|
|||||||
],
|
],
|
||||||
"info": [
|
"info": [
|
||||||
"available since OpenSSH 4.4"
|
"available since OpenSSH 4.4"
|
||||||
|
],
|
||||||
|
"warn": [
|
||||||
|
"does not provide protection against post-quantum attacks"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -197,6 +200,9 @@
|
|||||||
],
|
],
|
||||||
"info": [
|
"info": [
|
||||||
"available since OpenSSH 2.3.0"
|
"available since OpenSSH 2.3.0"
|
||||||
|
],
|
||||||
|
"warn": [
|
||||||
|
"does not provide protection against post-quantum attacks"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -210,7 +216,8 @@
|
|||||||
"available since OpenSSH 3.9, Dropbear SSH 0.53"
|
"available since OpenSSH 3.9, Dropbear SSH 0.53"
|
||||||
],
|
],
|
||||||
"warn": [
|
"warn": [
|
||||||
"2048-bit modulus only provides 112-bits of symmetric strength"
|
"2048-bit modulus only provides 112-bits of symmetric strength",
|
||||||
|
"does not provide protection against post-quantum attacks"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -225,6 +232,9 @@
|
|||||||
"info": [
|
"info": [
|
||||||
"removed in OpenSSH 6.9: https://www.openssh.com/txt/release-6.9",
|
"removed in OpenSSH 6.9: https://www.openssh.com/txt/release-6.9",
|
||||||
"available since OpenSSH 2.3.0, Dropbear SSH 0.28"
|
"available since OpenSSH 2.3.0, Dropbear SSH 0.28"
|
||||||
|
],
|
||||||
|
"warn": [
|
||||||
|
"does not provide protection against post-quantum attacks"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,15 +6,19 @@
|
|||||||
|
|
||||||
[0;36m# key exchange algorithms[0m
|
[0;36m# key exchange algorithms[0m
|
||||||
[0;31m(kex) diffie-hellman-group-exchange-sha256 (1024-bit) -- [fail] using small 1024-bit modulus[0m
|
[0;31m(kex) diffie-hellman-group-exchange-sha256 (1024-bit) -- [fail] using small 1024-bit modulus[0m
|
||||||
|
[0;33m `- [warn] does not provide protection against post-quantum attacks[0m
|
||||||
`- [info] available since OpenSSH 4.4
|
`- [info] available since OpenSSH 4.4
|
||||||
[0;31m(kex) diffie-hellman-group-exchange-sha1 (1024-bit) -- [fail] using small 1024-bit modulus[0m
|
[0;31m(kex) diffie-hellman-group-exchange-sha1 (1024-bit) -- [fail] using small 1024-bit modulus[0m
|
||||||
|
[0;33m `- [warn] does not provide protection against post-quantum attacks[0m
|
||||||
`- [info] available since OpenSSH 2.3.0
|
`- [info] available since OpenSSH 2.3.0
|
||||||
[0;31m(kex) diffie-hellman-group14-sha1 -- [fail] using broken SHA-1 hash algorithm[0m
|
[0;31m(kex) diffie-hellman-group14-sha1 -- [fail] using broken SHA-1 hash algorithm[0m
|
||||||
[0;33m `- [warn] 2048-bit modulus only provides 112-bits of symmetric strength[0m
|
[0;33m `- [warn] 2048-bit modulus only provides 112-bits of symmetric strength[0m
|
||||||
|
[0;33m `- [warn] does not provide protection against post-quantum attacks[0m
|
||||||
`- [info] available since OpenSSH 3.9, Dropbear SSH 0.53
|
`- [info] available since OpenSSH 3.9, Dropbear SSH 0.53
|
||||||
[0;31m(kex) diffie-hellman-group1-sha1 -- [fail] using small 1024-bit modulus[0m
|
[0;31m(kex) diffie-hellman-group1-sha1 -- [fail] using small 1024-bit modulus[0m
|
||||||
[0;31m `- [fail] vulnerable to the Logjam attack: https://en.wikipedia.org/wiki/Logjam_(computer_security)[0m
|
[0;31m `- [fail] vulnerable to the Logjam attack: https://en.wikipedia.org/wiki/Logjam_(computer_security)[0m
|
||||||
[0;31m `- [fail] using broken SHA-1 hash algorithm[0m
|
[0;31m `- [fail] using broken SHA-1 hash algorithm[0m
|
||||||
|
[0;33m `- [warn] does not provide protection against post-quantum attacks[0m
|
||||||
`- [info] available since OpenSSH 2.3.0, Dropbear SSH 0.28
|
`- [info] available since OpenSSH 2.3.0, Dropbear SSH 0.28
|
||||||
`- [info] removed in OpenSSH 6.9: https://www.openssh.com/txt/release-6.9
|
`- [info] removed in OpenSSH 6.9: https://www.openssh.com/txt/release-6.9
|
||||||
|
|
||||||
|
|||||||
@@ -104,6 +104,9 @@
|
|||||||
"info": [
|
"info": [
|
||||||
"default key exchange from OpenSSH 7.4 to 8.9",
|
"default key exchange from OpenSSH 7.4 to 8.9",
|
||||||
"available since OpenSSH 7.4, Dropbear SSH 2018.76"
|
"available since OpenSSH 7.4, Dropbear SSH 2018.76"
|
||||||
|
],
|
||||||
|
"warn": [
|
||||||
|
"does not provide protection against post-quantum attacks"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -113,6 +116,9 @@
|
|||||||
"info": [
|
"info": [
|
||||||
"default key exchange from OpenSSH 6.5 to 7.3",
|
"default key exchange from OpenSSH 6.5 to 7.3",
|
||||||
"available since OpenSSH 6.4, Dropbear SSH 2013.62"
|
"available since OpenSSH 6.4, Dropbear SSH 2013.62"
|
||||||
|
],
|
||||||
|
"warn": [
|
||||||
|
"does not provide protection against post-quantum attacks"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -124,6 +130,9 @@
|
|||||||
],
|
],
|
||||||
"info": [
|
"info": [
|
||||||
"available since OpenSSH 5.7, Dropbear SSH 2013.62"
|
"available since OpenSSH 5.7, Dropbear SSH 2013.62"
|
||||||
|
],
|
||||||
|
"warn": [
|
||||||
|
"does not provide protection against post-quantum attacks"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -135,6 +144,9 @@
|
|||||||
],
|
],
|
||||||
"info": [
|
"info": [
|
||||||
"available since OpenSSH 5.7, Dropbear SSH 2013.62"
|
"available since OpenSSH 5.7, Dropbear SSH 2013.62"
|
||||||
|
],
|
||||||
|
"warn": [
|
||||||
|
"does not provide protection against post-quantum attacks"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -146,6 +158,9 @@
|
|||||||
],
|
],
|
||||||
"info": [
|
"info": [
|
||||||
"available since OpenSSH 5.7, Dropbear SSH 2013.62"
|
"available since OpenSSH 5.7, Dropbear SSH 2013.62"
|
||||||
|
],
|
||||||
|
"warn": [
|
||||||
|
"does not provide protection against post-quantum attacks"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -156,6 +171,9 @@
|
|||||||
"info": [
|
"info": [
|
||||||
"OpenSSH'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 4096. This can only be disabled by recompiling the code (see https://github.com/openssh/openssh-portable/blob/V_9_4/dh.c#L477).",
|
"OpenSSH'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 4096. This can only be disabled by recompiling the code (see https://github.com/openssh/openssh-portable/blob/V_9_4/dh.c#L477).",
|
||||||
"available since OpenSSH 4.4"
|
"available since OpenSSH 4.4"
|
||||||
|
],
|
||||||
|
"warn": [
|
||||||
|
"does not provide protection against post-quantum attacks"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -164,6 +182,9 @@
|
|||||||
"notes": {
|
"notes": {
|
||||||
"info": [
|
"info": [
|
||||||
"available since OpenSSH 7.3, Dropbear SSH 2016.73"
|
"available since OpenSSH 7.3, Dropbear SSH 2016.73"
|
||||||
|
],
|
||||||
|
"warn": [
|
||||||
|
"does not provide protection against post-quantum attacks"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -172,6 +193,9 @@
|
|||||||
"notes": {
|
"notes": {
|
||||||
"info": [
|
"info": [
|
||||||
"available since OpenSSH 7.3"
|
"available since OpenSSH 7.3"
|
||||||
|
],
|
||||||
|
"warn": [
|
||||||
|
"does not provide protection against post-quantum attacks"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -182,7 +206,8 @@
|
|||||||
"available since OpenSSH 7.3, Dropbear SSH 2016.73"
|
"available since OpenSSH 7.3, Dropbear SSH 2016.73"
|
||||||
],
|
],
|
||||||
"warn": [
|
"warn": [
|
||||||
"2048-bit modulus only provides 112-bits of symmetric strength"
|
"2048-bit modulus only provides 112-bits of symmetric strength",
|
||||||
|
"does not provide protection against post-quantum attacks"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -196,7 +221,8 @@
|
|||||||
"available since OpenSSH 3.9, Dropbear SSH 0.53"
|
"available since OpenSSH 3.9, Dropbear SSH 0.53"
|
||||||
],
|
],
|
||||||
"warn": [
|
"warn": [
|
||||||
"2048-bit modulus only provides 112-bits of symmetric strength"
|
"2048-bit modulus only provides 112-bits of symmetric strength",
|
||||||
|
"does not provide protection against post-quantum attacks"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -407,6 +433,14 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"warning": {
|
"warning": {
|
||||||
|
"chg": {
|
||||||
|
"kex": [
|
||||||
|
{
|
||||||
|
"name": "diffie-hellman-group-exchange-sha256",
|
||||||
|
"notes": "increase modulus size to 3072 bits or larger"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
"del": {
|
"del": {
|
||||||
"enc": [
|
"enc": [
|
||||||
{
|
{
|
||||||
@@ -415,9 +449,25 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"kex": [
|
"kex": [
|
||||||
|
{
|
||||||
|
"name": "curve25519-sha256",
|
||||||
|
"notes": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "curve25519-sha256@libssh.org",
|
||||||
|
"notes": ""
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "diffie-hellman-group14-sha256",
|
"name": "diffie-hellman-group14-sha256",
|
||||||
"notes": ""
|
"notes": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "diffie-hellman-group16-sha512",
|
||||||
|
"notes": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "diffie-hellman-group18-sha512",
|
||||||
|
"notes": ""
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"mac": [
|
"mac": [
|
||||||
|
|||||||
@@ -5,24 +5,34 @@
|
|||||||
[0;32m(gen) compression: enabled (zlib@openssh.com)[0m
|
[0;32m(gen) compression: enabled (zlib@openssh.com)[0m
|
||||||
|
|
||||||
[0;36m# key exchange algorithms[0m
|
[0;36m# key exchange algorithms[0m
|
||||||
[0;32m(kex) curve25519-sha256 -- [info] available since OpenSSH 7.4, Dropbear SSH 2018.76[0m
|
[0;33m(kex) curve25519-sha256 -- [warn] does not provide protection against post-quantum attacks[0m
|
||||||
[0;32m `- [info] default key exchange from OpenSSH 7.4 to 8.9[0m
|
`- [info] available since OpenSSH 7.4, Dropbear SSH 2018.76
|
||||||
[0;32m(kex) curve25519-sha256@libssh.org -- [info] available since OpenSSH 6.4, Dropbear SSH 2013.62[0m
|
`- [info] default key exchange from OpenSSH 7.4 to 8.9
|
||||||
[0;32m `- [info] default key exchange from OpenSSH 6.5 to 7.3[0m
|
[0;33m(kex) curve25519-sha256@libssh.org -- [warn] does not provide protection against post-quantum attacks[0m
|
||||||
|
`- [info] available since OpenSSH 6.4, Dropbear SSH 2013.62
|
||||||
|
`- [info] default key exchange from OpenSSH 6.5 to 7.3
|
||||||
[0;31m(kex) ecdh-sha2-nistp256 -- [fail] using elliptic curves that are suspected as being backdoored by the U.S. National Security Agency[0m
|
[0;31m(kex) ecdh-sha2-nistp256 -- [fail] using elliptic curves that are suspected as being backdoored by the U.S. National Security Agency[0m
|
||||||
|
[0;33m `- [warn] does not provide protection against post-quantum attacks[0m
|
||||||
`- [info] available since OpenSSH 5.7, Dropbear SSH 2013.62
|
`- [info] available since OpenSSH 5.7, Dropbear SSH 2013.62
|
||||||
[0;31m(kex) ecdh-sha2-nistp384 -- [fail] using elliptic curves that are suspected as being backdoored by the U.S. National Security Agency[0m
|
[0;31m(kex) ecdh-sha2-nistp384 -- [fail] using elliptic curves that are suspected as being backdoored by the U.S. National Security Agency[0m
|
||||||
|
[0;33m `- [warn] does not provide protection against post-quantum attacks[0m
|
||||||
`- [info] available since OpenSSH 5.7, Dropbear SSH 2013.62
|
`- [info] available since OpenSSH 5.7, Dropbear SSH 2013.62
|
||||||
[0;31m(kex) ecdh-sha2-nistp521 -- [fail] using elliptic curves that are suspected as being backdoored by the U.S. National Security Agency[0m
|
[0;31m(kex) ecdh-sha2-nistp521 -- [fail] using elliptic curves that are suspected as being backdoored by the U.S. National Security Agency[0m
|
||||||
|
[0;33m `- [warn] does not provide protection against post-quantum attacks[0m
|
||||||
`- [info] available since OpenSSH 5.7, Dropbear SSH 2013.62
|
`- [info] available since OpenSSH 5.7, Dropbear SSH 2013.62
|
||||||
[0;32m(kex) diffie-hellman-group-exchange-sha256 (4096-bit) -- [info] available since OpenSSH 4.4[0m
|
[0;33m(kex) diffie-hellman-group-exchange-sha256 (4096-bit) -- [warn] does not provide protection against post-quantum attacks[0m
|
||||||
[0;32m `- [info] OpenSSH'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 4096. This can only be disabled by recompiling the code (see https://github.com/openssh/openssh-portable/blob/V_9_4/dh.c#L477).[0m
|
`- [info] available since OpenSSH 4.4
|
||||||
[0;32m(kex) diffie-hellman-group16-sha512 -- [info] available since OpenSSH 7.3, Dropbear SSH 2016.73[0m
|
`- [info] OpenSSH'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 4096. This can only be disabled by recompiling the code (see https://github.com/openssh/openssh-portable/blob/V_9_4/dh.c#L477).
|
||||||
[0;32m(kex) diffie-hellman-group18-sha512 -- [info] available since OpenSSH 7.3[0m
|
[0;33m(kex) diffie-hellman-group16-sha512 -- [warn] does not provide protection against post-quantum attacks[0m
|
||||||
|
`- [info] available since OpenSSH 7.3, Dropbear SSH 2016.73
|
||||||
|
[0;33m(kex) diffie-hellman-group18-sha512 -- [warn] does not provide protection against post-quantum attacks[0m
|
||||||
|
`- [info] available since OpenSSH 7.3
|
||||||
[0;33m(kex) diffie-hellman-group14-sha256 -- [warn] 2048-bit modulus only provides 112-bits of symmetric strength[0m
|
[0;33m(kex) diffie-hellman-group14-sha256 -- [warn] 2048-bit modulus only provides 112-bits of symmetric strength[0m
|
||||||
|
[0;33m `- [warn] does not provide protection against post-quantum attacks[0m
|
||||||
`- [info] available since OpenSSH 7.3, Dropbear SSH 2016.73
|
`- [info] available since OpenSSH 7.3, Dropbear SSH 2016.73
|
||||||
[0;31m(kex) diffie-hellman-group14-sha1 -- [fail] using broken SHA-1 hash algorithm[0m
|
[0;31m(kex) diffie-hellman-group14-sha1 -- [fail] using broken SHA-1 hash algorithm[0m
|
||||||
[0;33m `- [warn] 2048-bit modulus only provides 112-bits of symmetric strength[0m
|
[0;33m `- [warn] 2048-bit modulus only provides 112-bits of symmetric strength[0m
|
||||||
|
[0;33m `- [warn] does not provide protection against post-quantum attacks[0m
|
||||||
`- [info] available since OpenSSH 3.9, Dropbear SSH 0.53
|
`- [info] available since OpenSSH 3.9, Dropbear SSH 0.53
|
||||||
|
|
||||||
[0;36m# host-key algorithms[0m
|
[0;36m# host-key algorithms[0m
|
||||||
@@ -80,8 +90,13 @@
|
|||||||
[0;31m(rec) -hmac-sha1 -- mac algorithm to remove [0m
|
[0;31m(rec) -hmac-sha1 -- mac algorithm to remove [0m
|
||||||
[0;31m(rec) -hmac-sha1-etm@openssh.com -- mac algorithm to remove [0m
|
[0;31m(rec) -hmac-sha1-etm@openssh.com -- mac algorithm to remove [0m
|
||||||
[0;31m(rec) -ssh-rsa -- key algorithm to remove [0m
|
[0;31m(rec) -ssh-rsa -- key algorithm to remove [0m
|
||||||
|
[0;33m(rec) !diffie-hellman-group-exchange-sha256 -- kex algorithm to change (increase modulus size to 3072 bits or larger) [0m
|
||||||
[0;33m(rec) -chacha20-poly1305@openssh.com -- enc algorithm to remove [0m
|
[0;33m(rec) -chacha20-poly1305@openssh.com -- enc algorithm to remove [0m
|
||||||
|
[0;33m(rec) -curve25519-sha256 -- kex algorithm to remove [0m
|
||||||
|
[0;33m(rec) -curve25519-sha256@libssh.org -- kex algorithm to remove [0m
|
||||||
[0;33m(rec) -diffie-hellman-group14-sha256 -- kex algorithm to remove [0m
|
[0;33m(rec) -diffie-hellman-group14-sha256 -- kex algorithm to remove [0m
|
||||||
|
[0;33m(rec) -diffie-hellman-group16-sha512 -- kex algorithm to remove [0m
|
||||||
|
[0;33m(rec) -diffie-hellman-group18-sha512 -- kex algorithm to remove [0m
|
||||||
[0;33m(rec) -hmac-sha2-256 -- mac algorithm to remove [0m
|
[0;33m(rec) -hmac-sha2-256 -- mac algorithm to remove [0m
|
||||||
[0;33m(rec) -hmac-sha2-512 -- mac algorithm to remove [0m
|
[0;33m(rec) -hmac-sha2-512 -- mac algorithm to remove [0m
|
||||||
[0;33m(rec) -umac-128@openssh.com -- mac algorithm to remove [0m
|
[0;33m(rec) -umac-128@openssh.com -- mac algorithm to remove [0m
|
||||||
|
|||||||
@@ -84,6 +84,9 @@
|
|||||||
"info": [
|
"info": [
|
||||||
"default key exchange from OpenSSH 7.4 to 8.9",
|
"default key exchange from OpenSSH 7.4 to 8.9",
|
||||||
"available since OpenSSH 7.4, Dropbear SSH 2018.76"
|
"available since OpenSSH 7.4, Dropbear SSH 2018.76"
|
||||||
|
],
|
||||||
|
"warn": [
|
||||||
|
"does not provide protection against post-quantum attacks"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -93,6 +96,9 @@
|
|||||||
"info": [
|
"info": [
|
||||||
"default key exchange from OpenSSH 6.5 to 7.3",
|
"default key exchange from OpenSSH 6.5 to 7.3",
|
||||||
"available since OpenSSH 6.4, Dropbear SSH 2013.62"
|
"available since OpenSSH 6.4, Dropbear SSH 2013.62"
|
||||||
|
],
|
||||||
|
"warn": [
|
||||||
|
"does not provide protection against post-quantum attacks"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -104,6 +110,9 @@
|
|||||||
],
|
],
|
||||||
"info": [
|
"info": [
|
||||||
"available since OpenSSH 5.7, Dropbear SSH 2013.62"
|
"available since OpenSSH 5.7, Dropbear SSH 2013.62"
|
||||||
|
],
|
||||||
|
"warn": [
|
||||||
|
"does not provide protection against post-quantum attacks"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -115,6 +124,9 @@
|
|||||||
],
|
],
|
||||||
"info": [
|
"info": [
|
||||||
"available since OpenSSH 5.7, Dropbear SSH 2013.62"
|
"available since OpenSSH 5.7, Dropbear SSH 2013.62"
|
||||||
|
],
|
||||||
|
"warn": [
|
||||||
|
"does not provide protection against post-quantum attacks"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -126,6 +138,9 @@
|
|||||||
],
|
],
|
||||||
"info": [
|
"info": [
|
||||||
"available since OpenSSH 5.7, Dropbear SSH 2013.62"
|
"available since OpenSSH 5.7, Dropbear SSH 2013.62"
|
||||||
|
],
|
||||||
|
"warn": [
|
||||||
|
"does not provide protection against post-quantum attacks"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -136,6 +151,9 @@
|
|||||||
"info": [
|
"info": [
|
||||||
"OpenSSH'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 4096. This can only be disabled by recompiling the code (see https://github.com/openssh/openssh-portable/blob/V_9_4/dh.c#L477).",
|
"OpenSSH'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 4096. This can only be disabled by recompiling the code (see https://github.com/openssh/openssh-portable/blob/V_9_4/dh.c#L477).",
|
||||||
"available since OpenSSH 4.4"
|
"available since OpenSSH 4.4"
|
||||||
|
],
|
||||||
|
"warn": [
|
||||||
|
"does not provide protection against post-quantum attacks"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -144,6 +162,9 @@
|
|||||||
"notes": {
|
"notes": {
|
||||||
"info": [
|
"info": [
|
||||||
"available since OpenSSH 7.3, Dropbear SSH 2016.73"
|
"available since OpenSSH 7.3, Dropbear SSH 2016.73"
|
||||||
|
],
|
||||||
|
"warn": [
|
||||||
|
"does not provide protection against post-quantum attacks"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -152,6 +173,9 @@
|
|||||||
"notes": {
|
"notes": {
|
||||||
"info": [
|
"info": [
|
||||||
"available since OpenSSH 7.3"
|
"available since OpenSSH 7.3"
|
||||||
|
],
|
||||||
|
"warn": [
|
||||||
|
"does not provide protection against post-quantum attacks"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -162,7 +186,8 @@
|
|||||||
"available since OpenSSH 7.3, Dropbear SSH 2016.73"
|
"available since OpenSSH 7.3, Dropbear SSH 2016.73"
|
||||||
],
|
],
|
||||||
"warn": [
|
"warn": [
|
||||||
"2048-bit modulus only provides 112-bits of symmetric strength"
|
"2048-bit modulus only provides 112-bits of symmetric strength",
|
||||||
|
"does not provide protection against post-quantum attacks"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -176,7 +201,8 @@
|
|||||||
"available since OpenSSH 3.9, Dropbear SSH 0.53"
|
"available since OpenSSH 3.9, Dropbear SSH 0.53"
|
||||||
],
|
],
|
||||||
"warn": [
|
"warn": [
|
||||||
"2048-bit modulus only provides 112-bits of symmetric strength"
|
"2048-bit modulus only provides 112-bits of symmetric strength",
|
||||||
|
"does not provide protection against post-quantum attacks"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -356,6 +382,14 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"warning": {
|
"warning": {
|
||||||
|
"chg": {
|
||||||
|
"kex": [
|
||||||
|
{
|
||||||
|
"name": "diffie-hellman-group-exchange-sha256",
|
||||||
|
"notes": "increase modulus size to 3072 bits or larger"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
"del": {
|
"del": {
|
||||||
"enc": [
|
"enc": [
|
||||||
{
|
{
|
||||||
@@ -364,9 +398,25 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"kex": [
|
"kex": [
|
||||||
|
{
|
||||||
|
"name": "curve25519-sha256",
|
||||||
|
"notes": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "curve25519-sha256@libssh.org",
|
||||||
|
"notes": ""
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "diffie-hellman-group14-sha256",
|
"name": "diffie-hellman-group14-sha256",
|
||||||
"notes": ""
|
"notes": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "diffie-hellman-group16-sha512",
|
||||||
|
"notes": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "diffie-hellman-group18-sha512",
|
||||||
|
"notes": ""
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"mac": [
|
"mac": [
|
||||||
|
|||||||
@@ -5,24 +5,34 @@
|
|||||||
[0;32m(gen) compression: enabled (zlib@openssh.com)[0m
|
[0;32m(gen) compression: enabled (zlib@openssh.com)[0m
|
||||||
|
|
||||||
[0;36m# key exchange algorithms[0m
|
[0;36m# key exchange algorithms[0m
|
||||||
[0;32m(kex) curve25519-sha256 -- [info] available since OpenSSH 7.4, Dropbear SSH 2018.76[0m
|
[0;33m(kex) curve25519-sha256 -- [warn] does not provide protection against post-quantum attacks[0m
|
||||||
[0;32m `- [info] default key exchange from OpenSSH 7.4 to 8.9[0m
|
`- [info] available since OpenSSH 7.4, Dropbear SSH 2018.76
|
||||||
[0;32m(kex) curve25519-sha256@libssh.org -- [info] available since OpenSSH 6.4, Dropbear SSH 2013.62[0m
|
`- [info] default key exchange from OpenSSH 7.4 to 8.9
|
||||||
[0;32m `- [info] default key exchange from OpenSSH 6.5 to 7.3[0m
|
[0;33m(kex) curve25519-sha256@libssh.org -- [warn] does not provide protection against post-quantum attacks[0m
|
||||||
|
`- [info] available since OpenSSH 6.4, Dropbear SSH 2013.62
|
||||||
|
`- [info] default key exchange from OpenSSH 6.5 to 7.3
|
||||||
[0;31m(kex) ecdh-sha2-nistp256 -- [fail] using elliptic curves that are suspected as being backdoored by the U.S. National Security Agency[0m
|
[0;31m(kex) ecdh-sha2-nistp256 -- [fail] using elliptic curves that are suspected as being backdoored by the U.S. National Security Agency[0m
|
||||||
|
[0;33m `- [warn] does not provide protection against post-quantum attacks[0m
|
||||||
`- [info] available since OpenSSH 5.7, Dropbear SSH 2013.62
|
`- [info] available since OpenSSH 5.7, Dropbear SSH 2013.62
|
||||||
[0;31m(kex) ecdh-sha2-nistp384 -- [fail] using elliptic curves that are suspected as being backdoored by the U.S. National Security Agency[0m
|
[0;31m(kex) ecdh-sha2-nistp384 -- [fail] using elliptic curves that are suspected as being backdoored by the U.S. National Security Agency[0m
|
||||||
|
[0;33m `- [warn] does not provide protection against post-quantum attacks[0m
|
||||||
`- [info] available since OpenSSH 5.7, Dropbear SSH 2013.62
|
`- [info] available since OpenSSH 5.7, Dropbear SSH 2013.62
|
||||||
[0;31m(kex) ecdh-sha2-nistp521 -- [fail] using elliptic curves that are suspected as being backdoored by the U.S. National Security Agency[0m
|
[0;31m(kex) ecdh-sha2-nistp521 -- [fail] using elliptic curves that are suspected as being backdoored by the U.S. National Security Agency[0m
|
||||||
|
[0;33m `- [warn] does not provide protection against post-quantum attacks[0m
|
||||||
`- [info] available since OpenSSH 5.7, Dropbear SSH 2013.62
|
`- [info] available since OpenSSH 5.7, Dropbear SSH 2013.62
|
||||||
[0;32m(kex) diffie-hellman-group-exchange-sha256 (4096-bit) -- [info] available since OpenSSH 4.4[0m
|
[0;33m(kex) diffie-hellman-group-exchange-sha256 (4096-bit) -- [warn] does not provide protection against post-quantum attacks[0m
|
||||||
[0;32m `- [info] OpenSSH'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 4096. This can only be disabled by recompiling the code (see https://github.com/openssh/openssh-portable/blob/V_9_4/dh.c#L477).[0m
|
`- [info] available since OpenSSH 4.4
|
||||||
[0;32m(kex) diffie-hellman-group16-sha512 -- [info] available since OpenSSH 7.3, Dropbear SSH 2016.73[0m
|
`- [info] OpenSSH'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 4096. This can only be disabled by recompiling the code (see https://github.com/openssh/openssh-portable/blob/V_9_4/dh.c#L477).
|
||||||
[0;32m(kex) diffie-hellman-group18-sha512 -- [info] available since OpenSSH 7.3[0m
|
[0;33m(kex) diffie-hellman-group16-sha512 -- [warn] does not provide protection against post-quantum attacks[0m
|
||||||
|
`- [info] available since OpenSSH 7.3, Dropbear SSH 2016.73
|
||||||
|
[0;33m(kex) diffie-hellman-group18-sha512 -- [warn] does not provide protection against post-quantum attacks[0m
|
||||||
|
`- [info] available since OpenSSH 7.3
|
||||||
[0;33m(kex) diffie-hellman-group14-sha256 -- [warn] 2048-bit modulus only provides 112-bits of symmetric strength[0m
|
[0;33m(kex) diffie-hellman-group14-sha256 -- [warn] 2048-bit modulus only provides 112-bits of symmetric strength[0m
|
||||||
|
[0;33m `- [warn] does not provide protection against post-quantum attacks[0m
|
||||||
`- [info] available since OpenSSH 7.3, Dropbear SSH 2016.73
|
`- [info] available since OpenSSH 7.3, Dropbear SSH 2016.73
|
||||||
[0;31m(kex) diffie-hellman-group14-sha1 -- [fail] using broken SHA-1 hash algorithm[0m
|
[0;31m(kex) diffie-hellman-group14-sha1 -- [fail] using broken SHA-1 hash algorithm[0m
|
||||||
[0;33m `- [warn] 2048-bit modulus only provides 112-bits of symmetric strength[0m
|
[0;33m `- [warn] 2048-bit modulus only provides 112-bits of symmetric strength[0m
|
||||||
|
[0;33m `- [warn] does not provide protection against post-quantum attacks[0m
|
||||||
`- [info] available since OpenSSH 3.9, Dropbear SSH 0.53
|
`- [info] available since OpenSSH 3.9, Dropbear SSH 0.53
|
||||||
|
|
||||||
[0;36m# host-key algorithms[0m
|
[0;36m# host-key algorithms[0m
|
||||||
@@ -72,8 +82,13 @@
|
|||||||
[0;31m(rec) -hmac-sha1-etm@openssh.com -- mac algorithm to remove [0m
|
[0;31m(rec) -hmac-sha1-etm@openssh.com -- mac algorithm to remove [0m
|
||||||
[0;32m(rec) +rsa-sha2-256 -- key algorithm to append [0m
|
[0;32m(rec) +rsa-sha2-256 -- key algorithm to append [0m
|
||||||
[0;32m(rec) +rsa-sha2-512 -- key algorithm to append [0m
|
[0;32m(rec) +rsa-sha2-512 -- key algorithm to append [0m
|
||||||
|
[0;33m(rec) !diffie-hellman-group-exchange-sha256 -- kex algorithm to change (increase modulus size to 3072 bits or larger) [0m
|
||||||
[0;33m(rec) -chacha20-poly1305@openssh.com -- enc algorithm to remove [0m
|
[0;33m(rec) -chacha20-poly1305@openssh.com -- enc algorithm to remove [0m
|
||||||
|
[0;33m(rec) -curve25519-sha256 -- kex algorithm to remove [0m
|
||||||
|
[0;33m(rec) -curve25519-sha256@libssh.org -- kex algorithm to remove [0m
|
||||||
[0;33m(rec) -diffie-hellman-group14-sha256 -- kex algorithm to remove [0m
|
[0;33m(rec) -diffie-hellman-group14-sha256 -- kex algorithm to remove [0m
|
||||||
|
[0;33m(rec) -diffie-hellman-group16-sha512 -- kex algorithm to remove [0m
|
||||||
|
[0;33m(rec) -diffie-hellman-group18-sha512 -- kex algorithm to remove [0m
|
||||||
[0;33m(rec) -hmac-sha2-256 -- mac algorithm to remove [0m
|
[0;33m(rec) -hmac-sha2-256 -- mac algorithm to remove [0m
|
||||||
[0;33m(rec) -hmac-sha2-512 -- mac algorithm to remove [0m
|
[0;33m(rec) -hmac-sha2-512 -- mac algorithm to remove [0m
|
||||||
[0;33m(rec) -umac-128@openssh.com -- mac algorithm to remove [0m
|
[0;33m(rec) -umac-128@openssh.com -- mac algorithm to remove [0m
|
||||||
|
|||||||
@@ -84,6 +84,9 @@
|
|||||||
"info": [
|
"info": [
|
||||||
"default key exchange from OpenSSH 7.4 to 8.9",
|
"default key exchange from OpenSSH 7.4 to 8.9",
|
||||||
"available since OpenSSH 7.4, Dropbear SSH 2018.76"
|
"available since OpenSSH 7.4, Dropbear SSH 2018.76"
|
||||||
|
],
|
||||||
|
"warn": [
|
||||||
|
"does not provide protection against post-quantum attacks"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -93,6 +96,9 @@
|
|||||||
"info": [
|
"info": [
|
||||||
"default key exchange from OpenSSH 6.5 to 7.3",
|
"default key exchange from OpenSSH 6.5 to 7.3",
|
||||||
"available since OpenSSH 6.4, Dropbear SSH 2013.62"
|
"available since OpenSSH 6.4, Dropbear SSH 2013.62"
|
||||||
|
],
|
||||||
|
"warn": [
|
||||||
|
"does not provide protection against post-quantum attacks"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -103,6 +109,9 @@
|
|||||||
"info": [
|
"info": [
|
||||||
"OpenSSH'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 4096. This can only be disabled by recompiling the code (see https://github.com/openssh/openssh-portable/blob/V_9_4/dh.c#L477).",
|
"OpenSSH'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 4096. This can only be disabled by recompiling the code (see https://github.com/openssh/openssh-portable/blob/V_9_4/dh.c#L477).",
|
||||||
"available since OpenSSH 4.4"
|
"available since OpenSSH 4.4"
|
||||||
|
],
|
||||||
|
"warn": [
|
||||||
|
"does not provide protection against post-quantum attacks"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -146,16 +155,6 @@
|
|||||||
"recommendations": {
|
"recommendations": {
|
||||||
"informational": {
|
"informational": {
|
||||||
"add": {
|
"add": {
|
||||||
"kex": [
|
|
||||||
{
|
|
||||||
"name": "diffie-hellman-group16-sha512",
|
|
||||||
"notes": ""
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "diffie-hellman-group18-sha512",
|
|
||||||
"notes": ""
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"key": [
|
"key": [
|
||||||
{
|
{
|
||||||
"name": "rsa-sha2-256",
|
"name": "rsa-sha2-256",
|
||||||
@@ -169,12 +168,30 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"warning": {
|
"warning": {
|
||||||
|
"chg": {
|
||||||
|
"kex": [
|
||||||
|
{
|
||||||
|
"name": "diffie-hellman-group-exchange-sha256",
|
||||||
|
"notes": "increase modulus size to 3072 bits or larger"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
"del": {
|
"del": {
|
||||||
"enc": [
|
"enc": [
|
||||||
{
|
{
|
||||||
"name": "chacha20-poly1305@openssh.com",
|
"name": "chacha20-poly1305@openssh.com",
|
||||||
"notes": ""
|
"notes": ""
|
||||||
}
|
}
|
||||||
|
],
|
||||||
|
"kex": [
|
||||||
|
{
|
||||||
|
"name": "curve25519-sha256",
|
||||||
|
"notes": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "curve25519-sha256@libssh.org",
|
||||||
|
"notes": ""
|
||||||
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,12 +5,15 @@
|
|||||||
[0;32m(gen) compression: enabled (zlib@openssh.com)[0m
|
[0;32m(gen) compression: enabled (zlib@openssh.com)[0m
|
||||||
|
|
||||||
[0;36m# key exchange algorithms[0m
|
[0;36m# key exchange algorithms[0m
|
||||||
[0;32m(kex) curve25519-sha256 -- [info] available since OpenSSH 7.4, Dropbear SSH 2018.76[0m
|
[0;33m(kex) curve25519-sha256 -- [warn] does not provide protection against post-quantum attacks[0m
|
||||||
[0;32m `- [info] default key exchange from OpenSSH 7.4 to 8.9[0m
|
`- [info] available since OpenSSH 7.4, Dropbear SSH 2018.76
|
||||||
[0;32m(kex) curve25519-sha256@libssh.org -- [info] available since OpenSSH 6.4, Dropbear SSH 2013.62[0m
|
`- [info] default key exchange from OpenSSH 7.4 to 8.9
|
||||||
[0;32m `- [info] default key exchange from OpenSSH 6.5 to 7.3[0m
|
[0;33m(kex) curve25519-sha256@libssh.org -- [warn] does not provide protection against post-quantum attacks[0m
|
||||||
[0;32m(kex) diffie-hellman-group-exchange-sha256 (4096-bit) -- [info] available since OpenSSH 4.4[0m
|
`- [info] available since OpenSSH 6.4, Dropbear SSH 2013.62
|
||||||
[0;32m `- [info] OpenSSH'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 4096. This can only be disabled by recompiling the code (see https://github.com/openssh/openssh-portable/blob/V_9_4/dh.c#L477).[0m
|
`- [info] default key exchange from OpenSSH 6.5 to 7.3
|
||||||
|
[0;33m(kex) diffie-hellman-group-exchange-sha256 (4096-bit) -- [warn] does not provide protection against post-quantum attacks[0m
|
||||||
|
`- [info] available since OpenSSH 4.4
|
||||||
|
`- [info] OpenSSH'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 4096. This can only be disabled by recompiling the code (see https://github.com/openssh/openssh-portable/blob/V_9_4/dh.c#L477).
|
||||||
|
|
||||||
[0;36m# host-key algorithms[0m
|
[0;36m# host-key algorithms[0m
|
||||||
[0;32m(key) ssh-ed25519 -- [info] available since OpenSSH 6.5, Dropbear SSH 2020.79[0m
|
[0;32m(key) ssh-ed25519 -- [info] available since OpenSSH 6.5, Dropbear SSH 2020.79[0m
|
||||||
@@ -34,11 +37,12 @@
|
|||||||
[0;32m(fin) ssh-ed25519: SHA256:UrnXIVH+7dlw8UqYocl48yUEcKrthGDQG2CPCgp7MxU[0m
|
[0;32m(fin) ssh-ed25519: SHA256:UrnXIVH+7dlw8UqYocl48yUEcKrthGDQG2CPCgp7MxU[0m
|
||||||
|
|
||||||
[0;36m# algorithm recommendations (for OpenSSH 8.0)[0m
|
[0;36m# algorithm recommendations (for OpenSSH 8.0)[0m
|
||||||
[0;32m(rec) +diffie-hellman-group16-sha512 -- kex algorithm to append [0m
|
|
||||||
[0;32m(rec) +diffie-hellman-group18-sha512 -- kex algorithm to append [0m
|
|
||||||
[0;32m(rec) +rsa-sha2-256 -- key algorithm to append [0m
|
[0;32m(rec) +rsa-sha2-256 -- key algorithm to append [0m
|
||||||
[0;32m(rec) +rsa-sha2-512 -- key algorithm to append [0m
|
[0;32m(rec) +rsa-sha2-512 -- key algorithm to append [0m
|
||||||
|
[0;33m(rec) !diffie-hellman-group-exchange-sha256 -- kex algorithm to change (increase modulus size to 3072 bits or larger) [0m
|
||||||
[0;33m(rec) -chacha20-poly1305@openssh.com -- enc algorithm to remove [0m
|
[0;33m(rec) -chacha20-poly1305@openssh.com -- enc algorithm to remove [0m
|
||||||
|
[0;33m(rec) -curve25519-sha256 -- kex algorithm to remove [0m
|
||||||
|
[0;33m(rec) -curve25519-sha256@libssh.org -- kex algorithm to remove [0m
|
||||||
|
|
||||||
[0;36m# additional info[0m
|
[0;36m# additional info[0m
|
||||||
[0;33m(nfo) For hardening guides on common OSes, please see: <https://www.ssh-audit.com/hardening_guides.html>[0m
|
[0;33m(nfo) For hardening guides on common OSes, please see: <https://www.ssh-audit.com/hardening_guides.html>[0m
|
||||||
|
|||||||
@@ -43,6 +43,9 @@
|
|||||||
"info": [
|
"info": [
|
||||||
"default key exchange from OpenSSH 7.4 to 8.9",
|
"default key exchange from OpenSSH 7.4 to 8.9",
|
||||||
"available since OpenSSH 7.4, Dropbear SSH 2018.76"
|
"available since OpenSSH 7.4, Dropbear SSH 2018.76"
|
||||||
|
],
|
||||||
|
"warn": [
|
||||||
|
"does not provide protection against post-quantum attacks"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -52,6 +55,9 @@
|
|||||||
"info": [
|
"info": [
|
||||||
"default key exchange from OpenSSH 6.5 to 7.3",
|
"default key exchange from OpenSSH 6.5 to 7.3",
|
||||||
"available since OpenSSH 6.4, Dropbear SSH 2013.62"
|
"available since OpenSSH 6.4, Dropbear SSH 2013.62"
|
||||||
|
],
|
||||||
|
"warn": [
|
||||||
|
"does not provide protection against post-quantum attacks"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -4,10 +4,12 @@
|
|||||||
[0;32m(gen) compression: disabled[0m
|
[0;32m(gen) compression: disabled[0m
|
||||||
|
|
||||||
[0;36m# key exchange algorithms[0m
|
[0;36m# key exchange algorithms[0m
|
||||||
[0;32m(kex) curve25519-sha256 -- [info] available since OpenSSH 7.4, Dropbear SSH 2018.76[0m
|
[0;33m(kex) curve25519-sha256 -- [warn] does not provide protection against post-quantum attacks[0m
|
||||||
[0;32m `- [info] default key exchange from OpenSSH 7.4 to 8.9[0m
|
`- [info] available since OpenSSH 7.4, Dropbear SSH 2018.76
|
||||||
[0;32m(kex) curve25519-sha256@libssh.org -- [info] available since OpenSSH 6.4, Dropbear SSH 2013.62[0m
|
`- [info] default key exchange from OpenSSH 7.4 to 8.9
|
||||||
[0;32m `- [info] default key exchange from OpenSSH 6.5 to 7.3[0m
|
[0;33m(kex) curve25519-sha256@libssh.org -- [warn] does not provide protection against post-quantum attacks[0m
|
||||||
|
`- [info] available since OpenSSH 6.4, Dropbear SSH 2013.62
|
||||||
|
`- [info] default key exchange from OpenSSH 6.5 to 7.3
|
||||||
[0;33m(kex) sntrup4591761x25519-sha512@tinyssh.org -- [warn] using experimental algorithm[0m
|
[0;33m(kex) sntrup4591761x25519-sha512@tinyssh.org -- [warn] using experimental algorithm[0m
|
||||||
`- [info] available since OpenSSH 8.0
|
`- [info] available since OpenSSH 8.0
|
||||||
`- [info] the sntrup4591761 algorithm was withdrawn, as it may not provide strong post-quantum security
|
`- [info] the sntrup4591761 algorithm was withdrawn, as it may not provide strong post-quantum security
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ class TestAuditConf:
|
|||||||
def init(self, ssh_audit):
|
def init(self, ssh_audit):
|
||||||
self.AuditConf = ssh_audit.AuditConf
|
self.AuditConf = ssh_audit.AuditConf
|
||||||
self.OutputBuffer = ssh_audit.OutputBuffer()
|
self.OutputBuffer = ssh_audit.OutputBuffer()
|
||||||
self.usage = ssh_audit.usage
|
|
||||||
self.process_commandline = process_commandline
|
self.process_commandline = process_commandline
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
@@ -107,7 +106,7 @@ class TestAuditConf:
|
|||||||
|
|
||||||
def test_audit_conf_process_commandline(self):
|
def test_audit_conf_process_commandline(self):
|
||||||
# pylint: disable=too-many-statements
|
# pylint: disable=too-many-statements
|
||||||
c = lambda x: self.process_commandline(self.OutputBuffer, x.split(), self.usage) # noqa
|
c = lambda x: self.process_commandline(self.OutputBuffer, x.split()) # noqa
|
||||||
with pytest.raises(SystemExit):
|
with pytest.raises(SystemExit):
|
||||||
conf = c('')
|
conf = c('')
|
||||||
with pytest.raises(SystemExit):
|
with pytest.raises(SystemExit):
|
||||||
@@ -163,7 +162,7 @@ class TestAuditConf:
|
|||||||
conf = c('-64 localhost')
|
conf = c('-64 localhost')
|
||||||
self._test_conf(conf, host='localhost', ipv4=True, ipv6=True, ipvo=(6, 4))
|
self._test_conf(conf, host='localhost', ipv4=True, ipv6=True, ipvo=(6, 4))
|
||||||
conf = c('-b localhost')
|
conf = c('-b localhost')
|
||||||
self._test_conf(conf, host='localhost', batch=True, verbose=True)
|
self._test_conf(conf, host='localhost', batch=True)
|
||||||
conf = c('-n localhost')
|
conf = c('-n localhost')
|
||||||
self._test_conf(conf, host='localhost', colors=False)
|
self._test_conf(conf, host='localhost', colors=False)
|
||||||
conf = c('-v localhost')
|
conf = c('-v localhost')
|
||||||
|
|||||||
@@ -0,0 +1,41 @@
|
|||||||
|
import pytest
|
||||||
|
from ssh_audit.ssh_audit import process_commandline
|
||||||
|
|
||||||
|
|
||||||
|
# pylint: disable=attribute-defined-outside-init
|
||||||
|
class TestHardeningGuides:
|
||||||
|
@pytest.fixture(autouse=True)
|
||||||
|
def init(self, ssh_audit):
|
||||||
|
self.OutputBuffer = ssh_audit.OutputBuffer()
|
||||||
|
self.process_commandline = process_commandline
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def _test_conf(conf, **kwargs):
|
||||||
|
options = {
|
||||||
|
'get_hardening_guides': '',
|
||||||
|
}
|
||||||
|
for k, v in kwargs.items():
|
||||||
|
options[k] = v
|
||||||
|
assert conf.get_hardening_guides == options['get_hardening_guides']
|
||||||
|
|
||||||
|
def test_printconfig_conf_process_commandline(self):
|
||||||
|
# pylint: disable=too-many-statements
|
||||||
|
c = lambda x: self.process_commandline(self.OutputBuffer, x.split()) # noqa
|
||||||
|
with pytest.raises(SystemExit):
|
||||||
|
conf = c('')
|
||||||
|
with pytest.raises(SystemExit):
|
||||||
|
conf = c('--get-hardening-guides')
|
||||||
|
self._test_conf(conf)
|
||||||
|
with pytest.raises(SystemExit):
|
||||||
|
conf = c('--list-hardening-guides')
|
||||||
|
self._test_conf(conf)
|
||||||
|
|
||||||
|
for vendor in ["Amazon", "Debian", "Rocky", "Mint", "Ubuntu", "NoOS", " "]:
|
||||||
|
vendor = vendor
|
||||||
|
for os_ver in ["2404", "2204", "2004", "1804", "2023", "22", "21", "20", "9", "Bookworm", "Bullseye", "NoVersion", ""]:
|
||||||
|
os_ver = os_ver
|
||||||
|
for cs_type in ["Client", "Server", "Mistake", ""]:
|
||||||
|
cs_type = cs_type
|
||||||
|
with pytest.raises(SystemExit):
|
||||||
|
conf = c(f'--get-hardening-guides {vendor} {os_ver} {cs_type}')
|
||||||
|
self._test_conf(conf)
|
||||||
+1
-1
@@ -165,7 +165,7 @@ class TestSSH2:
|
|||||||
self.audit(out, self._conf())
|
self.audit(out, self._conf())
|
||||||
out.write()
|
out.write()
|
||||||
lines = output_spy.flush()
|
lines = output_spy.flush()
|
||||||
assert len(lines) == 78
|
assert len(lines) == 74
|
||||||
|
|
||||||
def test_ssh2_server_invalid_first_packet(self, output_spy, virtual_socket):
|
def test_ssh2_server_invalid_first_packet(self, output_spy, virtual_socket):
|
||||||
vsocket = virtual_socket
|
vsocket = virtual_socket
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ class Test_SSH2_KexDB:
|
|||||||
@pytest.fixture(autouse=True)
|
@pytest.fixture(autouse=True)
|
||||||
def init(self):
|
def init(self):
|
||||||
self.db = SSH2_KexDB.get_db()
|
self.db = SSH2_KexDB.get_db()
|
||||||
|
self.pq_warning = SSH2_KexDB.WARN_NOT_PQ_SAFE
|
||||||
|
|
||||||
def test_ssh2_kexdb(self):
|
def test_ssh2_kexdb(self):
|
||||||
'''Ensures that the SSH2_KexDB.ALGORITHMS dictionary is in the right format.'''
|
'''Ensures that the SSH2_KexDB.ALGORITHMS dictionary is in the right format.'''
|
||||||
@@ -33,3 +34,38 @@ class Test_SSH2_KexDB:
|
|||||||
# The first entry denotes the versions when this algorithm was added to OpenSSH, Dropbear, and/or libssh, followed by when it was deprecated, and finally when it was removed. Hence it must have between 0 and 3 entries.
|
# The first entry denotes the versions when this algorithm was added to OpenSSH, Dropbear, and/or libssh, followed by when it was deprecated, and finally when it was removed. Hence it must have between 0 and 3 entries.
|
||||||
added_entry = alg_data[0]
|
added_entry = alg_data[0]
|
||||||
assert 0 <= len(added_entry) <= 3
|
assert 0 <= len(added_entry) <= 3
|
||||||
|
|
||||||
|
|
||||||
|
def test_kex_pq_unsafe(self):
|
||||||
|
'''Ensures that all key exchange algorithms are marked as post-quantum unsafe, unless they appear in a whitelist.'''
|
||||||
|
|
||||||
|
# These algorithms include protections against quantum attacks.
|
||||||
|
kex_pq_safe = [
|
||||||
|
"ecdh-nistp256-kyber-512r3-sha256-d00@openquantumsafe.org",
|
||||||
|
"ecdh-nistp384-kyber-768r3-sha384-d00@openquantumsafe.org",
|
||||||
|
"ecdh-nistp521-kyber-1024r3-sha512-d00@openquantumsafe.org",
|
||||||
|
"ext-info-c",
|
||||||
|
"ext-info-s",
|
||||||
|
"kex-strict-c-v00@openssh.com",
|
||||||
|
"kex-strict-s-v00@openssh.com",
|
||||||
|
"mlkem768x25519-sha256",
|
||||||
|
"sntrup4591761x25519-sha512@tinyssh.org",
|
||||||
|
"sntrup761x25519-sha512@openssh.com",
|
||||||
|
"sntrup761x25519-sha512",
|
||||||
|
"x25519-kyber-512r3-sha256-d00@amazon.com",
|
||||||
|
"x25519-kyber512-sha512@aws.amazon.com"
|
||||||
|
]
|
||||||
|
|
||||||
|
failures = []
|
||||||
|
for kex_name in self.db['kex']:
|
||||||
|
|
||||||
|
# Skip key exchanges that are PQ safe.
|
||||||
|
if kex_name in kex_pq_safe:
|
||||||
|
continue
|
||||||
|
|
||||||
|
# Ensure all other kex exchanges have the proper PQ unsafe flag set in their warnings list.
|
||||||
|
alg_data = self.db['kex'][kex_name]
|
||||||
|
if len(alg_data) < 3 or self.pq_warning not in alg_data[2]:
|
||||||
|
failures.append(kex_name)
|
||||||
|
|
||||||
|
assert failures == []
|
||||||
|
|||||||
Reference in New Issue
Block a user