HAKATEMIA
34Useful Crypto Tools

Auditing SSH settings with Nmap

Easy10MIN

Auditing SSH configuration is important, as outdated or vulnerable cryptographic settings can expose systems to security risks. Let's take a look at the different settings that can be configured for the SSH service and how the Nmap ssh2-enum-algos script can be used to audit SSH crypto settings.

SSH and its cryptographic settings

SSH (Secure Shell) is a protocol that provides a secure way to establish an encrypted connection to remote systems. It is widely used among system administrators and cybersecurity experts for remote connections, file transfers, and executing remote commands on servers. The security of SSH is based on its cryptographic settings, which define how encryption and authentication are performed. These settings are audited to ensure that the connection is secured according to current best practices.

Cryptography algorithms (Ciphers)

Encryption algorithms are crucial for the security of SSH connections, as they define how data is encrypted during the connection. Modern algorithms, such as AES (Advanced Encryption Standard) with different key lengths (for example AES-128, AES-192, AES-256) and ChaCha20, provide strong protection. Older algorithms, such as DES and 3DES, are vulnerable and their use should be avoided.

MAC algorithms (Message Authentication Codes)

MAC algorithms are important for ensuring the integrity and authenticity of data. They produce a digest of the message that ensures that the data has not changed during transmission from sender to receiver. Recommended MAC algorithms include hmac-sha2-256 and hmac-sha2-512, while deprecated algorithms such as hmac-md5 and hmac-sha1 should be avoided due to their weaknesses.

Key Exchange Algorithms

Key exchange algorithms define how a shared encryption key is securely created between parties at the beginning of a connection. Diffie-Hellman group and its variants, such as ECDH (elliptic curve Diffie-Hellman) and Curve25519, are popular choices because they provide strong protection. Older or weaker key exchange algorithms, such as diffie-hellman-group1-sha1, are vulnerable to attacks and their use should be avoided.

1 / 5
Hakatemia Pro

Learn to hack — start here

Hundreds of interactive courses, virtual labs and CTF challenges in your browser. Start a free trial — no card required.