---
title: "8. Service auth bruteforce (SSH)"
date: 2024-09-25
draft: false
---

The command used to attack a login service is fairly straightforward. We simply have to provide the username/password wordlists, and add `service://SERVER_IP:PORT` at the end. As usual, we will add the `-u -f` flags. Finally, when we run the command for the first time, `hydra` will suggest that we add the `-t 4` flag for a max number of parallel attempts, as many `SSH` limit the number of parallel connections and drop other connections, resulting in many of our attempts being dropped. Our final command should be as follows:

```bash
hydra -L bill.txt -P william.txt -u -f ssh://178.35.49.134:22 -t 4
```

Enumerate ssh a bit and see whats on the system: 
```bash
 ls /home
```
and find another user `m.gates`
```bash
netstat -antp | grep -i list
```
network recon from above output reveals `port 21` is open locally indicating FTP access. 

Note 1: Sometimes administrators test their security measures and policies with different tools. In this case, the administrator of this web server kept "hydra" installed. We can benefit from it and use it against the local system by attacking the FTP service locally or remotely.

Note 2: "rockyou-10.txt" can be found in "/opt/useful/SecLists/Passwords/Leaked-Databases/rockyou-10.txt", which contains 92 passwords in total. This is a shorter version of "rockyou.txt" which includes 14,344,391 passwords.

We can do the same thing against ftp internally 
```bash
hydra -l m.gates -P rockyou-10.txt ftp://127.0.0.1
```
