# telnet



## ajoyce (Jul 30, 2002)

Can anyone help me out with telnet. I know some of how to use it, but just need to know the common commands, or how to use them. ALso I would like to know how I can telnet into a computer on a network, behind a router? is this possible??


----------



## Pseudocyber (Sep 10, 2002)

Telnet is an application included within the TCP/IP "suite". It is used to make a remote connection to a device, or host, and run remote console type commands. If you run an application which is "menu driven" or command line driven, you can probably do it with Telnet.

This makes it GREAT for working on network equipment in particular, although one can run a Telnet daemon, or service, on a server to allow command line access to the server.

There is next to zero configuration for telnet on the client side. Basically, you would type something like this at a command line (DOS Prompt):

c:\telnet 192.168.1.1

Typing the above command would attempt to open a telnet session to the IP address. The device at the IP address would have to be running a Telnet daemon/service and listening for Telnet connections.

Configuring for telnet on the network infrastructure in between and on the destination is slightly more involved.

You have to allow telnet through your firewall coming in from the outside. This is a HUGE security risk and is typically disallowed by most organizations. Also, outside devices, such as internet routers typically do not allow Telnet to connect to the device, simply by not running it or denying all connections. Yes, there are some routers on the internet you can Telnet too, but these are typically User mode access only - intended to be testing tools for networking pros.

On a network device, and probably on a server, you have more configuration options for Telnet. You can allow an incoming session only from certain IP addresses, during certain times, you can set usernames and passwords or you can specify a RADIUS server for authentication, and a few others.

Be aware, Telnet is clear text - unencrypted at all. For this reason, Telnet is being phased out in usage by Networking Professionals in favor of SSH - Secure SHell. SSH will do the same thing but is encrypted.

Oh, I almost forgot, you can tell Telnet to connect over a certain port. For this reason, it is a neat trick to test whether you have connectivity to the IP address as well as the port. Depending on what you're Telnetting to, you will get different responses if the port is open. For instance, 

c:\telnet 192.168.1.1:80 

This would specify to make a Telnet connection to the IP address over port 80, http, to test to see if there is a web server that is alive and listening.

HTH


----------



## johnwill (Sep 26, 2002)

Actually, if you telnet to an HTTP server, it just tells you it can't open a connection. Here's an attempt to contact my broadband router on port 80 and 81 with Telnet, note they're the same error.


c:\>telnet 192.168.2.1 81
Connecting To 192.168.2.1...Could not open a connection to host on port 81 : Connect failed

c:\>telnet 192.168.2.1 80
Connecting To 192.168.2.1...Could not open a connection to host on port 80 : Connect failed

c:\>


----------



## Pseudocyber (Sep 10, 2002)

Did you notice a difference in the amount of time you get the error messages?



> Depending on what you're Telnetting to, you will get different responses if the port is open.


Actually, I've seen telnet respond when telnetting to webservers with a blank window. 

With 80 not listening, telnet immediately comes back with a can't connect error.

You can telnet to an SMTP server to test connectivity, for instance. The neat thing about using Telnet to test, is that it tests all 7 layers of the OSI model, as I'm sure you know.


----------



## ajoyce (Jul 30, 2002)

OK, lets just say for argument sake that....I wanted to telnet into a computer thats not on my lan, but is on another lan. And as it seems most smaller routers give the 192.168.1.? addresses right?

How can telnet even know where to look, because im sure everyone and their dog has these same addresses???


----------



## Pseudocyber (Sep 10, 2002)

You're right - the 192.168.0.0 address space is reserved for private IP addresses and is not routeable over the internet. This is why most soho networks use it - and even a lot of commercial networks.

Your soho router is doing NAT - Network Address Translation. This will allow many IP addresses to pretend they are one address. So, your ISP gives your router an address on it's outside interface and your router NATs to the inside of your network. 

Therefore, if you're going to telnet over the internet to a host behind a router, you would have to telnet to the "public" address. In a "professional" computer network, the destination would be in a DMZ and be accessible - or - the perimeter device would NAT it to the right IP address and port.

In the case of a SOHO, you'd have to telnet to the outside IP address of the persons internet router. They would have to have port forwarding set up to the appropriate server you're trying to reach.

HTH


----------



## CK1 (Jun 19, 2003)

Basically, telnet will open a stream connection to any *port* on a computer. You can use a port scanner program to scan either a single computer for open ports OR to scan an entire IP range (e.g. 192.168.1.x, where every x value from 0 to 255 is checked and its ports scanned).

You could then telnet to any open port on an IP, e.g. at a command prompt or from START-->RUN...

telnet 192.168.1.15ORT NUMBER

As for "common commands", it all depends on what is on the port you're telnetting to! If it's just a port that tells you the time then closes the connection, you'd have nothing to type... if you're connecting to a unix shell the commands would be identical to those available on the unix operating system... if it's a SMTP e-mail server you'll be limited to commands like 'RECIPIENT' and 'SUBJECT', etc.

Hope it helps!


----------



## johnwill (Sep 26, 2002)

CK1 said:


> *Basically, telnet will open a stream connection to any port on a computer. *


Well... not exactly.  While you can certainly specify any port for the Telnet command, unless the port in question has Telnet capability, you won't get an answer.


----------



## V0lt (Sep 14, 2002)

That's kinda wrong too...If you are telnetting to a port that's not meant to be telnetted to, you might very well get a response, though not the one you want.


----------



## Pseudocyber (Sep 10, 2002)

Agree - the response depends on the app listening on the port.


----------



## noddageek (Jun 20, 2003)

*Telnet email*

Forgive me! I'm new here and I can't seem to start my own thread so I'm just posting this here.

I am looking for a script or software to access email on my DNS via Telnet that is capable of bouncing unwanted emails. Bouncing email is a great way to stop a lot of spammers, at least the ones that take your address off their list when it bounces back to them.

The reason for using a Telnet connection is to get around using ports 110 and 25. The reason for that is because I want to use an ISP that blocks those ports (they think that blocking POP3 and SMTP is the only way for them to stop spammers). Why do I want to use that ISP? Because it is FREE! (NoCharge.com).

I have been able to bounce emails at my DNS using programs such as Mailwasher, but that requires using an ISP that doesn't block ports 110 and 25 and charges for the connection.

Since it is possible for me to access my email through the free ISP using Telnet without using ports 110 and 25 and do things like read, write, send, receive, forward, delete, etc. using the "mail" command at the Unix prompt, I figure there ought to be a way to do a real email bounce (I don't want to do a simulated bounce) from my DN server.

Anybody out there have any ideas on this? Thanks in advance!


----------



## Pseudocyber (Sep 10, 2002)

I don't know.

Out of curiosity, is spam so much of a problem for you that you go to such extraordinary lengths to block it!?!?


----------



## noddageek (Jun 20, 2003)

In a manner of speaking, I guess you could say that spam is such a problem with me that I would indeed go to such lengths. The result of my efforts so far is that I get practically no spam whatsoever. I am obsessed! I get so little spam that I have the pleasure of going after every last piece of junk email that arrives with a vengence. Your question is very astute! You saw right through me! I have to admit that if I managed to eliminate all the spam I get I would die of sheer boredom. 

Oh yeah, BTW, I called it my DNS in the original post when I should have called it my web/email host. I know nothing!

Okay, enough fun! I do think that the challenge of coming up with a way to do what I was thinking on my web/email host server is exactly that -- a challenge -- mostly because I don't know how. I'm too lazy to figure it out for myself and I'm hoping someone else already did. Which is preposterous because normally, nobody would bother -- kinda like you pointed out. I mean, I could just Telnet in and be able to sort out the spam and delete it (which I could do anyway if I jsut used the ISP that I pay for while using an ordinary email client), but I have this sense of moral responsibility that compels me to nail spammers for being so rude in their inconsideration for the privacy of others, not to mention the waste of time and resources that spammers cause. I want to get them back!

Oh God! I'm ranting!

I wouldn't blame anyone for just ignoring me! Seriously, though, I think it would be cool to be able to bouce spam without having to pay an ISP for the capability. I am burdened with the availability of a free ISP that is crippled. Ratz!

Thank you so much for your time. I realize that there are probably more interesting aspects of computing then my strange ideas. Still, I feel this overwhelming urge to find a way to do this. I should have continued learning programming when I was younger and still had brain cells. <ha ha>

Thank You!


----------



## noddageek (Jun 20, 2003)

*Found a way*

I found a simple way to do what I wanted to do, namely, bounce emails at my server that were sent to particular email addresses because they are always spam. Here's how it works on my web/email host server:

I can create up to 20 POP3 email boxes in addition to my main box. So I created a new mailbox and then deleted it. When I create a new box it is automatically given a name by my server and the last characters of the name are numbers representing the number of the times I have created a new box. So when I delete a box, any mail sent to it will bounce. My server gives me another option where I can forward mail to one of my boxes or to an external email address. This option requires that you specify a particular incoming address to be forwarded to the desired box or email address. If the box or email address to be forwarded to doesn't exist, the mail gets bounced. So all I have to do is set up forwarding using the addresses that get nothing but spam, i.e., [email protected]<mydomain>.com (yeah, Network Solutions blabbed that address all over the place!), to be sent to the non-existent mailbox. I can also specify more than one recipient for the spam to be forwarded to -- another box or email address or multiple boxes and addresses. That way, when an email is bounced it can also be saved in another box or address where I can make sure it is spam or not. I have tested it and it works great.

It is so simple -- if you send email to non-existing addresses it bounces -- well, DUH! I should have thought of this sooner! 

Well, maybe someone out there will be able to use this info besides me.

Cheers!


----------



## ajoyce (Jul 30, 2002)

*pc anywhere*

SO, how can I pc anywhere into a comuter on a network? how does that work? i opened the ports on my router to allow it to work in theory.


----------



## V0lt (Sep 14, 2002)

Simply enabling port forwarding on your network will not allow you to use telnet to access them. You will first need to set up a daemon on the computer you want to telnet to. If you don't know of any daemons, I would recommend Fictional, which is for windows. If the computers on your network are running Linux, then you won't have any problems using telnet since it already acts as a server.


----------



## johnwill (Sep 26, 2002)

Windows 2000 or XP also have a Telnet server standard, you just have to enable the service.


----------



## ajoyce (Jul 30, 2002)

How do you go about Enabling telnet. Also does this also apply to pc anywhere?


----------



## V0lt (Sep 14, 2002)

hmmm....using pcAnywhere

Have you looked through the instructions for pcAnywhere?

Also, if you are going from one computer within the network to another within the network, it will not make a difference at all whether you have port forwarding enabled or not.

edit: I don't think that pcAnywhere even uses the telnet protocol, I would think that it has its own proprietary software as an interface (I could be wrong though).


----------



## Pseudocyber (Sep 10, 2002)

PC Anywhere doesn't use telnet. PC A is a remote control program. Telnet is a remote shell utility - think command line. Think DOS.


----------



## ajoyce (Jul 30, 2002)

im sorry, i guess i new what the difference from telnet and pc anywhere is. but i was just curious of how to connect 2 computers on two different networks together. since the ip address we have on each network at practically the same. (192.168.1.?)

I cant seem to find the documentation for pc anywhere. even the symantic site doesnt help me much.


----------



## johnwill (Sep 26, 2002)

Maybe you should start over and tell us what you're trying to accomplish with the connection between the two machines.


----------



## ajoyce (Jul 30, 2002)

Thanks for all of your help. I figured it out. It did need to have ports being forward to work. Thanks again.


----------



## V0lt (Sep 14, 2002)

Oh, I see then. I didn't know you were using two different networks


----------

