Sponsored Content
Special Forums IP Networking block telnet to specific port Post 17765 by LivinFree on Wednesday 20th of March 2002 01:50:03 AM
Old 03-20-2002
What do you mean by "telnet access to port 80"? Incoming? Or outgoing? As far as I am aware, there is no reliable means of knowing which application is producing an incoming request, nor is there any reliable way of blocking outgoing requests based on the application. One of the reasons is that there is no set source port - it just picks one above 1024 that isn't in use, and makes the connection.

Someone let me know if I'm wrong...
 

10 More Discussions You Might Find Interesting

1. Solaris

disabled telnet now need port 23 or port 22

we disabled telnet on solaris 9 via previous a thread. We use CMS (call management system) supervisor which used port 23 (telnet). We cannot use telnet via local directive and it was shut down as stated when we shut down telnet in the inetd file. I cannot now log into the CMS box since port 23 is... (3 Replies)
Discussion started by: panzerkw
3 Replies

2. UNIX for Advanced & Expert Users

telnet on specific port??

Hi all, I have a problem. I have machine names and their IP addresses in /etc/hosts file. My application does telnet on that machine host name. The application does not uses IP address for tenet. It will fetch the host name from /etc/hosts file. Now the telnet server runs on customized port.... (6 Replies)
Discussion started by: zing_foru
6 Replies

3. Shell Programming and Scripting

Telnet IP and Port Script

Hi, I would like to create a simple script that will telnet a number of IP and Ports one after the other to confirm connectivity to those addresses. I don't need to log on, just output to a file what the response is, i.e Escape Character, connectivity refused etc. Complete newbie to... (6 Replies)
Discussion started by: asou
6 Replies

4. AIX

Telnet to port

can some one help me ? what happens when we telnet to a port ? example telnet 192.168.0.xx 1234 where 1234 is a port number Thank you (5 Replies)
Discussion started by: anwesh
5 Replies

5. Windows & DOS: Issues & Discussions

Telnet to a serial port

Hello all. I have an old computer with M$-DOS 7. I want to use it like a dumb terminal, with telnet. I need to connect it to my desktop These are my questions: How can i configure the serial port on dos? How can i telnet form dos to the serial port? How can i set up a telnet server on the... (12 Replies)
Discussion started by: mghis
12 Replies

6. Cybersecurity

Can't telnet to port 25 on the host.

Hi, we have recently setup a new UNIX server with solaris 10 and I am having issue with with SMTP/sendmail. telnet localhost 25 --- works telnet hostname.domain.com 25 -- does not work. # telnet hostname.domain.com 25 Trying 10.122.1.111... telnet: Unable to connect to remote host:... (1 Reply)
Discussion started by: esmgr
1 Replies

7. Red Hat

telnet port 23

My linux version is 2.6.18-194.e14 (Oracle enterprise linux). Could you please tell me how to enable telnet on the server. When I try to connect the server through another pc using telnet it is throwing error. Connecting To <ip address>...Could not open connection to the host, on port 23.... (3 Replies)
Discussion started by: oradba_arun
3 Replies

8. IP Networking

telnet for port 5433 is not working while it works for port 22

Hi, I am trying to set up a dev environment and I have Ubuntu server (10.16.1.92) and a CentOS VM (10.16.3.235) on this. On the CentOS I have a program running on port 5433. Now my problem is that I am unable to telnet this port from another Windows server whereas I can telnet port 22 from... (5 Replies)
Discussion started by: rishav
5 Replies

9. UNIX for Dummies Questions & Answers

telnet echoing 'trying ip' but no port number

Hi, Well this is probably a silly one that I should know...but I don't ! I'm telnetting to various ports from a shell script and the telnet is echoing back that it's 'trying xxx.xx.xx.xx...' but not the port number it's trying! Any help much appreciated Thanks (1 Reply)
Discussion started by: Grueben
1 Replies

10. Solaris

Block port for all except for one specific ip in Solaris11.4

Hi, I need to block ssh port 22 from all the servers except one server ip. Until solaris11.3 and below, I used to do like below(under /etc/ipf/ipf.conf),and it's working fine pass in quick from $server_ip to any port=22 block in quick from any to any port=22 But I tried almost same in... (1 Reply)
Discussion started by: Sumanthsv
1 Replies
DIVERT(4)						   BSD Kernel Interfaces Manual 						 DIVERT(4)

NAME
divert -- kernel packet diversion mechanism SYNOPSIS
#include <sys/types.h> #include <sys/socket.h> #include <netinet/in.h> int socket(PF_INET, SOCK_RAW, IPPROTO_DIVERT); DESCRIPTION
Divert sockets are similar to raw IP sockets, except that they can be bound to a specific divert port via the bind(2) system call. The IP address in the bind is ignored; only the port number is significant. A divert socket bound to a divert port will receive all packets diverted to that port by some (here unspecified) kernel mechanism(s). Packets may also be written to a divert port, in which case they re- enter kernel IP packet processing. Divert sockets are normally used in conjunction with FreeBSD's packet filtering implementation and the ipfw(8) program. By reading from and writing to a divert socket, matching packets can be passed through an arbitrary ``filter'' as they travel through the host machine, special routing tricks can be done, etc. READING PACKETS
Packets are diverted either as they are ``incoming'' or ``outgoing.'' Incoming packets are diverted after reception on an IP interface, whereas outgoing packets are diverted before next hop forwarding. Diverted packets may be read unaltered via read(2), recv(2), or recvfrom(2). In the latter case, the address returned will have its port set to the some tag supplied by the packet diverter, (usually the ipfw rule number) and the IP address set to the (first) address of the inter- face on which the packet was received (if the packet was incoming) or INADDR_ANY (if the packet was outgoing). In the case of an incoming packet the interface name will also be placed in the 8 bytes following the address, (assuming it fits). WRITING PACKETS
Writing to a divert socket is similar to writing to a raw IP socket; the packet is injected ``as is'' into the normal kernel IP packet pro- cessing and minimal error checking is done. Packets are written as either incoming or outgoing: if write(2) or send(2) is used to deliver the packet, or if sendto(2) is used with a destination IP address of INADDR_ANY, then the packet is treated as if it were outgoing, i.e., destined for a non-local address. Otherwise, the packet is assumed to be incoming and full packet routing is done. In the latter case, the IP address specified must match the address of some local interface, or an interface name must be found after the IP address. If an interface name is found, that interface will be used and the value of the IP address will be ignored (other than the fact that it is not INADDR_ANY). This is to indicate on which interface the packet ``arrived.'' Normally, packets read as incoming should be written as incoming; similarly for outgoing packets. When reading and then writing back pack- ets, passing the same socket address supplied by recvfrom(2) unmodified to sendto(2) simplifies things (see below). The port part of the socket address passed to the sendto(2) contains a tag that should be meaningful to the diversion module. In the case of ipfw(8) the tag is interpreted as the rule number after which rule processing should restart. LOOP AVOIDANCE
Packets written into a divert socket (using sendto(2)) re-enter the packet filter at the rule number following the tag given in the port part of the socket address, which is usually already set at the rule number that caused the diversion (not the next rule if there are several at the same number). If the 'tag' is altered to indicate an alternative re-entry point, care should be taken to avoid loops, where the same packet is diverted more than once at the same rule. DETAILS
To enable divert sockets, your kernel must be compiled with the option IPDIVERT. If a packet is diverted but no socket is bound to the port, or if IPDIVERT is not enabled in the kernel, the packet is dropped. Incoming packet fragments which get diverted are fully reassembled before delivery; the diversion of any one fragment causes the entire packet to get diverted. If different fragments divert to different ports, then which port ultimately gets chosen is unpredictable. Packets are received and sent unchanged, except that packets read as outgoing have invalid IP header checksums, and packets written as outgo- ing have their IP header checksums overwritten with the correct value. Packets written as incoming and having incorrect checksums will be dropped. Otherwise, all header fields are unchanged (and therefore in network order). Binding to port numbers less than 1024 requires super-user access, as does creating a socket of type SOCK_RAW. ERRORS
Writing to a divert socket can return these errors, along with the usual errors possible when writing raw packets: [EINVAL] The packet had an invalid header, or the IP options in the packet and the socket options set were incompatible. [EADDRNOTAVAIL] The destination address contained an IP address not equal to INADDR_ANY that was not associated with any interface. SEE ALSO
bind(2), recvfrom(2), sendto(2), socket(2), ipfw(8) BUGS
This is an attempt to provide a clean way for user mode processes to implement various IP tricks like address translation, but it could be cleaner, and it's too dependent on ipfw(8). It's questionable whether incoming fragments should be reassembled before being diverted. For example, if only some fragments of a packet destined for another machine don't get routed through the local machine, the packet is lost. This should probably be a settable socket option in any case. AUTHORS
Archie Cobbs <archie@FreeBSD.org>, Whistle Communications Corp. BSD
June 18, 1996 BSD
All times are GMT -4. The time now is 10:18 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy