Link to home
Start Free TrialLog in
Avatar of plinho
plinho

asked on

telnet question

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...
Avatar of LMuadDIb
LMuadDIb
Flag of United States of America image

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?

ASKER CERTIFIED SOLUTION
Avatar of TheRealLoki
TheRealLoki
Flag of New Zealand image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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
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...  =)
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)
Avatar of plinho
plinho

ASKER

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)
Avatar of plinho

ASKER

so...
well.. my example above still holds true.. have you tried it out?
Avatar of plinho

ASKER

I just didn't understand this part "you could use 1 line in a webpage if it comes to it".... What do you mean?
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