LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Security (https://www.linuxquestions.org/questions/linux-security-4/)
-   -   block telnet to port 80 (https://www.linuxquestions.org/questions/linux-security-4/block-telnet-to-port-80-a-199811/)

neil 07-01-2004 04:55 AM

block telnet to port 80
 
Hi,

How can I block telnet to port 80.
I read the post how to block telnet to port 25 but it doesnt actually say how.

I have turned off telnet and I have a iptables firewall that allows port 80 in.
The Firewall has a explicit deny all at the end.

This does not stop telnet connections to ports 80 or any other port allowed through the firewall.

I guess there must be a way to examine traffic at a protocol level
so traffic with destination port 80 with telnet protocol is denied.

So, can anyone tell me how to do this with iptables?

Cheers.
Neil.

ppuru 07-01-2004 05:56 AM

switching off telnet services will not stop telnet connects to port 80 or port 25.

You can use telnet to connect to any open port ( a port that is listening ) that is ready to accept connections.

So, if you have apache or any other http server listening on port 80, it will also respond to telnet attempts ... although, it will not give a login prompt.

neil 07-01-2004 06:00 AM

Yes I know,

But can I get iptables to filter on protocol?

The reason I ask is because somebody tried an exploit on my webserver by telnetting to port 80 and issueing commands. They were unsuccessful and have been reported to their ISP.

Cheers,

dunkyb 07-01-2004 06:07 AM

iptables -A INPUT -p TCP -s 0/0 --dport 23 -s 0/0 -j DROP

ppuru 07-01-2004 06:23 AM

you may use the string search feature in iptables... read somewhere that this feature is not available with 2.6 kernels ... correct me if I am wrong

http://www.lowth.com/howto/iptables-treasures.php


All times are GMT -5. The time now is 10:16 AM.