Score:1

UFW - Default Deny Incoming does not block telnet

il flag

I have an Ubuntu 22.04 LTS Server setup on a VM. I have ufw enabled with default deny incoming policy

The result of sudo ufw status verbose is:

Status: active
Logging: on (low)
Default: deny (incoming), allow (outgoing), disabled (routed)
New profiles: skip

To                         Action      From
--                         ------      ----
22/tcp                     ALLOW IN    Anywhere                                
10050/tcp                  ALLOW IN    172.16.103.23             
22/tcp (v6)                ALLOW IN    Anywhere (v6)             

So, I am assuming that except the specified 2 ports, all other ports cannot be accessed from outside network.

Now, on a different machine, I try to telnet to the VM server, on the port 80. (destination IP has been masked)

madhurbhaiya@madhurbhaiya:~$ telnet xxx.xx.xxx.xx 80
Trying xxx.xx.xxx.xx...
Connected to xxx.xx.xxx.xx.
Escape character is '^]'.

The telnet is connected. Why is ufw not blocking ? I have similar observation for port 443

Another observation is that if I use the same command on a different port, such as 11, it does not work!

madhurbhaiya@madhurbhaiya:~$ telnet xxx.xx.xxx.xx 11
Trying 216.48.190.217...

What is causing this differing behavior?

Score:0
in flag

Not try-ed telnet.

But I encountered similar problem with ncat. Maybe helpful:

When I run nc -v with my vps ip and (whatever) port, always printed a Ncat: Connected to. (nmap is similar)

That is because I am run-ing a global proxy tool with a tun interface (in detail, clash and its tun mode) on my local machine ... And probably the proxy hijack the request ...


And note that there is a common issue about ufw and strangely opened port when using docker

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.