# Enumerating SSH

<figure><img src="https://1710373693-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6aHHcurOjmaXZDagV3Zm%2Fuploads%2FhR5HES9un5mW3HHvb2Ej%2F1.png?alt=media&#x26;token=87996784-9efc-4433-bfef-55663973ed9f" alt=""><figcaption></figcaption></figure>

```bash
ssh 192.168.1.140
ssh 192.168.1.140 -oKexAlgorithms=+diffie-hellman-group1-sha1
ssh 192.168.1.140 -oKexAlgorithms=+diffie-hellman-group1-sha1 -c ssh-rsa
ssh 192.168.1.140 -oKexAlgorithms=+diffie-hellman-group1-sha1 -c ssh-dss
ssh 192.168.1.140 -oKexAlgorithms=+diffie-hellman-group-exchange-sha1
ssh 192.168.1.140 -oKexAlgorithms=+diffie-hellman-group-exchange-sha1 -c ssh-rsa
```

<figure><img src="https://1710373693-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6aHHcurOjmaXZDagV3Zm%2Fuploads%2Fpduf26HvJQ9qf732T5bP%2F2.png?alt=media&#x26;token=d5e4ab17-fcaf-41d2-901a-ea8e5b96fba0" alt=""><figcaption></figcaption></figure>

The command:

```
ssh 192.168.1.140 -oKexAlgorithms=+diffie-hellman-group1-sha1
```

**Connects via SSH** to the host `192.168.1.140`using an **older key exchange algorithm**.

#### Breakdown:

* `ssh 192.168.1.140`Connect to the target via SSH.
* `-oKexAlgorithms=+diffie-hellman-group1-sha1`: Tells SSH to **allow a weak/legacy key exchange algorithm** (`diffie-hellman-group1-sha1`), which is disabled by default in modern SSH clients.

#### Why use this?

To connect to **older devices** (e.g., legacy routers, switches, and embedded systems) that **only support old algorithms**.

#### ⚠️ Warning:

* `diffie-hellman-group1-sha1` is **insecure** and deprecated.
* Use **only if necessary**, and preferably only in **isolated or controlled environments**.
