Solved

telnet question

Posted on 2006-06-14
12
270 Views
Last Modified: 2010-04-05
Hi, is there a way to make a reverse telnet [i dont know if the name is correct] using delphi.... what i'm trying to do is establish a telnet connection but, instead of I connect with the server, the server connects to me and wait for the commands...
0
Comment
Question by:plinho
  • 5
  • 3
  • 2
12 Comments
 
LVL 4

Expert Comment

by:LMuadDIb
ID: 16908308
so you want a telent server that once started, will "call home" via telnet to inform you its running, and then act like a telnet server?

0
 
LVL 17

Accepted Solution

by:
TheRealLoki earned 125 total points
ID: 16908407
That is not the nature of the telnet protocol.
you would have to use a telnet client at the "remote" end, and run a telnet server at your end.
Indy (which ships with with some Delphi versions) has a TIdTelnetServer and client
0
 
LVL 17

Expert Comment

by:TheRealLoki
ID: 16908585
I am guessing you are trying to get past a firewall that does not allow the telnet into the telnet server from outside the network.
You can bypass this only by having something on the server machine, or within its' network with access to the server.
1 ugly way I can think of, off the top of my head is using an intermediary program to relay the commands. The server will need to know what address to connect to, so if you want to talk to the server from many different places, you will need to let it know somehow. This is the tricky part. you could use 1 line in a webpage if it comes to it.. but I'll explain a method to do the actual communication, and you can ignore the rest if this is not suitable.

Nework A
======
Server A - the Telnet server

Relay Application "C" (running within Network A)

Application B (containing Server B) - running outside of Network A (where you are) this is what you want Server A to connect to.
---
Relay Application "C" - contains a telnet client for talking to Server, and another client (telnet or TCP) for talking to Application B (where you are)

Application B uses a Server (telnet or TCP). You start this when you want Server A to connect to you

The idea is that Relay Application "C" will periodically try to connect to the server on Application B (once it works out where you are)
If it can connect (ie you have started Project2, which has the server)
Relay Application "C" will then connect to the Server on network A, and relay what you type on Application B to Server A, and the responses back to Application B

like I said, it's ugly, but it does work
0
Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

 
LVL 4

Expert Comment

by:LMuadDIb
ID: 16908616
to be honest I was thinking it was gonna be used for something illegal...a backdoor

thats why I didnt give much info in my first response...  =)
0
 
LVL 17

Expert Comment

by:TheRealLoki
ID: 16908646
hmm, maybe. I see he has asked this before on 01/15/2006 and the question got deleted
maybe I should be more careful in the future :-)
still, it might be a fair question, I had to do a similar thing for my dsl at home until i got a router that supported NAT (tcp tho, not telnet)
0
 

Author Comment

by:plinho
ID: 16913088
I'm just studying delphi and now i'm interested in server-clients programs.... I never made a course so thats why I'm here... I'd like to know what is possible and what's not... there's no "hacker" objectives on it, by the way, I got "hacked" too many times to know that this kind of behavior is totally stupid...
PS: I have a "fixed ip" [dont know if it's the right name in english, my ip is always the same)
0
 

Author Comment

by:plinho
ID: 16979257
so...
0
 
LVL 17

Expert Comment

by:TheRealLoki
ID: 16980396
well.. my example above still holds true.. have you tried it out?
0
 

Author Comment

by:plinho
ID: 17014956
I just didn't understand this part "you could use 1 line in a webpage if it comes to it".... What do you mean?
0
 
LVL 17

Expert Comment

by:TheRealLoki
ID: 17015148
it doesn't matter, since you have a fixed IP. if you didn't though, you could have potentially uploaded it to 1 of the free webservers around the place, so you could "download" the ip as a webpage from elsewhere. But not needed for you.

Typically, a client connects to a server, and then sends commands to the server. There are some implementations of a client-server relationship where the client connects, and the server issues the commands, but it would have to be a specific case and designed that way
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question